fix: preserve Atlas handoff metadata on /start-work#2583
fix: preserve Atlas handoff metadata on /start-work#2583code-yeongyu merged 1 commit intocode-yeongyu:devfrom
Conversation
|
All contributors have signed the CLA. Thank you! ✅ |
|
Companion issue: #2584\n\nThis PR addresses the Atlas handoff regression tracked there. |
There was a problem hiding this comment.
Pull request overview
This PR fixes an agent-handoff metadata mismatch for the /start-work flow by ensuring outgoing chat message metadata reflects the post-handoff agent (Atlas), preventing downstream consumers (events/UI) from reverting session state back to Prometheus.
Changes:
- Stamp
/start-workoutgoing message metadata (output.message.agent) toAtlas (Plan Executor)after switching the session agent toatlas. - Add a regression test asserting the outgoing message is stamped with the Atlas display name.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/hooks/start-work/start-work-hook.ts | Sets outgoing message agent metadata to the Atlas display name after updating the session agent. |
| src/hooks/start-work/index.test.ts | Adds a test verifying the outgoing message is stamped as Atlas (Plan Executor). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| ) | ||
|
|
||
| // then | ||
| expect(output.message.agent).toBe("Atlas (Plan Executor)") |
|
Maintainer note: companion issue is #2584. I could not apply labels or formally request review from this fork due repository permissions, but this PR is ready for review. |
There was a problem hiding this comment.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: The change safely updates message metadata to match the internal session state, addresses a reported synchronization issue, and includes a comprehensive regression test.
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
|
@Jrakru Please sign the CLA as commented above. Once you do this, I'll review. Thank you for your contributions!
|
Summary
/start-workmessages withAtlas (Plan Executor)after the session agent is switchedProblem
/start-workalready updated the internal session agent toatlas, but it did not update the outgoing message metadata. Downstream readers that rely on message agent data could still seePrometheus (Plan Builder)and later treat the session as Prometheus again.Fix
Set
output.message.agenttoAtlas (Plan Executor)in thestart-workhook immediately afterupdateSessionAgent(input.sessionID, "atlas").Companion issue
Verification
bun test src/hooks/start-work/index.test.tsbun test src/plugin/event.test.ts