fix(claude): use run token for ccrotate auth - #449
Merged
Conversation
Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
Hey @kkroo! Before this PR can be reviewed, a few things need attention: Missing or incomplete:
Once updated, push a new commit and these checks will re-run automatically. — commitperclip |
13 tasks
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.
Thinking Path
Linked Issues or Issue Description
What happened?
Claude k8s agents using
ANTHROPIC_BASE_URL=https://paperclip.blockcast.net/ccrotatecan fail immediately withAPI Error: 401 {"error":"missing or malformed bearer token"}. A live Ally run showed zero model usage and validPAPERCLIP_API_KEY, whileANTHROPIC_AUTH_TOKEN/ANTHROPIC_API_KEYwere inherited 64-byte process credentials that ccrotate rejects.Expected behavior
When Paperclip launches Claude against a ccrotate Anthropic base URL, the Claude process should authenticate to ccrotate with the short-lived Paperclip run JWT already injected as
PAPERCLIP_API_KEY, unless the agent explicitly configured Anthropic auth env vars.Steps to reproduce
ANTHROPIC_BASE_URLpointing at the Paperclip ccrotate endpoint and no explicitANTHROPIC_AUTH_TOKEN/ANTHROPIC_API_KEYin the agent adapter config.401 {"error":"missing or malformed bearer token"}from ccrotate.Paperclip version or commit
Reproduced on deployed commit
7d628ce48e7e722349e7908e858e304787292eae.Deployment mode
Self-hosted Kubernetes server using the Claude local/k8s adapter.
What Changed
ANTHROPIC_AUTH_TOKENandANTHROPIC_API_KEYfor ccrotate calls unless the agent explicitly configured those env keys.Verification
pnpm exec vitest run packages/adapters/claude-local/src/server/execute.remote.test.tspnpm --filter @paperclipai/adapter-claude-local typecheckRisks
Low risk. The change is scoped to Claude adapter env construction and only activates when
ANTHROPIC_BASE_URLlooks like ccrotate andPAPERCLIP_API_KEYexists. Explicit agent-provided Anthropic auth remains preserved.Model Used
OpenAI GPT-5 via Codex coding agent, with shell, Kubernetes, and GitHub tool use.
Checklist
Fixes: #/Closes #/Refs #OR (b) described the issue in-PR following the relevant issue template