Add hera_revive: coordinator PULL-revive of a bound role - #917
Merged
Conversation
Gives a hera coordinator a new MCP tool to notice and revive a dead or genuinely-stuck role it coordinates (e.g. after a session-supervisor restart SIGHUPs its PTY), instead of requiring a human to press Enter in the TUI. Reuses the exact idle+not-blocked safety gate the TUI's Enter-key revive already enforces, so it can never thrash a session that's actually working or waiting on a prompt; a healthy role is reported as such rather than touched. The gating+action sequence is extracted once into internal/hera.ReviveRole (mirrors the existing RecycleCoord architecture: a pure function over narrow store/runner interfaces), wired daemon-side by daemon.HeraReviveRunner. The TUI's own Enter-key revive path is deliberately left untouched — see design.md D3 (archived under openspec/changes/archive/2026-07-31-add-hera-revive/) for why: it additionally resizes to the current pane's dimensions and is threaded through tview's QueueUpdateDraw model, while every individual check it performs stays single-sourced with the new tool either way. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Merging this branch changes the coverage (2 decrease, 1 increase)
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
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.
Summary
hera_revive(cwd, role_name, [orchestrator]), letting a hera coordinator PULL-revive a bound role after a session-supervisor restart (or any time it looks stuck) instead of requiring a human to press Enter in the TUI.internal/tui/heraactions.go), via a new shared primitiveinternal/hera.ReviveRole(mirrors the existingRecycleCoordarchitecture) and a new daemon adapterdaemon.HeraReviveRunner.design.mdD3 (archived atopenspec/changes/archive/2026-07-31-add-hera-revive/) for the reasoning: it additionally resizes to the live pane's dimensions and is threaded through tview'sQueueUpdateDrawmodel, while every individual check (idle detection, blocked-on-prompt, the in_review→in_progress restore) stays single-sourced between both call sites regardless..claude/skills/hera/SKILL.mdandREADME.md's MCP tools table updated; a gotcha bullet added tocontext/knowledge/gotchas/daemon-rpc.md; the openspec change is archived in the same PR per this repo's process.Test plan
internal/hera/revive_test.go— unit tests for everyReviveOutcomeagainst a fake runner + real in-memory DBinternal/daemon/revive_test.go—HeraReviveRunneragainst a realagent.NewRunner(nil)+ in-memory DB (dead restart, stuck kick preserving PTY size)internal/mcp/hera_revive_test.go— tool-level resolution/rejection/success casesmake pre-prpasses (build, vet, fmt-check, lint-pr all clean;vulnstep is CI's own advisory-only stdlib-CVE check per.github/workflows/ci.yml;test-cover-gatepasses at 88.7% — the 2 unrelatedinternal/agentprofile-env tests that false-fail from this sandbox's ownARGUS_*env leaking into the test subprocess were verified to pass cleanly with those vars unset, a known pre-existing artifact of runningmake pre-prinside a hera worker sandbox, not a regression from this change)🤖 Generated with Claude Code