Skip to content

Providers phase 5a: explicit-target switch API + neutral-hub pointer bump - #405

Merged
Juliusolsson05 merged 1 commit into
mainfrom
refactor/providers-phase5a-switch
Jul 6, 2026
Merged

Juliusolsson05 merged 1 commit into
mainfrom
refactor/providers-phase5a-switch

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

Part of #394 (phase 5). The switch feature stops being structurally binary:

  • switchProvider takes an explicit targetKind, dispatches on the (source, target) pair, and fails loudly on unknown pairs. The negation default survives one release for back-compat.
  • The real gap: providerSwitchCore received targetKind from its callers but dropped it before IPC — the renderer's choice is now authoritative end-to-end.
  • Bumps agent-transcript-parser to the merged neutral-hub head (Add workflow command pickers #6/fix(workspace): render orphaned ghost fallback entries #7/Add mac packaging and first-launch setup #8) — the translate seam with byte-proven equivalence is now in-tree for the engine migration slice.
  • Opportunistic: remaining literal-pair guards, toast ternaries → registry labels, draftImages carry-over → supportsImageAttachments.

Verified: tsc both projects, build, vitest 170/170.

🤖 Generated with Claude Code

…bump

Kills the structural binarity of provider switching (#394 §6):

- switchProvider now takes an EXPLICIT targetKind and dispatches on
  the (source, target) pair. The old code switched by NEGATION —
  `sourceKind === 'claude' ? claudeToCodex : codexToClaude` with no
  target parameter anywhere in the API. Unknown pairs now fail loudly
  ("no translation path for X → Y yet") instead of silently
  translating to the wrong provider. targetKind is optional for one
  release of back-compat (omitted = the historical negation); the
  field hard-requires when a third provider registers.

- providerSwitchCore had the real gap: it RECEIVED targetKind from
  its callers (focused command, bulk modal) but dropped it before the
  IPC call, relying on main's negation. The renderer's target choice
  is now authoritative end-to-end (preload + IPC schemas widened).

- Bumps packages/agent-transcript-parser to the merged neutral-hub
  head (atp#6/#7/#8): the A↔C↔B translate seam with proven
  equivalence is now available in-tree for the switch flows' engine
  migration (next slice — file layout/sanitizer/id policy move onto
  the codecs).

Opportunistic (per standing preference): the switch/reload flows'
remaining literal-pair guards → isAgentProviderKind; "Switched to
Codex/Claude" and "Codex/Claude reloaded" toasts → registry
shortLabel; providerSwitchCore's draftImages carry-over gate →
supportsImageAttachments capability (was `targetKind === 'claude'`).

Verified: tsc clean on both projects, electron-vite build clean,
vitest 170/170.

Part of #394.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant