Skip to content

Preserve user picker state for orchestration when Agent Merge is enabled - #332609

Merged
Benjamin Christopher Simmonds (benibenj) merged 2 commits into
mainfrom
copilot/fix-multi-session-merge-behavior
Aug 25, 2026
Merged

Preserve user picker state for orchestration when Agent Merge is enabled#332609
Benjamin Christopher Simmonds (benibenj) merged 2 commits into
mainfrom
copilot/fix-multi-session-merge-behavior

Conversation

Copilot AI commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Description

Agent Merge temporarily forces session config (for example mode=autopilot and elevated approvals) via controller-side injection, but orchestration tools were inheriting those temporary values when creating child sessions. This updates inheritance to use the underlying user-configured picker state instead of merge-induced overrides.

  • Shared non-merge config view

    • Added getNonMergeSessionConfigValues(...) in agentMerge.ts.
    • When Agent Merge is enabled and injected config is present, it reconstructs effective user values from injectedConfiguration.previous (only for keys still matching injected applied values).
  • Orchestration default inheritance fix

    • Updated AgentService._getServerToolCreationDefaults(...) to pass non-merge values into provider getInheritedChatConfig(...).
    • This makes create_session/orchestration inheritance copy pre-merge picker values, not temporary merge overrides.
  • Coverage

    • Added unit tests for:
      • non-merge accessor behavior (merge-enabled and non-merge sessions),
      • session-creation inheritance from a merge-enabled source session (ensuring pre-merge values are inherited).
const config = provider.getInheritedChatConfig(
	getNonMergeSessionConfigValues(session.config?.values)
);

Copilot AI balanced review requested due to automatic review settings August 25, 2026 20:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Co-authored-by: benibenj <44439583+benibenj@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix session configuration inheritance during agent merge Preserve user picker state for orchestration when Agent Merge is enabled Aug 25, 2026
@benibenj
Benjamin Christopher Simmonds (benibenj) marked this pull request as ready for review August 25, 2026 21:23
@benibenj
Benjamin Christopher Simmonds (benibenj) merged commit 499be98 into main Aug 25, 2026
27 checks passed
@benibenj
Benjamin Christopher Simmonds (benibenj) deleted the copilot/fix-multi-session-merge-behavior branch August 25, 2026 23:04
@vs-code-engineering vs-code-engineering Bot added this to the 1.136.0 milestone Aug 25, 2026
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.

5 participants