fix(atlas): schedule delayed retry when cooldown blocks boulder continuation#2335
Merged
code-yeongyu merged 10 commits intodevfrom Mar 6, 2026
Merged
fix(atlas): schedule delayed retry when cooldown blocks boulder continuation#2335code-yeongyu merged 10 commits intodevfrom
code-yeongyu merged 10 commits intodevfrom
Conversation
…trong worktree active instructions When no worktree is specified in boulder, stop injecting 'Worktree Setup Required' instructions. When worktree IS present, inject emphatic instructions ensuring the agent and all subagents operate exclusively within the worktree directory.
…-5/k2p5/kimi-k2.5 fallbacks 🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
…, gpt-5-3-codex, generic gpt) Split GPT prompt into three variants with model-based routing: - gpt-5-4.ts: GPT-5.4 optimized (expert coding agent framing, prose-first) - gpt-5-3-codex.ts: GPT-5.3-Codex optimized (Hephaestus-style Senior Engineer) - gpt.ts: Generic GPT fallback (Hephaestus-style, for any other GPT model) Routing: gpt-5.4 → gpt-5-4 | gpt-5.3-codex → gpt-5-3-codex | other GPT → gpt 🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
… routing Split monolithic hephaestus.ts into directory with model-specific prompt variants (gpt-5-4.ts, gpt-5-3-codex.ts, gpt.ts) mirroring the sisyphus-junior pattern. Generic gpt.ts uses pre-codex-tuning prompt as fallback for non-specific GPT models. Also adds isGpt5_4Model and isGpt5_3CodexModel helpers to types.ts.
…nuation When atlas injects a boulder continuation via promptAsync() and the model's response is immediately aborted (MessageAbortedError), OpenCode fires a burst of session.idle events within milliseconds. Atlas blocks all of them due to the 5-second cooldown. After the burst, OpenCode stops generating session.idle events (it's state-change based, not periodic), leaving the session stuck forever. Fix: When cooldown blocks an idle event for a boulder session with an incomplete plan, schedule a one-shot setTimeout (cooldown + 1s) to re-attempt injection. The timer callback re-checks boulder state, plan progress, and continuation-stopped flag before injecting. Only one timer per session is allowed (deduped via pendingRetryTimer field). Timers are cleaned up on session.deleted and session.compacted events.
There was a problem hiding this comment.
4 issues found across 40 files
Confidence score: 3/5
- There is a concrete regression risk in
src/hooks/atlas/event-handler.ts: delayed retry can continue without re-running full eligibility checks, which may cause duplicate or invalid injections in real flows. src/cli/model-fallback-requirements.tsis missing theopencodeprovider for glm-5, creating a runtime/requirements mismatch risk that can surface as provider fallback failures.- This lands at moderate merge risk because multiple medium-to-high severity issues are identified with high confidence, including one clearly user-impacting behavior and several maintainability/CI stability concerns.
- Pay close attention to
src/hooks/atlas/event-handler.ts,src/cli/model-fallback-requirements.ts,src/hooks/atlas/index.test.ts, andsrc/agents/sisyphus-junior/gpt-5-3-codex.ts- injection validity, provider consistency, test-runtime slowdown, and duplicated template logic need follow-up.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/cli/model-fallback-requirements.ts">
<violation number="1" location="src/cli/model-fallback-requirements.ts:275">
P2: Add the 'opencode' provider to the glm-5 model to remain consistent with visual-engineering and runtime requirements.</violation>
</file>
<file name="src/hooks/atlas/index.test.ts">
<violation number="1" location="src/hooks/atlas/index.test.ts:1449">
P2: Using real `setTimeout` with a 7000ms delay in unit tests adds 35 seconds of dead waiting time across these 5 new tests, significantly slowing down CI and local test execution. Consider mocking the timer (e.g., using `jest.useFakeTimers()` provided by `bun:test`, or a custom fake timer like the one used in `todo-continuation-enforcer.test.ts`) to instantly advance time instead.</violation>
</file>
<file name="src/agents/sisyphus-junior/gpt-5-3-codex.ts">
<violation number="1" location="src/agents/sisyphus-junior/gpt-5-3-codex.ts:11">
P2: This file is an exact duplicate of \`src/agents/sisyphus-junior/gpt.ts\`, with only the function names and top comment changed. The entire 150-line string template is duplicated verbatim. Consider reusing \`buildGptSisyphusJuniorPrompt\` or extracting the shared prompt string to avoid maintaining two identical copies.</violation>
</file>
<file name="src/hooks/atlas/event-handler.ts">
<violation number="1" location="src/hooks/atlas/event-handler.ts:128">
P1: Delayed retry injects continuation without re-running full eligibility checks, which can trigger duplicate or invalid injections.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| @@ -0,0 +1,151 @@ | |||
| /** | |||
There was a problem hiding this comment.
P2: This file is an exact duplicate of `src/agents/sisyphus-junior/gpt.ts`, with only the function names and top comment changed. The entire 150-line string template is duplicated verbatim. Consider reusing `buildGptSisyphusJuniorPrompt` or extracting the shared prompt string to avoid maintaining two identical copies.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/agents/sisyphus-junior/gpt-5-3-codex.ts, line 11:
<comment>This file is an exact duplicate of \`src/agents/sisyphus-junior/gpt.ts\`, with only the function names and top comment changed. The entire 150-line string template is duplicated verbatim. Consider reusing \`buildGptSisyphusJuniorPrompt\` or extracting the shared prompt string to avoid maintaining two identical copies.</comment>
<file context>
@@ -0,0 +1,151 @@
+
+import { resolvePromptAppend } from "../builtin-agents/resolve-file-uri"
+
+export function buildGpt53CodexSisyphusJuniorPrompt(
+ useTaskSystem: boolean,
+ promptAppend?: string
</file context>
Address Cubic P1 review: timer callback now re-checks failure backoff count, boulder session membership, and running background tasks before injecting continuation, matching the main idle handler's eligibility gate.
…vider to glm-5 Replace real setTimeout(7000) with fake timer interception in atlas retry tests (35s -> 227ms). Add missing opencode provider to glm-5 fallback in unspecified-high category.
germamsatere-sudo
approved these changes
Mar 7, 2026
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
session.idleevents within milliseconds, all blocked by 5s cooldown. After the burst stops, no more idle events come (state-change based, not periodic) — session stuck foreversetTimeout(cooldown + 1s = 6s) when cooldown blocks an idle event for a boulder with incomplete plan. Timer re-checks boulder state/plan/continuation-stopped before injecting. Deduped viapendingRetryTimerfield. Cleaned up onsession.deleted/session.compactedChanges
src/hooks/atlas/types.ts: AddedpendingRetryTimerfield toSessionStatesrc/hooks/atlas/event-handler.ts: Added delayed retry timer in cooldown skip branch + timer cleanup in session.deleted/compacted handlerssrc/hooks/atlas/index.test.ts: 5 new TDD tests covering retry scheduling, dedup, plan-complete bailout, and cleanup on delete/compactTest Results
All 46 tests pass (41 existing + 5 new). Typecheck clean.
Summary by cubic
Prevents atlas boulder continuation from getting stuck after an aborted response by scheduling a delayed retry once the cooldown passes. Also tightens retry checks, adds model‑routed prompts, the Final Verification Wave, QA scenario checks, and updates fallbacks to prefer gpt‑5.4.
Bug Fixes
New Features
Written for commit b062fc4. Summary will update on new commits.