Skip to content

merge preexisting anthropic custom headers in managed settings + ucode ones - #442

Open
lilly-luo wants to merge 3 commits into
mainfrom
lilly-luo_data/stack/merge-anthropic-custom-headers
Open

merge preexisting anthropic custom headers in managed settings + ucode ones#442
lilly-luo wants to merge 3 commits into
mainfrom
lilly-luo_data/stack/merge-anthropic-custom-headers

Conversation

@lilly-luo

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

Copy link
Copy Markdown
Collaborator

Summary

When ucode writes its Anthropic custom headers to the managed config, it should preserve all the existing custom headers that were there previously EXCEPT the headers that need to be explicitly added by ucode.

currently, ucode blindly overwrites all anthropic custom headers with its own values.

In this PR, we:
1/ load up the custom headers previously present in the managed config
2/ put in the ucode headers. ucode header values take priority over what's existing in the managed config.
3/ the non-overlapping custom headers from the managed config remain present
4/ save those custom headers to managed settings.

Testing

  • uv run ruff check src/ucode/agents/claude.py tests/test_agent_claude.py

  • uv run pytest tests/test_agent_claude.py -q (127 passed)

  • manual testing
    started /etc/claude-code/managed-settings.json with:

"ANTHROPIC_CUSTOM_HEADERS": "x-databricks-use-coding-agent-mode: true\nUser-Agent: ucode/FAKEVERSION claude/2.1.258\nmeep: lala",

ran uv run ucode claude

after /etc/claude-code/managed-settings.json has:

"ANTHROPIC_CUSTOM_HEADERS": "x-databricks-use-coding-agent-mode: true\nUser-Agent: ucode/0.1.0+41.gd09c080 claude/2.1.258\nmeep: lala",

@lilly-luo
lilly-luo force-pushed the lilly-luo_data/stack/merge-anthropic-custom-headers branch 6 times, most recently from d2101a3 to e4b1037 Compare September 1, 2026 22:55
@lilly-luo
lilly-luo force-pushed the lilly-luo_data/stack/merge-anthropic-custom-headers branch 3 times, most recently from 83a8fca to 0c887b6 Compare September 1, 2026 23:21
@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 changed the title Merge user Anthropic custom headers merge preexisting anthropic custom headers in managed settings + ucode ones Sep 2, 2026
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.

2 participants