Skip to content

fix: preserve Atlas handoff metadata on /start-work#2583

Merged
code-yeongyu merged 1 commit intocode-yeongyu:devfrom
Jrakru:fix/start-work-atlas-handoff
Mar 25, 2026
Merged

fix: preserve Atlas handoff metadata on /start-work#2583
code-yeongyu merged 1 commit intocode-yeongyu:devfrom
Jrakru:fix/start-work-atlas-handoff

Conversation

@Jrakru
Copy link
Copy Markdown
Contributor

@Jrakru Jrakru commented Mar 15, 2026

Summary

  • stamp /start-work messages with Atlas (Plan Executor) after the session agent is switched
  • keep downstream event/UI readers from reverting the active session back to Prometheus
  • add a regression test for the Atlas message stamp

Problem

/start-work already updated the internal session agent to atlas, but it did not update the outgoing message metadata. Downstream readers that rely on message agent data could still see Prometheus (Plan Builder) and later treat the session as Prometheus again.

Fix

Set output.message.agent to Atlas (Plan Executor) in the start-work hook immediately after updateSessionAgent(input.sessionID, "atlas").

Companion issue

Verification

  • bun test src/hooks/start-work/index.test.ts
  • bun test src/plugin/event.test.ts

Copilot AI review requested due to automatic review settings March 15, 2026 23:04
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 15, 2026

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

@Jrakru
Copy link
Copy Markdown
Contributor Author

Jrakru commented Mar 15, 2026

Companion issue: #2584\n\nThis PR addresses the Atlas handoff regression tracked there.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-work outgoing message metadata (output.message.agent) to Atlas (Plan Executor) after switching the session agent to atlas.
  • 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)")
@Jrakru
Copy link
Copy Markdown
Contributor Author

Jrakru commented Mar 15, 2026

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.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

@acamq
Copy link
Copy Markdown
Collaborator

acamq commented Mar 16, 2026

@Jrakru Please sign the CLA as commented above. Once you do this, I'll review. Thank you for your contributions!

Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement (CLA).

To sign the CLA, please comment on this PR with:

I have read the CLA Document and I hereby sign the CLA

This is a one-time requirement. Once signed, all your future contributions will be automatically accepted.

I have read the CLA Document and I hereby sign the CLA

You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@code-yeongyu code-yeongyu added the triage:bug Confirmed bug with repro steps label Mar 24, 2026
@code-yeongyu code-yeongyu merged commit 71004e8 into code-yeongyu:dev Mar 25, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage:bug Confirmed bug with repro steps

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants