feat(builder): render-mode-aware tool output (plain text in TUI, JSON in CLI) - #109
Merged
Merged
Conversation
iap
force-pushed
the
feat/render-mode-output
branch
from
September 13, 2026 13:45
932f087 to
a71ed8c
Compare
iap
commented
Sep 13, 2026
iap
left a comment
Owner
Author
There was a problem hiding this comment.
Review (verified on macOS, PR head a71ed8c) — do not merge as-is
P1: keep handlers JSON, move presentation out (confirmed valid)
I independently verified Greptile's "Preserve tool result structure" finding three ways — it is not a false positive:
verify.py:184,195doesjson.loads()on handler outputs. Withrender_mode: tuiin a real Hermes config,models/tags/q_debugreturn plain text and the gate crashes instead of gating.- CI green is camouflage, not safety. In CI/standalone
hermes_cliisn't importable,load_render_prefs()falls back toauto, and every test exercises only the JSON path. "241 pass" proves nothing about the 108 changed lines. - Contract violation. AGENTS.md +
_tool_result_helpersrequire handler output byte-identical to core tool JSON. A display preference must never change the tool-result envelope.
Suggested rework (leaving the design choice to the feature owner):
- Handlers return JSON always — restore
_success(...)routing formodels/tags/q_debug. - Presentation moves outside the tool boundary (separate non-tool helper, TUI-side rendering, or dropped). Delete the dead
bid_statusbranch informat_outputeither way — no handler routes through it. - Add TUI-path tests for whatever presentation survives (currently zero coverage on the new branches; existing tests only pin CLI mode).
- P2 one-liner (valid, trivial):
if identity.get("has_refresh_token"):conflates missing withFalse— checkis not Nonebefore rendering yes/no. - Retitle scope-less (
feat: …) per the current convention.
Verification gate I will run on the next push: verify.py under stubbed render_mode: tui (today's breaking case), full suite, Greptile re-review.
Checked and cleared
token_expires_at_iso: real key fromsso_oidc(line 547,Nonedefault at 596) — the payload addition is sound.- Suite green locally (241 passed) — expected per above, not evidence of correctness.
Co-author: Hermes 6572003+iap@users.noreply.github.com
iap
force-pushed
the
feat/render-mode-output
branch
from
September 13, 2026 15:14
a71ed8c to
076ab76
Compare
iap
force-pushed
the
feat/render-mode-output
branch
from
September 13, 2026 15:16
076ab76 to
6bac0e4
Compare
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.
TUI mode: returns plain text for human readability (no JSON walls of text).
CLI/standalone: returns JSON for scriptability.
Tools affected: models, tags, q_debug.
All 241 tests pass.
Uses existing _format.load_render_prefs() to detect render_mode.
Safe to merge.
Summary
Reviews (3) · Last reviewed commit: "feat(builder): render-mode-aware tool ou..."