fix(runtime-fallback): harden delegated fallback retry flow#4223
fix(runtime-fallback): harden delegated fallback retry flow#4223andomeder wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
1 issue found across 19 files
Confidence score: 3/5
- There is a concrete regression risk in
src/hooks/runtime-fallback/visible-assistant-response.ts: auto-retry signal messages can still hit the completion/progress branch and suppress fallback, even though retry signals are meant to be excluded. - The issue is high severity (8/10) with high confidence (10/10), so this is more than a minor edge case and could produce user-visible fallback behavior problems.
- Given this specific, user-impacting logic gap, merge risk is moderate rather than blocking-critical, but it should be addressed or carefully validated before release.
- Pay close attention to
src/hooks/runtime-fallback/visible-assistant-response.ts- retry-signal exclusion can be bypassed by completion/progress handling and suppress fallback incorrectly.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Requires human review: The PR makes extensive, logic-sensitive changes across fallback retries, message normalization, and session handling; despite the clean AI review, the custom '100% no regressions' threshold is not met for such a large and complex diff.
Re-trigger cubic
|
[sisyphus-bot] Hi andomeder. 🙏 Thanks for the very thorough work here. I read through every file in the 19-file diff, and I want to be transparent about why I'm not landing this without a maintainer pass even though Cubic's automated review was clean. What I checked and liked
Why I want a maintainer eye before merge
Concrete observations (mostly non-blocking, one worth confirming)
Going to leave this for a maintainer to take the rest of the way. Thanks again for the careful structure; the additive shape and the test coverage made it possible to write this much detail without me having to guess at intent. |
…n internal markers Design: the same OMO_INTERNAL_INITIATOR_MARKER token serves two semantically distinct contexts that MUST stay separate. VISIBLE markers (createInternalAgentTextPart, no synthetic flag): PR code-yeongyu#4003 agent-handoff identity markers — the agent MUST read its new identity from the chat stream. If these were synthetic, the LLM would be blind to its own role change and fail to switch identities. HIDDEN markers (createInternalAgentContinuationTextPart, synthetic: true): PR code-yeongyu#4223 internal retry/compaction prompts — invisible to the LLM as user input so they do not pollute the agent's perceived conversation. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
eb25d29 to
2bfad49
Compare
…n internal markers Design: the same OMO_INTERNAL_INITIATOR_MARKER token serves two semantically distinct contexts that MUST stay separate. VISIBLE markers (createInternalAgentTextPart, no synthetic flag): PR code-yeongyu#4003 agent-handoff identity markers — the agent MUST read its new identity from the chat stream. If these were synthetic, the LLM would be blind to its own role change and fail to switch identities. HIDDEN markers (createInternalAgentContinuationTextPart, synthetic: true): PR code-yeongyu#4223 internal retry/compaction prompts — invisible to the LLM as user input so they do not pollute the agent's perceived conversation. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Summary
Fixes a reproduced runtime-fallback failure chain in delegated child sessions:
Changes
reservedsynthetic: trueso they stay hidden in history instead of appearing as a second user promptTesting
bun test src/hooks/runtime-fallback/auto-retry.test.ts src/hooks/runtime-fallback/index.test.ts src/hooks/runtime-fallback/message-update-handler.test.ts src/tools/delegate-task/sync-session-poller.test.tsbun test src/shared/internal-initiator-marker.test.ts src/hooks/runtime-fallback/auto-retry.test.ts src/hooks/runtime-fallback/index.test.ts src/hooks/runtime-fallback/message-update-handler.test.ts src/tools/delegate-task/sync-session-poller.test.ts src/tools/delegate-task/sync-prompt-sender.test.ts src/shared/model-suggestion-retry.test.ts src/plugin/chat-message.test.tsbun run buildRelated Issues
Limit Exhaustederror from ZAI provider not recognized #4207Summary by cubic
Strengthens delegated runtime fallback and retries to prevent hangs, duplicate prompts, and dropped retries. Improves completion/visibility detection across mixed SDK payloads while ignoring provider auto‑retry noise.
provider/modelstrings.data, ormessages) before checks; ignore provider auto‑retry text in visibility checks; count reasoning-only and token/cost-based completions as visible; ignore empty finish markers.runtime-fallback:prompts when not accepted.synthetic: true) to keep them hidden and avoid a second visible user prompt.time.completedwith meaningful payload; use timestamps when IDs are missing; keep polling on empty completions; improve terminal error extraction.Written for commit b2ef800. Summary will update on new commits. Review in cubic