merge preexisting anthropic custom headers in managed settings + ucode ones - #442
Merged
lilly-luo merged 4 commits intoSep 2, 2026
Merged
Conversation
lilly-luo
force-pushed
the
lilly-luo_data/stack/merge-anthropic-custom-headers
branch
6 times, most recently
from
September 1, 2026 22:55
d2101a3 to
e4b1037
Compare
lilly-luo
force-pushed
the
lilly-luo_data/stack/merge-anthropic-custom-headers
branch
3 times, most recently
from
September 1, 2026 23:21
83a8fca to
0c887b6
Compare
3 tasks
lilly-luo
force-pushed
the
lilly-luo_data/stack/merge-anthropic-custom-headers
branch
from
September 2, 2026 00:56
0c887b6 to
ff95258
Compare
andy-xu-db
approved these changes
Sep 2, 2026
lilly-luo
enabled auto-merge (squash)
September 2, 2026 13:08
lilly-luo
disabled auto-merge
September 2, 2026 13:14
lilly-luo
deleted the
lilly-luo_data/stack/merge-anthropic-custom-headers
branch
September 2, 2026 13:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pyuv run pytest tests/test_agent_claude.py -q(127 passed)manual testing
started /etc/claude-code/managed-settings.json with:
ran
uv run ucode claudeafter /etc/claude-code/managed-settings.json has: