feat(cli): add runtime smoke and context audit commands - #49757
Conversation
2eb9d6b to
49957b8
Compare
|
Refreshed this PR onto current Current status:
Local verification after refresh:
Backup branch kept locally before the final refresh: |
99e8b71 to
0d21aab
Compare
|
Refreshed this PR onto current Current status:
Local verification after refresh:
Backup branch kept locally before the final refresh: |
0d21aab to
cf5bbaf
Compare
|
Refreshed this PR onto current
No failing or pending checks observed after the refresh. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the diagnostics work. The current PR needs correctness and side-effect changes before it is ready for salvage.
Problems
hermes_cli/context_audit.py:76reads the cap belowagent, but current main resolves top-levelcontext_file_max_chars(agent/prompt_builder.py:1201-1219;hermes_cli/config.py:1346-1352).context_audit.py:61-68lists every cwd candidate, while the real builder chooses one source by priority and may load a parent.hermes.md(agent/prompt_builder.py:1850-1982), so the audit can report the wrong source/cap status.smoke.py:146-187writes files and launches persistent chat sessions by default; this conflicts with its read-only framing. It also hardcodes/tmp, which is not native-Windows portable.- The new commands are absent from
_coalesce_session_name_args()'s command set (hermes_cli/main.py:11070-11135), so resume/continue preprocessing can misparse them.
Suggested changes
- Reuse the prompt-builder discovery/effective-cap contract.
- Make stateful/network smoke probes opt-in, use a portable temporary path, and add resume/continue coverage.
- Re-scope the new
HERMES_SMOKE_CLIoverride to argparse/config rather than a non-secretHERMES_*setting.
Automated hermes-sweeper review.
| """Return a read-only context budget report. | ||
|
|
||
| ``cwd`` defaults to the process cwd. The returned dict is JSON-serialisable | ||
| and intentionally contains sizes/paths only, not file contents or secrets. |
There was a problem hiding this comment.
The live resolver reads top-level context_file_max_chars (agent/prompt_builder.py:1211-1219; hermes_cli/config.py:1346-1352), not agent.*`. This audit can report a 20K cap when a user has configured a different effective cap; reuse the prompt-builder resolver or expose a shared helper.
|
|
||
|
|
||
| def _candidate_context_files(cwd: Path) -> Iterable[Path]: | ||
| for name in _CONTEXT_FILENAMES: |
There was a problem hiding this comment.
This inventory does not match what is injected: build_context_files_prompt() uses first-match priority and searches .hermes.md/HERMES.md up to the git root (agent/prompt_builder.py:1850-1982). Derive the displayed source from that discovery path rather than listing every cwd candidate.
| *, | ||
| artifact_dir: str | Path | None = None, | ||
| skip_chat: bool = False, | ||
| include_credits: bool = False, |
There was a problem hiding this comment.
This hardcodes a POSIX /tmp path and creates files despite the command being presented as read-only. Use a platform-neutral temporary-directory API, and make persistent artifact creation explicit.
| @@ -12203,14 +12219,14 @@ def _build_provider_choices() -> list[str]: | |||
| { | |||
There was a problem hiding this comment.
Please also add context and smoke to _coalesce_session_name_args()'s _SUBCOMMANDS set (hermes_cli/main.py:11070-11135), otherwise --continue/--resume preprocessing can consume either new command as part of an unquoted session name.
cf5bbaf to
5cc461c
Compare
|
Addressed the review feedback and refreshed this PR onto current Changes made in this refresh:
Local verification after rebase:
CI note:
|
053c24b to
5540d73
Compare
5540d73 to
8a1dcec
Compare
|
Refreshed this PR onto current Current verified state:
Local verification before pushing:
This should be ready for maintainer review/merge from my side. |
8a1dcec to
d775564
Compare
|
Refreshed this PR onto current Current verified state:
Local verification:
Backup branch: |
0681cd5 to
5aec3a2
Compare
feat(cli): add runtime smoke and context audit commands
|
5aec3a2 to
4a2232b
Compare
|
Follow-up after the automated review and a fresh rebase onto current Changes pushed in
Local verification on the pushed head:
Current GitHub CI is still blocked by gateway tests outside this PR's diff:
I am not mixing a gateway/session-api fix into this CLI diagnostics PR unless maintainers want that scope broadened. |
Summary
hermes context auditdiagnostics for prompt/context surface inspectionhermes smokediagnostics for lightweight runtime checksTests
/root/.hermes/hermes-agent/venv/bin/python -m pytest tests/hermes_cli/test_context_audit.py tests/hermes_cli/test_smoke.py tests/hermes_cli/test_subcommands_batch.py -q37 passed, 3 warnings189 passed, 3 warnings