Skip to content

fix: /retry and /undo no longer replay an older message after compaction (#81233, salvage #81234) - #93784

Merged
teknium1 merged 18 commits into
mainfrom
salv/81234-retry-carrier
Aug 24, 2026
Merged

teknium1 merged 18 commits into
mainfrom
salv/81234-retry-carrier

Conversation

@teknium1

Copy link
Copy Markdown
Collaborator

Summary

After context compression, /retry on Desktop (and CLI/gateway/TUI) resends an older, wrong message instead of the last thing the user actually asked — and drops the compacted context on the way. Reported live by @gashoUlemsee on X ("/retry in hermes desktop does not resend the last user message. Just picks some message and resends it").

Root cause: compaction can merge the current live ask into the same role=user row as the summary scaffold (a "composite carrier"). Since #80622, retry/undo selectors treat every summary-bearing row as scaffolding, so they skip the carrier and land on an older user row — replaying a stale prompt and truncating away the compaction summary.

Salvage of #81234 by @poisdahl (fixes #81233). Merged cleanly onto current main with authorship preserved (6 commits).

Changes

  • one canonical scaffold/live-view projection (user_originated_turn_view) for both composite-carrier layouts (force-user-leading handoff and merged user carrier)
  • CLI, gateway, TUI/Desktop retry + undo select user-originated turns and resend/prefill only the live ask
  • durable rewinds archive the carrier + tail and re-insert one hidden pure scaffold atomically, guarded by a pre-selection transcript snapshot (fails closed on concurrent mutation)
  • Desktop keeps row identity across rewinds via a bounded old→new rebind map; legacy responses retained for older clients
  • unknown/media-bearing retry payloads fail before mutation instead of being flattened

Validation

Check Result
A/B: PR test suite on merge-base main 14/17 FAIL (retry/undo pick wrong row)
A/B: same suite at head 17/17 pass
Targeted py tests (tui_gateway, hermes_state, gateway, cli, run_agent, web_server) 914 passed
Desktop TS tests (rewind, chat-messages hydration) 105 passed
ruff on changed files clean
Attribution audit all emails mapped

Live repro: base main fires the exact reported symptom through the real command.dispatch retry surface (the code path Desktop hits over the gateway WS); head resolves it — {"type": "send", "message": "REAL ASK"} with the summary scaffold preserved.

Infographic

Retry finds the real ask

poisdahl and others added 18 commits August 13, 2026 21:38
…-final

# Conflicts:
#	tui_gateway/methods_prompt.py
#	tui_gateway/server.py
…-final

# Conflicts:
#	tests/test_tui_gateway_server.py
#	tui_gateway/methods_prompt.py
#	tui_gateway/methods_tools.py
…60821

# Conflicts:
#	tests/agent/test_reference_handoff_active_turn.py
@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

૮ >ﻌ< ა ci review

ran on 1a95d0d — Merge branch 'pr-81234' into salv/81234-retry-carrier

⚠️ Warnings

OSV vulnerability scan · View job

7 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.


debug info

CI timings

CI timings · View report · View job

Wall time 4m25s vs 3m53s (+13.7%). 9 job(s) slower, 4 faster,

  • JS & TS checks / JS & TS checks: +15.0s
  • OS-specific tests / macOS-only tests: +9.0s
  • OSV scan / Scan lockfiles / osv-scan: -8.0s
  • Python tests / e2e: -4.0s
  • Python tests / Run tests: -4.0s

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery comp/tui Terminal UI (ui-tui/ + tui_gateway/) comp/desktop Electron desktop app (apps/desktop/*) P2 Medium — degraded but workaround exists sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state area/sessions Session lifecycle, resume, persistence, history area/compression Context compression and continuation sessions labels Aug 24, 2026
@alt-glitch

Copy link
Copy Markdown

This was generated by AI during triage.

Salvage of #81234 for #81233. This is the current authoritative landing vehicle for the composite-compaction retry/undo repair.

@teknium1
teknium1 merged commit ec5e369 into main Aug 24, 2026
41 checks passed
@teknium1
teknium1 deleted the salv/81234-retry-carrier branch August 24, 2026 10:31
melon-xf added a commit to melon-xf/hermes-agent that referenced this pull request Sep 3, 2026
…try-carrier

fix: /retry and /undo no longer replay an older message after compaction (NousResearch#81233, salvage NousResearch#81234)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/compression Context compression and continuation sessions area/sessions Session lifecycle, resume, persistence, history comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard comp/desktop Electron desktop app (apps/desktop/*) comp/gateway Gateway runner, session dispatch, delivery comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Composite compaction carriers are skipped by retry and undo

3 participants