fix: preserve CLI session tool metadata#1778
Closed
Michaelyklam wants to merge 1 commit into
Closed
Conversation
pull Bot
pushed a commit
to soitun/hermes-webui
that referenced
this pull request
May 7, 2026
…1778, nesquena#1779) Constituent PRs: - nesquena#1768 (@franksong2702) serialize Anthropic env fallback reads. Closes nesquena#1736. - nesquena#1778 (@Michaelyklam) preserve CLI session tool metadata. Closes nesquena#1772. - nesquena#1779 (@Michaelyklam) reset model picker on session switch. Closes nesquena#1771. AUTO-FIX: Opus stage-310 caught a regression in the new !hasSessionModel branch — it dropped the deferModelCorrection guard that the parallel else-branch keeps. Fired spurious /api/session/update POSTs against imported/read-only CLI sessions whose model field reads 'unknown' (the exact surface nesquena#1778 introduces in this same release). Wrapped the new branch's _persistSessionModelCorrection call + state mutation in if(!deferModelCorrection). Added test_sync_topbar_does_not_persist_correction_while_model_resolution_deferred regression test covering both empty and 'unknown' fast-path interaction. Tests: 4694 → 4702 collected (+8). 4695 passed, 4 skipped, 3 xpassed, 0 failed in 141.29s. Pre-release verification: - All 3 PRs CI-green individually. - node -c clean on static/ui.js. - 11/11 browser API endpoints PASS. - Pre-stamp re-fetch: all PR heads match local rebases. - Opus advisor: SHIP nesquena#1768 + nesquena#1778, nesquena#1779 SHOULD-FIX before merge — auto-fix applied at stage with regression test, re-verified clean. Closes nesquena#1736, nesquena#1771, nesquena#1772.
Collaborator
|
Thanks @Michaelyklam — this shipped in v0.51.16 (commit GitHub didn't auto-close because the merge commit only references the squash-merged stage branch, not your fork's commit directly — closing manually for hygiene. Live now on existing installs after Release notes: https://github.com/nesquena/hermes-webui/releases/tag/v0.51.16 |
Du7chManiac
pushed a commit
to TheCouchCoder-com/hermes-webui
that referenced
this pull request
May 13, 2026
v0.51.16 — 3-PR batch (nesquena#1768, nesquena#1778, nesquena#1779) # Conflicts: # CHANGELOG.md
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.
Thinking Path
role,content, andtimestampfromstate.db.messages, while the agent stores tool calls/results in adjacent columns.tool_callsandrole='tool'results when that metadata reaches the browser.What Changed
api.models.get_cli_session_messages()to read and pass through CLI tool metadata:tool_callstool_call_id,tool_name, andnamestate.dbschemas by checking available columns before selecting optional fields.state.dbfixture covering both fresh loads and same-length metadata refreshes.Fixes #1772
Why It Matters
CLI sessions are often short and tool-heavy. Dropping tool-call metadata makes those transcripts look nearly empty in the WebUI, even though the underlying Hermes state has the full action/result history. This restores parity with WebUI-native tool rendering without changing the frontend rendering model.
Verification
python -m pytest tests/test_cli_session_tool_metadata.py -qinitially failed before the fix with missingtool_calls/ no same-length refresh./home/michael/.hermes/hermes-agent/venv/bin/python -m pytest tests/test_cli_session_tool_metadata.py tests/test_session_import_cli_fallback_model.py -q→10 passed/home/michael/.hermes/hermes-agent/venv/bin/python -m pytest tests/test_cli_session_tool_metadata.py tests/test_session_import_cli_fallback_model.py tests/test_cron_session_title.py -q→15 passedgit diff --check→ passedenv -u HERMES_CONFIG_PATH -u HERMES_WEBUI_HOST /home/michael/.hermes/hermes-agent/venv/bin/python -m pytest tests/ -q→4689 passed, 4 skipped, 3 xpassed, 1 warning, 8 subtests passed in 378.92sHTTP 200, 567 bytestest (3.11),test (3.12), andtest (3.13)all passedEvidence / UI media
API-level evidence for the server payload that the existing WebUI tool-card renderer consumes:
https://raw.githubusercontent.com/Michaelyklam/hermes-webui/fix/issue-1772-cli-tool-calls/docs/pr-media/1772/cli-tool-metadata-api-evidence.json
This is a server/session-loader fix, not a visual layout change, so no before/after screenshot is included.
Risks / Follow-ups
messagescolumns before selecting optional metadata, so older state DBs should continue to degrade safely.Model Used