Pass attachment transfers (/api/oauth/files/*) through with the client's own credential (fixes silently dropped images)#83
Merged
MagicalTux merged 1 commit intoJul 7, 2026
Conversation
…t's own credential Images attached to a message for a teleoperated Claude Code session are uploaded to the backend under the user's claude.ai identity; the CLI then downloads them via GET /api/oauth/files/<uuid>/content using its own OAuth token. This path is not covered by the /v1/code/ passthrough (KarpelesLab#58), so the proxy rewrites Authorization to the rotated account's token, upstream responds 403, and Claude Code silently drops the image — the message arrives text-only, with no [Image #N] placeholder. Route /api/oauth/files/ and /api/oauth/file_upload through relayStream, same as the Remote Control channel. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
Closing until the fix is verified end-to-end on a live install — will reopen once confirmed. |
Contributor
Author
|
Verified end-to-end on a live install (3-account rotation): after routing /api/oauth/files/ through relayStream, an image attached from the desktop app arrived in the server-side session as a full base64 image block, and file attachments landed in ~/.claude/uploads//. Before the patch the same flow silently dropped every attachment. |
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.
Problem
An image attached to a message for a teleoperated Claude Code session (claude.ai / desktop app → session behind teamclaude) is silently lost: the message arrives as plain text, with no image block and not even an
[Image #N]placeholder.Cause
The attachment is uploaded to the backend under the user's claude.ai identity, and the CLI then downloads it with a separate request —
GET /api/oauth/files/<uuid>/content— using its own OAuth token. This path is not covered by the/v1/code/passthrough (#58): the proxy rewritesAuthorizationto the rotated account's token, upstream responds 403, and Claude Code silently drops the image (in the CLI code this is a buried skip with no error surfaced to the user).The same logic applies to
/api/oauth/file_upload.Fix
/api/oauth/files/and/api/oauth/file_uploadnow go throughrelayStreamwith the client's own credential — exactly like the Remote Control channel. The prefixes are extracted into a sharedCLIENT_CREDENTIAL_PATHSlist.Verification
Verified end-to-end on a live install (Contabo VPS, 3-account rotation): before the patch, attachments never reached server-side sessions (while sessions without the proxy received them fine). After the patch, an image attached from the desktop app arrived in the server-side session as a full base64 image block, and file attachments landed in
~/.claude/uploads/<session>/.🤖 Generated with Claude Code