-
Notifications
You must be signed in to change notification settings - Fork 30
🤖 feat: copy plan file when forking workspace #1200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
1994c5f to
e5b019c
Compare
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
e5b019c to
436c4d2
Compare
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
When a workspace is forked via /fork, the plan file is now copied along with the chat history, partial state, and usage tracking. This allows the forked workspace to continue working with the same plan context as the original. Changes: - Add copyPlanFile helper in src/node/utils/runtime/helpers.ts - Call copyPlanFile in workspaceService.fork() after session files Change-Id: Iaee04cb44c1b5a98e13eb693fa729a078b8d0013 Signed-off-by: Thomas Kosiewski <[email protected]>
436c4d2 to
d104885
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Copy plan file when forking workspace so the forked workspace can continue working with the same plan context.
Changes:
copyPlanFilehelper insrc/node/utils/runtime/helpers.ts(mirrors existingmovePlanFilepattern)copyPlanFileinworkspaceService.fork()after session files are copied📋 Implementation Plan
Plan: Copy Plan File on Workspace Fork
Summary
Add functionality to copy the source workspace's plan file when forking, allowing the forked workspace to continue working with the same plan context.
Problem
When a workspace is forked via
/fork, the following files are copied:chat.jsonl(chat history)partial.json(partial streaming state)session-usage.json(usage tracking)However, the plan file (
~/.mux/plans/{project}/{workspace}.md) is not copied. This means the forked workspace starts without the plan context, even though it inherits the chat history where the plan was discussed.Solution
Add a
copyPlanFilehelper function and invoke it during the fork operation inworkspaceService.fork().Implementation
1. Add
copyPlanFilehelper insrc/node/utils/runtime/helpers.tsCreate a new function following the same pattern as
movePlanFile:2. Update
src/node/services/workspaceService.tsAdd import for
copyPlanFile:Call
copyPlanFilein thefork()method after successfully copying session files (~line 924):File Changes
src/node/utils/runtime/helpers.tscopyPlanFilefunction (~15 LoC)src/node/services/workspaceService.tscopyPlanFile(~3 LoC)Net LoC estimate: ~+18 lines
Testing
The existing test patterns for
movePlanFilein rename operations provide a template. The change is straightforward:copyPlanFilefollows the same error-handling pattern asmovePlanFileManual verification:
/fork new-name~/.mux/plans/{project}/new-name.mdEdge Cases
movePlanFilebehavior)cpwill overwrite, which is correct for forksmovePlanFile)Generated with
mux• Model:anthropic:claude-opus-4-5• Thinking:high