Skip to content

Blank Claude Code provider switches on the self-configured path too - #1806

Draft
JTSIV1 wants to merge 1 commit into
mainfrom
jtsiv1/self-configured-provider-flags
Draft

JTSIV1 wants to merge 1 commit into
mainfrom
jtsiv1/self-configured-provider-flags

Conversation

@JTSIV1

@JTSIV1 JTSIV1 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • A stale CLAUDE_CODE_USE_BEDROCK/CLAUDE_CODE_USE_VERTEX in a developer's shell or user settings routes Claude Code around Unity Gateway and fails against the provider (e.g. a Bedrock 400 for an invalid model id). Published workspace configs already blank both switches in the managed settings.
  • Move the two blanks into the shared Claude env builder, so the self-configured path gets them too: in ug configure's managed file, in ucode-settings.json (including UG_SKIP_OS_SETTINGS/--user runs and relayed launches), and through the published path unchanged. In the managed file the blanks settle like the credential blanks: an explicit ug configure writes them, plain launches keep the file as found, and a value someone else set is kept with a warning.

Testing

  • uv run pytest tests/test_claude_credential_blanks.py tests/test_ownership.py tests/test_published_agent_config.py (126 passed) — extended to assert both blank flags in the overlay, both files, skip mode, relayed launches, and revert
  • uv run pytest tests/test_agent_claude.py tests/test_published_agent_config.py tests/test_claude_header_mod.py tests/test_managed_files.py tests/test_configure_managed_writes.py tests/test_managed_config.py tests/test_managed_resolve.py
  • uv run pytest tests/ (full unit suite, minus two env-gated otel metrics files: 9225 passed; 12 failures and the skips reproduce on unmodified main in this environment)
  • ruff check + ruff format --check + ty on the changed files
  • arclet E2E (Claude Code 2.1.325, isolated HOME, CLAUDE_CODE_USE_BEDROCK=1 in user settings unless noted)
    • main 39101a2, plain ug configure --global: no provider switches in the managed file, and claude -p fails with the Bedrock 400
    • this branch: both blanks in the managed file; claude -p reaches Unity Gateway, and so do ug claude, the switch set in the shell instead, and CLAUDE_CODE_USE_VERTEX=1 in user settings
    • ug revert restores the original managed file byte for byte
    • published agent config: still writes both blanks, and claude -p reaches Unity Gateway
    • managed file that already sets CLAUDE_CODE_USE_BEDROCK=1: plain ug configure keeps it and warns (still the Bedrock 400); a published config replaces it

This pull request and its description were written by Isaac.

`ug configure` already writes `CLAUDE_CODE_USE_BEDROCK`/`CLAUDE_CODE_USE_VERTEX`
blank into the managed settings when a workspace publishes an agent
configuration. Move the two blanks into the shared Claude env builder so the
self-configured path (managed file and ucode-settings.json) gets them too,
keeping a stale provider switch in the shell or user settings from routing
around the gateway. The managed file settles them like the credential blanks:
added by an explicit `ug configure`, preserved as found by plain launches, and
a value someone else set is kept with a warning.

Co-authored-by: Isaac <no-reply@databricks.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