Skip to content

fix: require 30s stable idle before sending task input#11

Merged
mafredri merged 1 commit intomainfrom
mafredri/stable-idle-wait
Mar 24, 2026
Merged

fix: require 30s stable idle before sending task input#11
mafredri merged 1 commit intomainfrom
mafredri/stable-idle-wait

Conversation

@mafredri
Copy link
Copy Markdown
Member

The agent can momentarily report idle between processing steps, causing sendTaskInput to hit HTTP 409 when waitForTaskActive exits on the first idle observation.

This tracks consecutive idle duration and only returns after stableIdleMs (default 30s) of uninterrupted idle. If the agent flips back to working, the timer resets and the wait continues.

Also makes pollIntervalMs configurable so tests don't need real 2s sleeps between polls.

🤖 This PR was created with the help of Coder Agents, and will be reviewed by a human. 🏂🏻

@mafredri mafredri force-pushed the mafredri/stable-idle-wait branch from 43e9448 to f6c9c1a Compare March 24, 2026 14:11
The agent can momentarily report idle between processing steps,
causing sendTaskInput to hit HTTP 409 when waitForTaskActive exits
on the first idle observation. Track consecutive idle duration and
only return after stableIdleMs (default 30s) of uninterrupted idle.

Also makes pollIntervalMs configurable so tests don't need real 2s
sleeps between polls.
@mafredri mafredri force-pushed the mafredri/stable-idle-wait branch from f6c9c1a to 84dd3a9 Compare March 24, 2026 14:13
@mafredri mafredri marked this pull request as ready for review March 24, 2026 18:08
@mafredri mafredri requested a review from johnstcn March 24, 2026 18:08
@mafredri mafredri merged commit a89819f into main Mar 24, 2026
1 check passed
@mafredri mafredri deleted the mafredri/stable-idle-wait branch March 24, 2026 18:12
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.

2 participants