Skip to content

Pass attachment transfers (/api/oauth/files/*) through with the client's own credential (fixes silently dropped images)#83

Merged
MagicalTux merged 1 commit into
KarpelesLab:masterfrom
iamapfelbaum:attachment-files-passthrough
Jul 7, 2026
Merged

Pass attachment transfers (/api/oauth/files/*) through with the client's own credential (fixes silently dropped images)#83
MagicalTux merged 1 commit into
KarpelesLab:masterfrom
iamapfelbaum:attachment-files-passthrough

Conversation

@iamapfelbaum

@iamapfelbaum iamapfelbaum commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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 rewrites Authorization to 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_upload now go through relayStream with the client's own credential — exactly like the Remote Control channel. The prefixes are extracted into a shared CLIENT_CREDENTIAL_PATHS list.

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

…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>
@iamapfelbaum

Copy link
Copy Markdown
Contributor Author

Closing until the fix is verified end-to-end on a live install — will reopen once confirmed.

@iamapfelbaum

Copy link
Copy Markdown
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.

@iamapfelbaum iamapfelbaum reopened this Jul 6, 2026
@MagicalTux MagicalTux merged commit d723417 into KarpelesLab:master Jul 7, 2026
10 checks passed
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.

3 participants