Skip to content

fix(cli): send managed-agents beta for session-scoped file operations#23

Open
arcaputo3 wants to merge 2 commits intoanthropics:mainfrom
arcaputo3:arcaputo3/fix-managed-agents-cli-bugs
Open

fix(cli): send managed-agents beta for session-scoped file operations#23
arcaputo3 wants to merge 2 commits intoanthropics:mainfrom
arcaputo3:arcaputo3/fix-managed-agents-cli-bugs

Conversation

@arcaputo3
Copy link
Copy Markdown

@arcaputo3 arcaputo3 commented Apr 10, 2026

Summary

Session-scoped files (scope-id prefixed with sesn_) created via the Managed Agents API require both the files-api and managed-agents-2026-04-01 beta headers. The CLI currently sends only files-api, so any attempt to download or retrieve-metadata for a session-scoped file 404s.

This PR adds the managed-agents-2026-04-01 header to file operations:

  • beta files list — added when --scope-id starts with sesn_
  • beta files download and beta 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, --file flag type for skill creation, multipart filename metadata). All three were independently fixed upstream by stainless-app[bot] in 998599f, 38ad709, and 19772ca. 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_xxx returns session files (previously empty/404)
  • Non-session file operations continue to work unchanged

🤖 Generated with Claude Code

@arcaputo3 arcaputo3 requested a review from a team as a code owner April 10, 2026 16:13
@arcaputo3 arcaputo3 force-pushed the arcaputo3/fix-managed-agents-cli-bugs branch from 002b4d4 to d732e5d Compare April 10, 2026 16:28
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.
@arcaputo3 arcaputo3 force-pushed the arcaputo3/fix-managed-agents-cli-bugs branch from 550f260 to 3d29ae0 Compare April 28, 2026 14:36
@arcaputo3 arcaputo3 changed the title fix: session-scoped file operations and multipart array encoding fix(cli): send managed-agents beta for session-scoped file operations Apr 28, 2026
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.

1 participant