fix: correct tool call card rendering on session load after context compaction (#408)
* fix: correct tool call card rendering on session load Two bugs caused duplicate/incorrect tool call cards when loading sessions (especially after context compaction): 1. loadSession() sanitized messages (B9 filter) but did NOT update the session-level tool_calls array's assistant_msg_idx references. Since compact() returns only sanitized messages and recomputes tool_calls with indices into the compacted array, the original assistant_msg_idx values became stale/misaligned. 2. loadSession() then assigned the broken session-level tool_calls directly to S.toolCalls. This prevented renderMessages()'s fallback path (which derives tool_calls from per-message tool_calls using correct sanitized-array indices) from ever running. Fix: - Keep full sanitization loop with index remapping for session-level tool_calls (in case they're needed by other code paths). - Instead of assigning broken session-level tool_calls to S.toolCalls, set S.toolCalls=[] so renderMessages() uses the fallback derivation from per-message tool_calls, which already have correct indices. * test: add 8 regression tests for issue #401 tool call index remapping * docs: v0.50.29 release — version badge and CHANGELOG --------- Co-authored-by: Frank Song <franksong2702@gmail.com> Co-authored-by: Nathan Esquenazi <nesquena@gmail.com>
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
# Hermes Web UI -- Changelog
|
||||
|
||||
## [v0.50.29] fix: correct tool call card rendering on session load after context compaction (closes #401) (#402)
|
||||
|
||||
- `static/sessions.js`: replace the flat B9 filter in `loadSession()` with a full sanitization pass that builds `origIdxToSanitizedIdx` — each `session.tool_calls[].assistant_msg_idx` is remapped to the new sanitized-array position as messages are filtered; for tool calls whose empty-assistant host was filtered out, they attach to the nearest prior kept assistant
|
||||
- `static/sessions.js`: set `S.toolCalls=[]` instead of pre-filling from session-level `tool_calls` — this lets `renderMessages()` use its fallback derivation from per-message `tool_calls` (which already carry correct indices into the sanitized message array); the fix eliminates the "200+ tool cards all on the wrong message" symptom on context-compacted session load
|
||||
- `tests/test_issue401.py`: 8 regression tests — 4 static structural checks and 4 behavioural Node.js tests covering index remapping, multiple consecutive empty assistants, no-filtering pass-through, and `tool`-role message exclusion
|
||||
- Original PR by @franksong2702 (cherry-picked onto master; branch was 31 commits behind)
|
||||
- 1037 tests total (up from 1029)
|
||||
|
||||
## [v0.50.28] fix: expand openai-codex model catalog to match DEFAULT_CODEX_MODELS
|
||||
|
||||
`_PROVIDER_MODELS["openai-codex"]` only listed `codex-mini-latest`, so profiles using the `openai-codex` provider (e.g. a CodePath profile with `default: gpt-5.4`) showed only one entry in the model dropdown. Updated to mirror the agent's authoritative `DEFAULT_CODEX_MODELS` list: `gpt-5.4`, `gpt-5.4-mini`, `gpt-5.3-codex`, `gpt-5.2-codex`, `gpt-5.1-codex-max`, `gpt-5.1-codex-mini`, `codex-mini-latest`. Added 2 regression tests.
|
||||
|
||||
Reference in New Issue
Block a user