Repository navigation
fix(agents): migrate policy-disabled Claude and Codex chats - #340702
Merged
Giuseppe Cianci (Giuspepe) merged 16 commits intoOct 14, 2026
Merged
Giuseppe Cianci (Giuspepe) merged 16 commits into
Giuseppe Cianci (Giuspepe) merged 16 commits into
Conversation
Keep Claude and Codex Agent Host history visible when enterprise policy disables their providers. Open these sessions read-only and preserve loaded history and drafts through policy changes. Cancel obsolete provider resolutions during recovery so late results cannot replace the current chat model.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Failed root snapshots can incorrectly remove all existing local agent and sidebar registrations during configuration changes.
2 open findings
What changed in this PR
Retains policy-disabled local Claude and Codex sessions as read-only history while preserving loaded transcripts and drafts.
Changes:
- Separates history visibility from executable provider registration.
- Preserves and reloads models across policy/provider transitions.
- Adds policy, cancellation, and read-only regression coverage.
| File | Description |
|---|---|
chatService.test.ts |
Tests retained read-only models and drafts. |
chatEditorInput.test.ts |
Tests editor reload cancellation and preservation. |
cloudSandboxSessionHandler.test.ts |
Adapts tests for optional history actions. |
chatSessionsService.test.ts |
Tests cancellation during provider replacement. |
agentHostChatContribution.test.ts |
Tests policy-only registrations and disposal. |
chatServiceImpl.ts |
Makes policy-revoked models persistently read-only. |
chatEditorInput.ts |
Adds cancellable resolution and model release. |
chatEditor.ts |
Reloads editors after provider replacement. |
chatSessions.contribution.ts |
Cancels pending provider resolutions. |
agentHostSessionListStore.ts |
Retains policy-hidden provider entries. |
agentHostSessionListContribution.ts |
Registers history-only sidebar controllers. |
agentHostSessionHandler.ts |
Rejects mutations after disposal. |
agentHostPolicyUnavailableSession.ts |
Implements inert policy-disabled content. |
agentHostChatContribution.ts |
Registers history-only content providers. |
chatGroupsView.test.ts |
Tests read-only draft and banner presentation. |
localAgentHostSessionsProvider.test.ts |
Covers policy transitions and retained sessions. |
localAgentHostSessionsProvider.ts |
Exposes policy-disabled saved sessions read-only. |
baseAgentHostSessionsProvider.ts |
Gates mutations and passive restoration by policy. |
chatView.test.ts |
Tests Sessions model retention and reloads. |
chatView.ts |
Preserves models during provider replacement. |
chatGroupView.ts |
Displays read-only drafts as transcripts. |
chatSessionHistory.ts |
Makes recovery actions optional. |
agentService.ts |
Adds local-provider policy helpers. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Reproduce lost registrations after a root-subscription failure and the missing editor loading indicator while policy recovery waits for history.
Preserve passive history reads with recorded chat ownership and current session-list contracts. Stop cancelled Local editor opens after account-policy waits and move the saved-chat capability into the typed metadata boundary.
Add failing regression coverage for automatic Claude/Codex migration, copy completion ordering, imported titles, draft handoff, and empty saved peer workspace metadata.
Automatically continue visible idle chats when managed settings require Copilot. Preserve transcript, title, and unsent draft, then archive only after the copy opens. Keep uncopied public siblings accessible. Record completed continuations for retries, recover deleted copies, and serialize archive and restore operations without source-provider execution or worktree cleanup. Preserve imported Local chat titles too.
Giuseppe Cianci (Giuspepe)
marked this pull request as ready for review
October 14, 2026 14:28
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: TylerLeonhardtMatched files:
Benjamin Christopher Simmonds (@benibenj)Matched files:
|
roblourens
approved these changes
Oct 14, 2026
Giuseppe Cianci (Giuspepe)
deleted the
agents/investigate-codex-claude-session-filtering
branch
October 14, 2026 15:44
Closed
1 task
| @IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService, | ||
| @IManagedSettingsService managedSettingsService: IManagedSettingsService, | ||
| @ICommandService private readonly commandService: ICommandService, | ||
| @IAgentHostPolicyContinuationService private readonly policyContinuationService: IAgentHostPolicyContinuationService, |
There was a problem hiding this comment.
Misses registration for Web? Only Desktop has?
3 of 5 tasks
3 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



code-oss-automatic-policy-migration.mp4
Claude and Codex Agent Host chats disappear from the sidebar when enterprise policy disables their agents. This keeps them listed, shows their saved transcripts, and lets users continue in Copilot.
When managed settings require Copilot, a visible, idle chat moves automatically, matching Local migration in #340779. This also covers policy arriving while the chat is open. The Copilot copy keeps the transcript, original title, and unsent draft with its attachments. Nothing is sent automatically.
After the Copilot copy opens, the original moves to Archived and stays readable. A source session stays in the active list while it has uncopied public conversations. Archiving changes saved metadata only, so source worktrees and private tool history remain intact. Continue in Copilot reuses the existing copy after a completed migration. If that copy is deleted, the original can be migrated again.
The shared import also fixes Local title loss in #341029. Other policy disablements retain Continue in Copilot. Managed checkouts and folders that need trust also use the manual action so the user can choose an independent workspace or grant trust.
Saved-history access
Recovery intentionally uses the disabled provider’s installed code to read history. Claude uses its SDK’s local history utilities without starting a query. Codex starts its installed app-server with a temporary home and copied indexes, then makes history requests. It does not create or resume a native thread or send a model request. Neither reader downloads an SDK. New Claude and Codex sessions and messages remain blocked, and Copilot follows the current organization policy.
Scope and limits
Validation