Skip to content

Preserve existing managed Claude model defaults - #444

Open
lilly-luo wants to merge 12 commits into
mainfrom
lilly-luo_data/stack/preserve-managed-claude-model-defaults
Open

Preserve existing managed Claude model defaults#444
lilly-luo wants to merge 12 commits into
mainfrom
lilly-luo_data/stack/preserve-managed-claude-model-defaults

Conversation

@lilly-luo

@lilly-luo lilly-luo commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Currently, we override managed settings with ucode model family defaults in Claude Code. Instead, the hierarchy should be:
1/ coding agent config model family default (highest pri)
2/ existing model family default in the managed setting file
3/ ucode default (lowest pri)

this PR forces that hierarchy. for fable: if fable is enabled, we follow the same hierarchy above. if fable is not enabled, drop fable from the managed config settings.

Stack

Testing

  • pytest tests/test_agent_claude.py tests/test_managed_resolve.py -q (196 passed)

  • Ruff checks passed for all changed files

  • manual testing - no coding agent config
    start with the following in my /etc/claude-code/managed-settings.json (no coding agent config)

    "ANTHROPIC_DEFAULT_OPUS_MODEL": "system.ai.claude-opus-5[1m]",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "system.ai.claude-sonnet-4-6[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "system.ai.claude-haiku-5",

run uv run ucode claude --refresh (confirmed ucode claude --refresh resets my sonnet to sonnet 5)

confirming the models are preserved (desired behavior, sonnet not reset to sonnet 5):

    "ANTHROPIC_DEFAULT_OPUS_MODEL": "system.ai.claude-opus-5[1m]",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "system.ai.claude-sonnet-4-6[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "system.ai.claude-haiku-5",
  • manual testing - coding agent config
    1/ set sonnet 5 as my coding agent config sonnet version
    2/ updated my /etc/claude-code/managed-settings.json to have sonnet-4-6
    3/ confirmed my ANTHROPIC_DEFAULT_SONNET_MODEL gets overwritten to sonnet 5

  • manual testing of fable
    fable NOT enabled, coding agent config has fable -> should not have fable in the managed settings
    fable NOT enabled, existing fable model in managed settings -> should not have fable in the managed settings
    fable NOT enabled, no fable model in managed settings -> should not have fable in the managed settings
    fable enabled, coding agent config has fable -> should have coding agent config's fable version
    fable enabled, existing fable model in managed settings -> should have preexisting fable version
    fable enabled, no fable model in managed settings -> should have ucode's default fable version

@lilly-luo
lilly-luo force-pushed the lilly-luo_data/stack/merge-anthropic-custom-headers branch from 0c887b6 to ff95258 Compare September 2, 2026 00:56
@lilly-luo
lilly-luo force-pushed the lilly-luo_data/stack/preserve-managed-claude-model-defaults branch 3 times, most recently from 76f46a2 to 3e2a13c Compare September 2, 2026 01:10
@lilly-luo
lilly-luo force-pushed the lilly-luo_data/stack/preserve-managed-claude-model-defaults branch from 3e2a13c to cd039a4 Compare September 2, 2026 01:17
Base automatically changed from lilly-luo_data/stack/merge-anthropic-custom-headers to main September 2, 2026 13:14
@lilly-luo
lilly-luo force-pushed the lilly-luo_data/stack/preserve-managed-claude-model-defaults branch from c401b5f to 320ec64 Compare September 2, 2026 13:32
@lilly-luo
lilly-luo force-pushed the lilly-luo_data/stack/preserve-managed-claude-model-defaults branch from 320ec64 to 915e1f0 Compare September 2, 2026 13:36
@lilly-luo
lilly-luo force-pushed the lilly-luo_data/stack/preserve-managed-claude-model-defaults branch from 020e2eb to fe612cb Compare September 2, 2026 14:07
@lilly-luo
lilly-luo force-pushed the lilly-luo_data/stack/preserve-managed-claude-model-defaults branch 5 times, most recently from c9fd93f to 6ea5486 Compare September 2, 2026 14:50
@lilly-luo
lilly-luo removed the request for review from david-siqi-liu September 2, 2026 14:58
@lilly-luo
lilly-luo force-pushed the lilly-luo_data/stack/preserve-managed-claude-model-defaults branch from 6ea5486 to 60a5a1a Compare September 2, 2026 15:43
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