W2-T08: lru_cache get_tool_output_limits to skip per-call config parse - #10
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0242881b0b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return iv | ||
|
|
||
|
|
||
| @functools.lru_cache(maxsize=1) |
There was a problem hiding this comment.
Invalidate limits cache when config changes
With this zero-argument lru_cache, the first terminal/read_file call in a long-lived CLI, gateway, or dashboard-backed process freezes tool_output limits until process restart. hermes_cli.config.load_config() already caches by config-path mtime/size, so it would pick up edits or saves through /api/config/save_config; wrapping it here prevents that mtime check from running again, making documented config changes to tool_output.max_bytes/max_lines ineffective for the rest of the session.
Useful? React with 👍 / 👎.
|



Audit W2-T08 (P2 #15).
@functools.lru_cache(maxsize=1)onget_tool_output_limitsso terminal-tool's hot output path doesn't re-parse~/.hermes/config.yamlon every call. Adds_invalidate_tool_output_limits_cache()for tests.