Repository navigation
fix(agent): keep waiting agents from decaying to idle - #423
Merged
Merged
Conversation
Nine harnesses (codex, gemini, copilot, grok, pi, kiro, opencode, antigravity, devin) checked the 5-minute idle threshold before the waiting condition, so an agent blocked on input for more than five minutes was reported idle and sorted below running agents. Check waiting first in both the TS adapters and the Rust devkit-harness port; idle now only applies to agents that are not awaiting input. Fixtures and tests updated to match.
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.
Problem
Nine harnesses (codex, gemini, copilot, grok, pi, kiro, opencode, antigravity, devin) checked the 5-minute idle threshold before the waiting condition. An agent blocked on input for more than five minutes was reported
idleand sorted belowrunningagents — the agents that most need attention dropped out of view.Claude and Muse were unaffected (no time-based idle).
Change
Check waiting first; idle now only applies to agents that are not awaiting input (from a human or another agent). Applied to both the TS adapters (
packages/agent-manager) and the Rust port (rust/crates/devkit-harness) so fixture parity holds.codex/statuses,grok_cli/fallback,antigravity_cli/matched— the stale agent whose last turn was an assistant reply is nowwaiting.Note: Copilot treats
session.shutdown/abortas waiting, so those now staywaitingwhile the process is alive instead of decaying toidle.Verification
vitest(agent-manager): 1375 passed;cargo test --workspace: 134 passed, incl. fixture replay for every harness.agent list --json, sandboxed HOME, fakecodexprocesses, bothAI_DEVKIT_NO_DAEMON=1and thedevkitdpath): stale reply →waiting, staletask_complete→waiting, stale mid-run →idle, fresh →running; default sort waiting → running → idle. 13/13 checks passed.Follow-up (not in this PR)
waitingSince+ "waiting longest" sort, timed from when the agent started waiting rather than last log output.