fix(core): exempt orchestrator sessions from idle-beyond-threshold stuck transition#2121
Open
Bdandc wants to merge 1 commit into
Open
fix(core): exempt orchestrator sessions from idle-beyond-threshold stuck transition#2121Bdandc wants to merge 1 commit into
Bdandc wants to merge 1 commit into
Conversation
…uck transition Orchestrator sessions are human-driven and idle by design while waiting for user input. The idle-beyond-threshold stuck transition did not exempt them, so after the default 10m agent-stuck threshold they were flagged stuck, emitting session.stuck and firing an URGENT desktop notification. Add the same authoritative lifecycle.session.kind === "orchestrator" exemption already used by the agent-report branch immediately above (string-matching role/id suffixes misses numbered orchestrator IDs). Invariants preserved: runtime death, activity waiting_input, and SCM ground truth all short-circuit earlier in determineStatus and are unaffected; worker stuck detection is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Fixes a false-positive
agent-stucknotification for orchestrator sessions. The idle-beyond-threshold stuck transition indetermineStatus(lifecycle-manager.ts) did not exempt orchestrator sessions, so after the default 10m agent-stuck threshold a human-driven orchestrator — idle by design while waiting for user input — was flaggedstuck, emittingsession.stuckand firing the default agent-stuck reaction (URGENT desktop notification).Why
The agent-report branch immediately above this block already skips orchestrators via
lifecycle.session.kind !== "orchestrator", and its comment stateslifecycle.session.kindis the authoritative source (string-matching role/id suffixes misses numbered orchestrator IDs like${prefix}-orchestrator-1). This PR applies the same exemption to the idle-beyond-threshold stuck transition so orchestrator sessions never transition tostuckvia idle decay.Invariants preserved (per lifecycle-manager.ts guidance)
resolveProbeDecision— unaffected.waiting_input/blocked: short-circuit earlier in the cascade — unaffected.lifecycle.session.kind === "orchestrator". An exempted orchestrator falls through to the existing default branches and keeps its current status (no transition → no event).Tests
does not mark orchestrator sessions stuck when idle exceeds agent-stuck threshold— orchestrator session idle 2m past a 1m threshold staysworkingand emits no notification.still marks worker sessions stuck and fires the agent-stuck reaction when idle exceeds threshold— identical setup with worker kind transitions tostuckand fires the agent-stuck notify reaction (proves the no-notification assertion above is non-vacuous).Verification
pnpm --filter @aoagents/ao-core typecheck✅pnpm --filter @aoagents/ao-core test✅ 1346 passed (74 files)🤖 Generated with Claude Code