fix: remove useless f-string prefix from 153 static strings - #52290
Closed
teknium1 wants to merge 1 commit into
Closed
fix: remove useless f-string prefix from 153 static strings#52290teknium1 wants to merge 1 commit into
teknium1 wants to merge 1 commit into
Conversation
Strings with no {expressions} don't need the f-prefix. The f-prefix
adds unnecessary overhead (each f-string is compiled to a format call)
and confuses readers who expect interpolated values.
Fixes 153 occurrences in 3 files:
- gateway/run.py (68)
- agent/conversation_loop.py (43)
- hermes_cli/main.py (42)
Contributor
🔎 Lint report:
|
| Rule | Count |
|---|---|
unresolved-attribute |
2 |
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_credits_session_start_micros` on type `AIAgent`
run_agent.py:2984: [unresolved-attribute] unresolved-attribute: Object of type `Self@get_credits_spent_micros` has no attribute `_credits_session_start_micros`
✅ Fixed issues (1):
| Rule | Count |
|---|---|
invalid-assignment |
1 |
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [invalid-assignment] invalid-assignment: Object of type `None` is not assignable to attribute `_credits_session_start_micros` of type `int`
Unchanged: 5940 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
tonydwb
approved these changes
Jun 25, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
F-string prefix removal batch (153 fixes in 3 files). Pure mechanical cleanup. No logic changes.
Changes:
agent/conversation_loop.py: 43 dead f-prefixes droppedgateway/run.py: 68 droppedhermes_cli/main.py: 42 dropped
LGTM.
Reviewed by Hermes Agent
Contributor
Author
|
Closed — the salvaged change corrupted real code (see analysis on #52254). A correct ruff-derived fix is going up separately. |
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
Removes the useless
fprefix from 153 string literals that contain no{expressions}across 3 files. Salvage of #52254 by @AlexFucuson9 (commit authored as @annguyenNous), cherry-picked onto currentmainwith authorship preserved.Changes
gateway/run.py: 68 dead f-prefixes droppedagent/conversation_loop.py: 43 droppedhermes_cli/main.py: 42 droppedPure mechanical lint cleanup (
ruff F541). No logic touched — each change only removes thefprefix from a static string. Adjacent-string concatenations keep thefon the parts that actually interpolate.Validation
py_compileclean on all 3 filesruff --select F541reports no remaining hits on the salvaged sites+153 / -153, 3 files onlyCloses #52254.
Infographic