Skip to content

Providers phase 2c-3: N-provider Pass A id capture + registry-derived setup tools - #401

Merged
Juliusolsson05 merged 1 commit into
mainfrom
refactor/providers-phase2c3-passa-setup
Jul 6, 2026
Merged

Juliusolsson05 merged 1 commit into
mainfrom
refactor/providers-phase2c3-passa-setup

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

Part of #394 (phase 2c). Follows #400.

1. Pass A generalization (renderer)

Provider-session-id capture now iterates every registered provider's extractProviderSessionId (the phase-2b capability) instead of the claude/codex shape fork. Deliberately not kind-routed: this pass feeds the #290 foreign-transcript quarantine, which must observe a conflicting provider's id to quarantine the burst — kind routing would blind the detector to exactly the misattach it catches. Precedence follows AGENT_PROVIDER_KINDS order (identical to the old claude-then-codex fallback).

2. Registry-derived setup tools (main)

  • SetupToolId's hand-written 'claude' | 'codex' arms → AgentProviderKind (the second parallel provider enumeration, gone).
  • New registry.setup.ts — plain-data descriptors (binaryName, label, required, detail); TOOL_COMMAND / TOOL_META / CHECK_ORDER derive from it. Registering a provider automatically adds its SetupGate row, PATH resolution and check ordering.
  • WHY not a MainProviderConfig field: binaryResolver → registry.main → claudeSession → toolchain → binaryResolver is a genuine ESM cycle; the plain-data split mirrors registry.renderer.capabilities.ts which exists for the same reason renderer-side.

Verification

tsc --noEmit clean on both projects; electron-vite build clean; vitest 170/170.

🤖 Generated with Claude Code

… setup tools

Two remaining phase-2c capabilities, both closing hand-enumerated
provider lists:

1. Pass A provider-session-id capture (useIpcSubscriptions) now runs
   EVERY registered provider's extractProviderSessionId on every line
   — deliberately NOT kind-routed. This pass feeds the #290
   foreign-transcript quarantine, which must observe a conflicting
   provider id even when the line belongs to a different provider
   than the pane; kind-routing here would blind the conflict detector
   to exactly the misattach it exists to catch. Extractors are
   mutually exclusive by wire shape, and observed-id precedence
   follows AGENT_PROVIDER_KINDS order (preserving the historical
   claude-then-codex fallback). The last shape-sniff special-case in
   Pass A (claude's inline `raw.sessionId` read) moves behind the
   registry capability added in phase 2b.

2. Setup tooling derives its provider entries from a new plain-data
   registry.setup.ts: SetupToolId's hand-written 'claude'|'codex'
   arms become AgentProviderKind; TOOL_COMMAND, TOOL_META, and
   CHECK_ORDER spread from listProviderSetupDescriptors() /
   AGENT_PROVIDER_KINDS. Registering a provider now automatically
   adds its SetupGate row, PATH resolution, and check ordering.

   WHY a separate registry.setup.ts instead of a field on
   MainProviderConfig: binaryResolver → registry.main →
   claudeSession → toolchain → binaryResolver would be a genuine ESM
   module cycle (claudeSession imports getToolPath/resolveBundledTool
   from @main/setup). The plain-data split mirrors
   registry.renderer.capabilities.ts, which exists for the same
   reason on the renderer side. The descriptor also makes the
   kind↔binaryName coupling explicit and per-provider breakable, and
   carries the `required` flag that #394 §13.5's "installed
   providers" concept will flip later.

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