feat: auto-continue failed idle runs#165
Open
i-am-thor[bot] wants to merge 1 commit into
Open
Conversation
Co-authored-by: Son Dao <son.dao@katalon.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an auto-recovery path in the runner's /trigger stream loop: when an assistant message.updated finishes with finish: "error" and zero tokens (no displayed output), and the session then idles, the runner sends a single "Continue" prompt into the same OpenCode session instead of terminating the trigger. The retry is one-shot per failed message id, and is re-armed only when a different assistant message id later updates with nonzero tokens.
Changes:
- Track latest assistant
message.updated(id/finish/tokenTotal) plus a set of message ids that produced real text output. - On parent
session.idle, if the latest assistant message looks failed and unrecovered, sendContinueonce viaclient.session.promptAsyncand keep the stream loop alive; on prompt error, fall through to the existing terminal path. - Extend test harness (
messageUpdatedEventacceptsid/finish,promptEventsreceives prompt text) and add three new tests covering one-shot continue, duplicate suppression, and re-arm-after-success.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/runner/src/index.ts | Adds auto-resume bookkeeping, idle-time Continue send, and assistantMessageUpdateSummary() helper. |
| packages/runner/src/trigger.test.ts | Extends messageUpdatedEvent/harness and adds tests for the new auto-continue behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Testing
AI-generated — verify before acting. View Thor context