Skip to content

[Fix] Generic completion message appears while task is still running - #1369

Draft
roomote-roomote[bot] wants to merge 2 commits into
developfrom
fix/chat-closeout-fallback-race-182pa0h2gveis
Draft

[Fix] Generic completion message appears while task is still running#1369
roomote-roomote[bot] wants to merge 2 commits into
developfrom
fix/chat-closeout-fallback-race-182pa0h2gveis

Conversation

@roomote-roomote

@roomote-roomote roomote-roomote Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

​Opened on behalf of @daniel-lxs. Follow up by mentioning @roomote-roomote, in the web UI, or in Slack.

What changed

Missing-chat-closeout fallbacks now wait through a short grace period after completion settlement. The worker retains active tool call IDs even when those tools started before the stale completion, so it cannot arm the timer while work remains active. Meaningful follow-on runtime activity still cancels the pending fallback, while usage-only telemetry does not. A genuinely terminal harness teardown still flushes the fallback immediately.

Regression coverage exercises both orderings: activity that follows settlement and a tool that starts before TaskCompleted, remains active beyond the grace window, then completes before teardown.

Why this change was made

OpenCode can emit a stale idle while trailing tool work is still progressing. Roomote previously treated that completion as terminal and posted its generic fallback before the agent's real closeout arrived.

Impact

Slack-backed tasks no longer receive an early "I'm finished" message when the agent is still working, while tasks that truly exhaust closeout reminders retain their fallback response. Focused worker tests, type checks, lint, and the repository pre-push gates pass; two unrelated full-suite tests timed out only under parallel load and passed independently.

@roomote-community

roomote-community Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

No new code issues found. See task

  • apps/worker/src/run-task/subscribe-harness-callbacks.ts:312 Activity that predates the stale completion is not retained, allowing a five-second fallback while a previously-started tool is still running.

Reviewed 64f7db1

Comment thread apps/worker/src/run-task/subscribe-harness-callbacks.ts
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