Skip to content

fix: avoid sudo after local ucode updates - #615

Open
larsmoan wants to merge 3 commits into
databricks:mainfrom
larsmoan:fix/managed-settings-stable-user-agent
Open

larsmoan wants to merge 3 commits into
databricks:mainfrom
larsmoan:fix/managed-settings-stable-user-agent

Conversation

@larsmoan

Copy link
Copy Markdown

Build metadata in Claude's managed User-Agent changed after every local ucode update, which made each launch rewrite root-owned settings and request sudo.

Use the stable release version in the managed header so local build changes do not rewrite the file.

Copilot AI lite review requested due to automatic review settings September 14, 2026 19:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Claude end-to-end expectation still uses the raw version and must be updated.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Stabilizes Claude’s managed User-Agent by omitting local build metadata, preventing unnecessary settings rewrites.

Changes:

  • Use the stable release version in Claude headers.
  • Add regression coverage for local build versions.
File summaries
File Summary
tests/test_agent_claude.py Tests omission of local build metadata.
src/ucode/agents/claude.py Uses the stable version in managed headers.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/ucode/agents/claude.py Outdated
header_lines = [
"x-databricks-use-coding-agent-mode: true",
f"User-Agent: ucode/{ucode_version()} claude/{agent_version('claude')}",
f"User-Agent: ucode/{ucode_version().split('+', 1)[0]} claude/{agent_version('claude')}",
@larsmoan

Copy link
Copy Markdown
Author

Addressed the review finding. Claude uses the shared release-version formatter, and the end-to-end header expectation applies the same rule.

Copilot AI review requested due to automatic review settings September 14, 2026 19:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Update the Claude integration test to verify stripping local build metadata.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread tests/test_agent_claude.py Outdated
Comment on lines +460 to +461
monkeypatch.setattr(claude, "ucode_release_version", lambda: "0.1.0")
monkeypatch.setattr(claude, "agent_version", lambda binary: "2.1.136")
Copilot AI review requested due to automatic review settings September 15, 2026 11:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The E2E Claude User-Agent expectation must be aligned with the production header format.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +129 to +130
version = ucode_release_version() if agent_name == "claude" else ucode_version()
return f"ucode/{version} {agent_name}/{agent_version(binary)}"
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