Skip to content

Anthropic Files listing: upstream replaced the ID cursors with an opaque page token #206

Description

@JGoutin

The vendor lane (--use-official-api) caught this during the 1.17 gate: Anthropic's Files listing no longer speaks the cursor scheme the gateway serves.

What upstream does now

GET /v1/files returns data and next_page, an opaque token. It no longer returns first_id, last_id or has_more, and the SDK (anthropic 1.0.0, 2026-08-20) takes a page parameter instead of after_id / before_id.

The change is visible in anthropic.pagination.SyncPageCursor, which declares exactly data and next_page; the three fields the gateway sends arrive only as model_extra, and against the official API they are absent altogether.

What the gateway does

stdapi/files/_core.py still serves the ID-cursor envelope: first_id, last_id, has_more, and after_id / before_id as query parameters. That is what its own clients were written against, and it keeps working — but it is now a divergence from upstream rather than a match.

Marked, not hidden

Three tests in tests/test_anthropic_files.py record the split rather than papering over it:

  • test_anthropic_list_after_id and test_anthropic_list_before_id carry @pytest.mark.gateway(...), so they no longer claim upstream parity.
  • test_list_files stops before the edge-ID assertions on the official lane.

Decide

Whether to adopt page / next_page — as a replacement, or alongside the ID cursors for the clients already using them — is a compatibility decision, not a bug fix, so it is deliberately not in 1.17.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions