Skip to content

feat(proxy): add disconnect support for Claude Desktop, VS Code Copilot Chat, and VS Code Claude Code - #580

Open
zsoltkovacs4-dot wants to merge 8 commits into
codemie-ai:mainfrom
zsoltkovacs4-dot:feature/EPMCDME-15246_proxy-disconnect-support
Open

zsoltkovacs4-dot wants to merge 8 commits into
codemie-ai:mainfrom
zsoltkovacs4-dot:feature/EPMCDME-15246_proxy-disconnect-support

Conversation

@zsoltkovacs4-dot

Copy link
Copy Markdown

Summary

Extends codemie proxy disconnect to fully support all four proxy targets — Codex Desktop (existing), Claude Desktop, VS Code Copilot Chat, and VS Code Claude Code — by adding a remove-config connector for each of the three new targets and rewriting the disconnect orchestrator to dispatch across all four independently, mirroring the existing connect flow's TargetResult reporting shape.

Changes

  • connectors/desktop.ts: removeDesktopConfig() clears CodeMie-written config keys and the managed-MCP marker; detects and recovers stranded gateway keys even when no marker exists (e.g. after a failed org-catalog fetch on first connect).
  • connectors/vscode.ts / connectors/vscode-claude-code.ts: removeVsCodeLanguageModelsConfig() / removeVsCodeClaudeCodeConfig() check both the stable and Insiders config locations; a write failure at one location no longer discards a successful removal at the other.
  • disconnect-orchestrator.ts: rewritten to dispatch all four targets independently via TargetResult, with printSummary() matching connect-orchestrator.ts's convention.
  • index.ts: disconnect subcommand gains --claude-desktop, --vscode, --vscode-claude-code flags alongside the existing --codex-desktop flag.

Testing

  • Tests added/updated (connector unit tests, orchestrator dispatch tests, CLI-parser wiring tests)
  • Manual testing done (npx vitest run --project cli: 37 passed | 1 skipped, 279 passed | 10 skipped, 0 failures)

Checklist

  • Code follows project standards
  • CI is green (full SDLC qa-gates: license, lint, typecheck, build, unit, integration, secrets, commitlint all passed)
  • No merge conflicts with main

Ref: EPMCDME-15246

Export removeDesktopConfig() and readManagedMcpState() from desktop.ts,
reversing writeDesktopConfig's write: strips INFERENCE_KEYS, inferenceModels,
coworkEgressAllowedHosts, and marker-managed MCP entries while preserving
genuine user-added MCP entries. No-ops when nothing was connected.

EPMCDME-15246 (proxy-disconnect-support), task 1/5.
Export removeVsCodeLanguageModelsConfig(), checking both stable and Insiders
chatLanguageModels.json locations and filtering out the CodeMie provider
entry. A missing product dir (edition not installed) is treated as
nothing-to-do per location; corrupt JSON still throws.

EPMCDME-15246 (proxy-disconnect-support), task 2/5.
Export removeVsCodeClaudeCodeConfig(), stripping the ANTHROPIC_BASE_URL /
ANTHROPIC_AUTH_TOKEN managed entries from claudeCode.environmentVariables at
both stable and Insiders settings.json, via targeted jsonc-parser edits so
comments/formatting survive. Missing product dir per edition no-ops; corrupt
JSONC still throws.

EPMCDME-15246 (proxy-disconnect-support), task 3/5.
Rewrite disconnectTargets from its single codex-desktop-only branch to
independent per-target TargetResult dispatch (Claude Desktop, VS Code Copilot
Chat, VS Code Claude Code, Codex Desktop), mirroring connect-orchestrator's
shape. One target throwing sets process.exitCode = 1 without blocking a
sibling target's own outcome. Codex Desktop behavior is unchanged.

EPMCDME-15246 (proxy-disconnect-support), task 4/5.
Add --claude-desktop, --vscode, --vscode-claude-code options to the
disconnect subcommand alongside --codex-desktop, and pass all four booleans
through to disconnectTargets. Updates the existing CLI wiring test's
expectation to the new four-key targets object.

EPMCDME-15246 (proxy-disconnect-support), task 5/5.
Fixes five blocking findings from the disconnect-support review:
non-transactional config/marker writes in removeDesktopConfig now
tolerate a marker-clear failure without masking a successful config
strip; VS Code Copilot Chat and Claude Code disconnect connectors
isolate per-location (stable/Insiders) write failures so one location's
error no longer discards the other's success; disconnect-orchestrator
adopts connect-orchestrator's printSummary convention; CLI-parser tests
cover the three new disconnect flags; and removeDesktopConfig now
detects stranded gateway keys directly on the config file as a fallback
when a failed org-catalog fetch on first connect left no marker behind.

Ref: EPMCDME-15246
…_proxy-disconnect-support

# Conflicts:
#	src/cli/commands/proxy/connectors/vscode.ts
@mykolanehrych

Copy link
Copy Markdown
Contributor

Your branch has a lot of conflicts with the main branch, please resolve them

@uladzislausvetlakou

Copy link
Copy Markdown
Collaborator

@zsoltkovacs4-dot hi, we would like to ask you to resolve merge conflicts on your branch

@Erithiel

Erithiel commented Oct 8, 2026

Copy link
Copy Markdown

@zsoltkovacs4-dot hi, we would like to ask you to resolve merge conflicts on your branch

Hello @uladzislausvetlakou, conflicts are resolved in this PR: https://github.com/codemie-ai/codemie-code/pull/618/commits

@Bondimm

Bondimm commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

@codemie-ai

Copy link
Copy Markdown
Owner

[AUTO_CLOSE_WARNING] ⏰ This pull request has had no activity for 7 days (last activity: 2026-10-13).

It will be automatically closed no earlier than 2026-10-27 (UTC) (~6 more days).

Any activity from anyone — a comment, a push, a review, reopening — restarts the countdown from that moment. This warning will be deleted automatically once that happens.

This branch has not been deployed

No deployments
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.

7 participants