fix(statusline): fix f-string syntax error silently breaking reset time display#780
Closed
jlacour-git wants to merge 1 commit into
Closed
fix(statusline): fix f-string syntax error silently breaking reset time display#780jlacour-git wants to merge 1 commit into
jlacour-git wants to merge 1 commit into
Conversation
…me display
Python f-strings (pre-3.12) cannot contain the same quote character used
as the f-string delimiter. The clock_time() calls used double-quoted string
literals inside double-quoted f-strings:
print(f"clock_5h='{clock_time(r5h, "hourly")}'")
This is a SyntaxError. Because the python3 invocation uses `2>/dev/null`,
the error is silently swallowed and the entire eval block produces no output.
All four reset-time variables (reset_5h, reset_7d, clock_5h, clock_7d) are
left unset, so the statusline shows ↻— instead of a real time for all users
with valid OAuth tokens.
Fix: use single-quoted string literals inside the double-quoted f-strings.
Single quotes inside a double-quoted f-string are valid in Python 3.6+.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Good catch on the nested quoting — this is fixed in v4.0.1. Changed the escaped double quotes to single quotes inside the f-strings. Closing as the fix is included in the release. |
danielmiessler
added a commit
that referenced
this pull request
Feb 28, 2026
Addresses community feedback from Discussion #754 and PRs #762, #780, #806: - Add upgrade path documentation to README (separate from fresh install) - Add configurable temperature unit (°F/°C) in settings.json + installer - Statusline reads principal.timezone instead of hardcoded America/Los_Angeles - Remove broken context fallback after /clear (PR #806) - Remove self-calibrating startup estimate inflating fresh session context % - Fix f-string nested quoting in Python eval block (PR #780) - Fix FAQ: remove stale Python reference, improve recovery guidance - Rename Releases/v4.0 → Releases/v4.0.0 for semver consistency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
catwhisperingninja
pushed a commit
to catwhisperingninja/pai
that referenced
this pull request
Mar 11, 2026
Addresses community feedback from Discussion danielmiessler#754 and PRs danielmiessler#762, danielmiessler#780, danielmiessler#806: - Add upgrade path documentation to README (separate from fresh install) - Add configurable temperature unit (°F/°C) in settings.json + installer - Statusline reads principal.timezone instead of hardcoded America/Los_Angeles - Remove broken context fallback after /clear (PR danielmiessler#806) - Remove self-calibrating startup estimate inflating fresh session context % - Fix f-string nested quoting in Python eval block (PR danielmiessler#780) - Fix FAQ: remove stale Python reference, improve recovery guidance - Rename Releases/v4.0 → Releases/v4.0.0 for semver consistency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ljubitje
pushed a commit
to ljubitje/Personal_AI_Infrastructure
that referenced
this pull request
Apr 12, 2026
Addresses community feedback from Discussion danielmiessler#754 and PRs danielmiessler#762, danielmiessler#780, danielmiessler#806: - Add upgrade path documentation to README (separate from fresh install) - Add configurable temperature unit (°F/°C) in settings.json + installer - Statusline reads principal.timezone instead of hardcoded America/Los_Angeles - Remove broken context fallback after /clear (PR danielmiessler#806) - Remove self-calibrating startup estimate inflating fresh session context % - Fix f-string nested quoting in Python eval block (PR danielmiessler#780) - Fix FAQ: remove stale Python reference, improve recovery guidance - Rename Releases/v4.0 → Releases/v4.0.0 for semver consistency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
larsboes
pushed a commit
to larsboes/PAI
that referenced
this pull request
May 17, 2026
Addresses community feedback from Discussion danielmiessler#754 and PRs danielmiessler#762, danielmiessler#780, danielmiessler#806: - Add upgrade path documentation to README (separate from fresh install) - Add configurable temperature unit (°F/°C) in settings.json + installer - Statusline reads principal.timezone instead of hardcoded America/Los_Angeles - Remove broken context fallback after /clear (PR danielmiessler#806) - Remove self-calibrating startup estimate inflating fresh session context % - Fix f-string nested quoting in Python eval block (PR danielmiessler#780) - Fix FAQ: remove stale Python reference, improve recovery guidance - Rename Releases/v4.0 → Releases/v4.0.0 for semver consistency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SyntaxErrorin the batch usage reset time eval that silently breaks all four reset-time variables (reset_5h,reset_7d,clock_5h,clock_7d) for all users with valid OAuth tokens2>/dev/null, so users see↻—instead of a real reset time with no indication anything is wrongCloses #779
Root Cause
Because the entire
python3 -c "..."invocation is wrapped in2>/dev/null, theSyntaxErroris silently discarded. Theevalreceives no output, all variables stay empty, and the statusline falls back to—for every reset time.Fix
Single-quoted string literals inside a
f"..."f-string are valid since Python 3.6. No behavior change — just fixes the silent crash.Test Plan
reset_5handreset_7dare populated after the eval (e.g.4h32m,2d23h)↻4h32minstead of↻——as before)🤖 Generated with Claude Code