Repository navigation
fix(agents): resume Hermes panes after a restart, on the pane's own session - #33514
Conversation
Orca's managed Hermes plugin already posts session_id on every hook, but extractAgentProviderSession dropped it for hermes, so the pane never stored a provider session and cold restore had nothing to resume. Capture the id, add hermes to RESUMABLE_TUI_AGENTS, map it to `hermes --resume <id>`, and gate remote hosts behind agent-session.hermes-resume.v1 like the other late agents.
A prompted Hermes launch splices agentArgs into its query command, so the recorded agentCommand lacked them and resume replayed the bare override. Record the full command like every other agent, and normalize the resumed command into TUI chat form so a --cli override or a stale --query never survives a restore.
…ate child's delegate_task children post hooks under their own session ids on the parent's pane; those now carry the parent's id, so a restore never reopens a child and the pane's resume record keeps its launch args. Resume reuses the plain append path every other agent uses (top-level `hermes --tui --resume <id>` works), so the Hermes-specific resume command rewrite is dropped. Co-authored-by: tomaszamoranoq <tomas.zamorano@uc.cl>
Walkthrough
Priority: Severity of issue fixed: Medium Merge Risk:
|
There was a problem hiding this comment.
🔇 Additional comments: 2
src/shared/agent-hook-listener/providers/hermes-events.ts-63-64: 1
63-64:Major · Data Integrity & Integration · Quick win
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Record child IDs at session start.
If a delegate emits
on_session_startand thenon_session_endbeforepre_llm_call, this check does not recognize the child. The end hook can omitplatform, as the new regression sequence shows.readPaneProviderSessionthen publishes the child’s ID as the pane’s provider session, so a crash restore can select the wrong conversation. Add the child ID tochildSessionIdswhen its markedon_session_startarrives.src/shared/tui-agent-startup.ts-89-91: 1
89-91:Major · Functional Correctness · Heavy lift
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Record the effective Hermes command, not discarded flags.
When a prompted launch supplies
hermes --query override --cli, the query launch removes those flags, butrecordedCommand.commandWithoutSessionOptionsretains them. A later resume appends--resume <id>to that recorded command. It can therefore replay the old query or start the classic REPL instead of restoring the intended TUI. Store the Hermes query planner’s effective launch options without its startup query, rather than persisting the unprocessed override and arguments. Hermes documents--clias the classic-REPL switch and--queryas a query input. (github.com)

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
bb0faa01-a746-48e8-96e5-2cb41662260d
Files selected for processing: 14-
src/renderer/src/runtime/agent-resume-host-authority-capability.test.tssrc/renderer/src/runtime/agent-resume-host-authority-capability.tssrc/shared/agent-hook-listener-hermes-codex-droid.test.tssrc/shared/agent-hook-listener.tssrc/shared/agent-hook-listener/listener-state.tssrc/shared/agent-hook-listener/pane-provider-session.tssrc/shared/agent-hook-listener/providers/hermes-events.tssrc/shared/agent-resume-argv.tssrc/shared/agent-session-resume-runtime-capabilities.tssrc/shared/agent-session-resume.test.tssrc/shared/agent-session-resume.tssrc/shared/tui-agent-startup-hermes.spec.tssrc/shared/tui-agent-startup.spec.tssrc/shared/tui-agent-startup.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
-
Summary
If Orca restarted after a crash, reboot, or daemon loss, a Hermes TUI pane came back as a plain shell, and the conversation was gone. Claude, Codex, Kiro and other agents already resume in this case. Hermes now does too: Orca stores the Hermes session id from its managed plugin and relaunches the pane with
hermes --tui --resume <id>.This adopts @tomaszamoranoq's #31327 (both of its main commits are kept) and adds one commit:
delegate_taskchildren send hooks to the parent's pane under their own session ids. Taking every hook'ssession_idas-is (as fix(agents): resume Hermes panes after a reboot or daemon loss #31327 did) let a restore reopen the child conversation. It also wiped the pane's resume record, so the restore lost the launch args (--yolo, profile flags). Child hooks now carry the parent's id. A child is detected the same way fix(hermes): keep a finished Hermes pane done when its background memory review calls tools #33418 detects one:platform: "subagent", or a session id already seen as a child in this turn.normalizeHermesResumeBaseCommandplus the wrapper refusal). Top-levelhermes --tui --resume <id>works, so Hermes now uses the same plain-append path as every other agent. That is about 30 fewer lines.Fixes #15808
Root cause
extractAgentProviderSessionreturnednullforhermes, andhermeswas not inRESUMABLE_TUI_AGENTS. No provider session was ever recorded, so cold restore had nothing to resume.agentArgsinside its--querycommand, so the recordedagentCommandwas missing them and a resume would have dropped them. fix(agents): resume Hermes panes after a reboot or daemon loss #31327 commit 2 records the full command.Upstream Hermes (
~/projects/hermes-agent):hermes_cli/_parser.py:175defines top-level--resume/-r SESSION, and:208defines--tui.hermes_cli/main.py:1356-1378(_resolve_session_by_name_or_id) resolves an exact id and moves forward to the compression tip, so an id recorded before context compression still resumes the live conversation.tools/delegate_tool.py:296runs children withplatform="subagent". Children use their own session ids (see the captured hook order in fix(hermes): keep a finished Hermes pane done when its background memory review calls tools #33418).Mixed versions / remote / mobile
agent-session.hermes-resume.v1runtime capability, like the other agents added late (from fix(agents): resume Hermes panes after a reboot or daemon loss #31327). An older host never receives ahermesresume it would reject.Verification
Real app, real
hermesCLI v0.13.0. IsolatedHOME/HERMES_HOME, Orca dev profile, and a local fake OpenAI-compatible model, so no model spend. Steps: launch a Hermes pane from the tab "+" menu, send "remember the word zebra42", then hard-kill Orca, its PTY daemon and the pane processes (same as a reboot), and relaunch.751591f)providerSession: nullhermes --tui --yolo --resume 20261025_041233_b88cf8, the pane shows the earlier turn, and the next prompt reaches the model with both user messages (history=2)Before (main):
After (this PR):
delegateit→delegate_taskchild): the pane's provider session stays on the parent id (the child isparent_session_id= parent instate.db), and the restore resumes the parent conversation.pnpm tc, plus targeted suites: listener, session resume, startup, host-authority capability, hermes, agent-status slices and terminal-pane (646 files, 7432 tests).check:code-quality:changedpasses.delegate_taskhook order keeps the pane on the parent id. It fails without the fix.Risk
platform: "subagent"(for example v0.13.0, wheredelegate_tool.py:1118passes the parent's platform) give the child the parent's platform. On those builds a child's ids still show on the pane during the delegation, and the parent's id comes back at turn end. A crash mid-delegation there could resume the child. After a delegation turn, the resume also dropsagentArgs. fix(hermes): keep a finished Hermes pane done when its background memory review calls tools #33418's turn tracking has the same blind spot on those builds.hermeswithout--tui) now resume into the REPL with--resume, the same as their fresh no-prompt launch. fix(agents): resume Hermes panes after a reboot or daemon loss #31327 forced the TUI instead.Co-authored-by: tomaszamoranoq tomas.zamorano@uc.cl