Skip to content

Fix custom Claude-compatible backend isolation and execution-location popover crash#356

Open
morluto wants to merge 5 commits into
repoprompt:mainfrom
morluto:cc-custom-backend-fix
Open

Fix custom Claude-compatible backend isolation and execution-location popover crash#356
morluto wants to merge 5 commits into
repoprompt:mainfrom
morluto:cc-custom-backend-fix

Conversation

@morluto

@morluto morluto commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

This fixes two Agent Mode issues found while validating a custom Claude-compatible backend configured with DeepSeek model mappings:

  • Custom Claude-compatible backend launches could inherit user global/local Claude settings, including model defaults in files such as ~/.claude/settings.json or project-local Claude config. That could cause Claude Code to initialize with a user-configured model instead of the model selected by RepoPrompt.
  • The execution-location / “Work locally” popover could crash while SwiftUI/AppKit resized the popover after async worktree loading.

No linked issue.

What changed

Custom Claude-compatible backend isolation

  • Launch non-standard Claude-compatible backends with --bare and --setting-sources project,local.
  • Propagate the resolved backend model into native/headless Claude-compatible launches.
  • Set Claude slot model env vars consistently for custom backend slot mappings.
  • Avoid treating ANTHROPIC_MODEL-only changes as requiring native process restart.
  • Suppress effort env when a compatible backend indicates effort settings are unsupported.
  • Surface Claude Code system/api_retry events as task_progress so provider throttling is visible instead of a blank Thinking… state.

Execution-location popover crash

  • Keep the existing-worktree picker area fixed-height across loading/empty/loaded states.
  • This avoids the AppKit/SwiftUI NSPopover animated resize path that matched the crash stack.
  • Add an opt-in live UI smoke:
./conductor smoke --launch --execution-location-ui

Root cause

The custom backend configuration itself was valid. RepoPrompt passed the expected custom backend environment, but Claude Code also applied user global/local Claude settings, including model defaults in files such as ~/.claude/settings.json or project-local Claude config. Many users customize those settings for their normal Claude Code workflow. When those settings point at a different provider/model, they can override or conflict with RepoPrompt’s selected custom backend model, causing Claude Code to initialize with the user-configured model rather than the selected DeepSeek model.

--bare alone was not sufficient because Claude Code could still apply user settings env/model defaults. Adding --setting-sources project,local prevents user-level Claude settings from overriding RepoPrompt’s explicit custom backend launch environment.

The popover crash matched AppKit/SwiftUI popover layout/resize frames, including NSPopover _setContentView:size:canAnimate: and PopoverHostingView.updateAnimatedWindowSize. The popover content changed height when existing worktrees loaded asynchronously, so this removes that resize trigger.

Validation

  • make dev-format
  • make dev-lint
  • make dev-swift-build PRODUCT=RepoPrompt
  • make dev-test FILTER=ClaudeNativeIdentityPreambleTests
  • make dev-test FILTER=ClaudeNativeApprovalAndResumeTests
  • make dev-test FILTER=testClaudeControllerLaunchSettingsIdentityIgnoresLiveModelAndEffort
  • make dev-provider-test FILTER=ClaudeCompatibleRuntimeSupportTests
  • pytest Scripts/test_conductor_lifecycle.py -q
  • bash -n Scripts/smoke_agent_execution_location_popover.sh

Live validation:

  • A custom Claude-compatible backend configured with DeepSeek model mappings completed a smoke run successfully.
  • Raw event logging confirmed the spawned Claude Code args included --setting-sources project,local and the init model was the selected DeepSeek model, not the globally configured Claude settings model.

Review notes

This PR is split into three commits:

  1. fix(agent-mode): isolate Claude-compatible backend launches
  2. test(agent-mode): smoke execution-location popover
  3. fix(agent-mode): address custom backend review feedback

Reviewing commit-by-commit is recommended.

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