fix(runtime-fallback,prompt-gate): recognize all OpenCode progress event shapes and boolean/completed finish markers#4197
Merged
code-yeongyu merged 2 commits intoMay 20, 2026
Conversation
… finish-marker blind spots (BUG-C+D) Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…ent shapes and boolean/completed finish markers Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
There was a problem hiding this comment.
No issues found across 4 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: The user requires 100% certainty of no regressions, which cannot be guaranteed for any logic change even with thorough testing.
Re-trigger cubic
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
Fixes two prompt dispatch regressions that can surface as duplicate assistant responses or stuck internal wake/retry dispatches. The runtime fallback watchdog now treats all documented OpenCode streaming part shapes as progress, and the shared prompt gate now treats boolean finish markers plus completed timestamps as terminal assistant turns.
Changes
properties.part.sessionIDplusmessage.part.delta{ sessionID, field: "text", delta }progress.finish === trueand treatsinfo.time.completedas terminal so later internal prompts are not blocked indefinitely.Evidence
src/hooks/session-notification.test.ts:378-410src/hooks/background-notification/hook.test.ts:29src/shared/event-session-id.ts:16-23src/hooks/session-recovery/hook.ts:62-74Testing
bun test src/hooks/runtime-fallback/first-prompt-watchdog.test.ts src/hooks/shared/prompt-async-gate.test.ts✅ red first: exactly 4 failures before fix, green after fixbun test src/hooks/runtime-fallback/✅bun test src/hooks/shared/✅bun test src/hooks/shared/prompt-async-gate.test.ts src/shared/prompt-async-route-audit.test.ts✅bun test src/hooks/session-recovery/✅bun test src/features/background-agent/✅bun test src/features/team-mode/✅bun run typecheck✅HOME=/tmp-clean XDG_DATA_HOME=/tmp-clean-data XDG_CACHE_HOME=/tmp-clean-cache bun test✅bun run build✅Note: plain local
bun teston this maintainer machine is contaminated by pre-existing user-level~/.omo/rulesstate insrc/hooks/rules-injector/injector.test.ts; the clean-HOME full suite above matches CI expectations without touching wave-4 test isolation territory.Summary by cubic
Fixes regressions that caused duplicate assistant responses and stuck internal prompts. The watchdog now recognizes all documented OpenCode progress events, and the prompt gate correctly detects terminal assistant turns.
message.part.updatedwith nestedproperties.part.sessionIDandmessage.part.deltawith text deltas as progress, resetting the silence timer.finish === trueandinfo.time.completedas terminal assistant turns, so internal prompts are not blocked.Written for commit f8f4b57. Summary will update on new commits. Review in cubic