fix: track agent in boulder state to fix session continuation (fixes #927)#1477
Conversation
There was a problem hiding this comment.
1 issue found across 5 files
Confidence score: 3/5
- There is a concrete behavior mismatch in
src/hooks/atlas/index.ts: continuation acceptsboulderState.agent, but idle handler still early-returns unless last message agent is Atlas, which can block non-Atlas agents from continuing. - Given the medium severity and user-facing impact (continuations failing for agents like Sisyphus), there’s some merge risk despite being localized.
- Pay close attention to
src/hooks/atlas/index.ts- idle handler gating prevents non-Atlas continuations.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="src/hooks/atlas/index.ts">
<violation number="1" location="src/hooks/atlas/index.ts:571">
P2: Continuation injection now accepts `boulderState.agent`, but the idle handler still returns early unless the last message agent is Atlas. This blocks continuation for non-Atlas agents (e.g., Sisyphus), making the new agent parameter ineffective and preventing session resumption.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
@code-yeongyu hello again! please review this when you can :3 continuation now checks against boulderState.agent instead of hardcoding atlas |
|
Hey @kaizen403, thanks for the PR! I have a question about the fix:
Could you clarify the exact reproduction scenario for Issue #927? Specifically:
Want to make sure we understand the root cause before merging. Thanks! |
…ode-yeongyu#927) Add 'agent' field to BoulderState to track which agent (atlas) should resume on session continuation. Previously, when user typed 'continue' after interruption, Prometheus (planner) resumed instead of Sisyphus (executor), causing all delegate_task calls to get READ-ONLY mode. Changes: - Add optional 'agent' field to BoulderState interface - Update createBoulderState() to accept agent parameter - Set agent='atlas' when /start-work creates boulder.json - Use stored agent on boulder continuation (defaults to 'atlas') - Add tests for new agent field functionality
Address code review: continuation was blocked unless last agent was Atlas, making the new agent parameter ineffective. Now the idle handler checks if the last session agent matches boulderState.agent (defaults to 'atlas'), allowing non-Atlas agents to resume when properly configured. - Add getLastAgentFromSession helper for agent lookup - Replace isCallerOrchestrator gate with boulder-agent-aware check - Add test for non-Atlas agent continuation scenario
…files Root cause fix for issue code-yeongyu#927: - After /plan → /start-work → interruption, in-memory sessionAgentMap is cleared - getAgentFromMessageFiles() returns 'prometheus' (oldest message from /plan) - But boulder.json has agent: 'atlas' (set by /start-work) Fix: Check boulder state agent BEFORE falling back to message files Priority: in-memory → boulder state → message files Test: 3 new tests covering the priority logic
7d97a64 to
38b40bc
Compare
|
@code-yeongyu you're right. and after spending quite a while. i found the actual root cause isn't in the atlas hook.. it's in prometheus-md-only. to answer your questions:
i've updated the pr with the actual fix |
|
so.. what's happening is when you run /plan then /start-work, the session has messages from both agents. the switch to atlas is saved in memory. when the session crashes, memory is wiped. on "continue", the system checks message files and finds prometheus was first - so it thinks prometheus is running. wrong. what i fixed: check order: memory -> boulder.json -> message files added 3 tests to cover this. all passing |
|
appreciate you asking before merging btw. saved us from shipping an incomplete fix @code-yeongyu :3 |
|
hello @code-yeongyu did you get time to review this? :) |
Summary
Fixes #927 - After session interruption during
/start-work, when user types "continue", Prometheus (planner) was resuming instead of Sisyphus (executor), causing all subsequentdelegate_taskcalls to get READ-ONLY directive injected.Root Cause
The
boulder.jsonfile was missing anagentfield to specify which agent should resume on continuation. The atlas hook hardcodedagent: "atlas"but this wasn't being persisted when the boulder state was created.Changes
agentfield toBoulderStateinterface intypes.tscreateBoulderState()instorage.tsto accept optionalagentparameterstart-workhook to setagent: 'atlas'when creating boulder stateatlashook to use storedboulderState.agent(defaults to 'atlas') on continuationTesting
createBoulderStatewith agent fieldSummary by cubic
Persist the active agent in boulder.json so “continue” resumes the correct executor (atlas/sisyphus) instead of the planner (Prometheus). Fixes #927 and prevents READ-ONLY mode from being injected into delegate_task calls.
Written for commit 38b40bc. Summary will update on new commits.