Skip to content

fix: remove useless f-string prefix from 144 static strings (batch 2) - #52258

Closed
AlexFucuson9 wants to merge 1 commit into
NousResearch:mainfrom
AlexFucuson9:fix/remove-useless-fstring-batch2
Closed

AlexFucuson9 wants to merge 1 commit into
NousResearch:mainfrom
AlexFucuson9:fix/remove-useless-fstring-batch2

Conversation

@AlexFucuson9

Copy link
Copy Markdown
Contributor

Problem

Strings with no {expressions} don't need the f prefix. The f-prefix adds unnecessary overhead and confuses readers who expect interpolated values.

# Before
f"Cannot read {path}"  # This is a real f-string — keep
f"Loading config..."    # No expressions — remove f

# After
f"Cannot read {path}"  # Unchanged
"Loading config..."     # f removed

Files changed (144 fixes in 5 files)

File Changes
tools/delegate_tool.py 40
hermes_cli/completion.py 39
tools/browser_tool.py 25
agent/file_safety.py 20
gateway/slash_commands.py 20

Follow-up to PR #52254 (batch 1, 153 fixes in 3 files). Remaining ~480 hits across 40+ files in subsequent batches.

Strings with no {expressions} don't need the f-prefix. The f-prefix
adds unnecessary overhead and confuses readers who expect interpolated
values.

Fixes 144 occurrences in 5 files:
- tools/delegate_tool.py (40)
- hermes_cli/completion.py (39)
- tools/browser_tool.py (25)
- agent/file_safety.py (20)
- gateway/slash_commands.py (20)
@alt-glitch alt-glitch added type/refactor Code restructuring, no behavior change comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/gateway Gateway runner, session dispatch, delivery comp/cli CLI entry point, hermes_cli/, setup wizard tool/browser Browser automation (CDP, Playwright) tool/delegate Subagent delegation P3 Low — cosmetic, nice to have labels Jun 25, 2026
@alt-glitch

Copy link
Copy Markdown

This was generated by AI during triage.

Related: batch 2 follow-up to #52254 (batch 1). Disjoint files (this PR: file_safety, slash_commands, completion, browser_tool, delegate_tool); same ruff F541 cleanup. Not a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have tool/browser Browser automation (CDP, Playwright) tool/delegate Subagent delegation type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants