Skip to content

fix(acp): preserve mode across fork - #587

Open
dawNotPoi wants to merge 1 commit into
xintaofei:mainfrom
dawNotPoi:fix/fork-inherits-mode
Open

fix(acp): preserve mode across fork#587
dawNotPoi wants to merge 1 commit into
xintaofei:mainfrom
dawNotPoi:fix/fork-inherits-mode

Conversation

@dawNotPoi

Copy link
Copy Markdown
Contributor

Summary

  • capture the live parent ACP mode when a fork is requested
  • reapply a differing mode before selectors become ready and queued prompts run
  • ignore stale ancestor state when the current parent does not advertise modes
  • add regression coverage for differing, matching, absent, stale, and latest modes

Why

A fork response can reset Claude Code to its default Manual mode while the frontend still caches the parent selection. The next prompt can therefore run under the wrong permission mode. Preserving the backend live mode across the fork keeps the child session behavior consistent with its parent.

Testing

  • cargo test --no-default-features --lib fork_mode_inheritance
  • cargo test --no-default-features --lib
  • cargo clippy --no-default-features --bin codeg-server --lib -- -D warnings
  • git diff --check

Fixes #398

@dawNotPoi
dawNotPoi marked this pull request as ready for review August 27, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Forked Claude Code conversation always starts with "Manual" mode

1 participant