fix(cli): send managed-agents beta for session-scoped file operations#23
Open
arcaputo3 wants to merge 2 commits intoanthropics:mainfrom
Open
fix(cli): send managed-agents beta for session-scoped file operations#23arcaputo3 wants to merge 2 commits intoanthropics:mainfrom
arcaputo3 wants to merge 2 commits intoanthropics:mainfrom
Conversation
002b4d4 to
d732e5d
Compare
Session-scoped files (scope-id prefixed with "sesn_") require both the files-api and managed-agents beta headers. Without managed-agents, the API returns 404 for downloads and metadata lookups against session files. list — added when --scope-id starts with "sesn_" download / retrieve-metadata — added unconditionally, since these accept only a file ID and can't tell from flags whether the target is session- scoped. The header is harmless on non-session files.
550f260 to
3d29ae0
Compare
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
Session-scoped files (scope-id prefixed with
sesn_) created via the Managed Agents API require both thefiles-apiandmanaged-agents-2026-04-01beta headers. The CLI currently sends onlyfiles-api, so any attempt todownloadorretrieve-metadatafor a session-scoped file 404s.This PR adds the
managed-agents-2026-04-01header to file operations:beta files list— added when--scope-idstarts withsesn_beta files downloadandbeta files retrieve-metadata— added unconditionally, since these accept only a file ID and can't tell from flags whether the target is session-scoped. The header is harmless on non-session files.Background
This PR originally also bundled three other fixes (multipart
[]array format,--fileflag type for skill creation, multipart filename metadata). All three were independently fixed upstream by stainless-app[bot] in998599f,38ad709, and19772ca. Those changes have been dropped and the PR is now scoped to the one issue not covered by codegen.Test plan
anthropic-cli beta files download <sesn-file-id>succeeds against a session-scoped file (previously 404)anthropic-cli beta files retrieve-metadata <sesn-file-id>succeeds against a session-scoped file (previously 404)anthropic-cli beta files list --scope-id sesn_xxxreturns session files (previously empty/404)🤖 Generated with Claude Code