Skip to content

fix(agent): keep waiting agents from decaying to idle - #423

Merged
codeaholicguy merged 1 commit into
mainfrom
fix/waiting-not-overridden-by-idle
Oct 29, 2026
Merged

codeaholicguy merged 1 commit into
mainfrom
fix/waiting-not-overridden-by-idle

Conversation

@codeaholicguy

Copy link
Copy Markdown
Owner

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 idle and sorted below running agents — 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.

  • Fixtures: codex/statuses, grok_cli/fallback, antigravity_cli/matched — the stale agent whose last turn was an assistant reply is now waiting.
  • Tests: each updated case is split into "stale + awaiting input → waiting" and "stale + mid-run → idle".

Note: Copilot treats session.shutdown / abort as waiting, so those now stay waiting while the process is alive instead of decaying to idle.

Verification

  • vitest (agent-manager): 1375 passed; cargo test --workspace: 134 passed, incl. fixture replay for every harness.
  • Regression: with the fix reverted, the new tests fail (6 TS, 3 Rust).
  • Smoke (agent list --json, sandboxed HOME, fake codex processes, both AI_DEVKIT_NO_DAEMON=1 and the devkitd path): stale reply → waiting, stale task_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.

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.
@codeaholicguy
codeaholicguy merged commit 5fb9330 into main Oct 29, 2026
8 checks passed
@codeaholicguy
codeaholicguy deleted the fix/waiting-not-overridden-by-idle branch October 29, 2026 10:05
@codeaholicguy
codeaholicguy restored the fix/waiting-not-overridden-by-idle branch October 30, 2026 18:39
@codeaholicguy
codeaholicguy deleted the fix/waiting-not-overridden-by-idle branch October 30, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant