Skip to content

fix: reject unknown Anthropic model cursors and document auth changes - #551

Open
tylerslaton wants to merge 2 commits into
mainfrom
tyler/fix-anthropic-model-cursors
Open

tylerslaton wants to merge 2 commits into
mainfrom
tyler/fix-anthropic-model-cursors

Conversation

@tylerslaton

@tylerslaton tylerslaton commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Unknown after_id and before_id values returned successful empty Anthropic model pages. Authentication docs missed the new native error-body migration details. The CI drift rule also required the old cursor behavior and rejected the corrected response.

Why

SDK callers need an error for an invalid cursor. Apps reading the old string error.code need to know that Anthropic omits it and Gemini/Vertex return numeric 401. CI must check the new response while retaining its known missing-request-ID warning and the historical base comparison.

Fix

Reject unknown Anthropic cursors with HTTP 400, including with lifecycle filters. Keep valid paging and empty filtered pages working. Update README, changelog, provider docs, cursor tests and the drift grading rule. Header enforcement stays opt-in.

The grading rule requires the exact status, error type, message and single known warning. It accepts the old empty-page policy only for cached base evidence. Regression tests mutate receipts, assertions and diffs to verify the gate still rejects mismatches. A saved actual CI receipt replay passes with 11 advisories and no blocks; this does not claim full response-body parity or fresh authenticated calls.

Validation: format, lint, typecheck, all 428 test files (17,456 passed; 11 existing skips), build, package exports, all 14 unchanged API reports, and actionlint with ShellCheck passed. The earlier free-RAM test failure passed unchanged. Separate Node/Bun consumers passed 48 cursor checks each plus the original 38 each.

Stacked above #542 using GitHub's native stack #552. The provider compatibility follow-up is #553, based on this PR. Merge only after required checks pass, in stack order.

@tylerslaton
tylerslaton added this pull request to stack #552 October 17, 2026 20:43
@pkg-pr-new

pkg-pr-new Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@copilotkit/aimock@551

commit: c4f03b5

@contextablemark contextablemark left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 7a27660. The cursor fix and drift-gate changes are correct and adequately covered; no blocking findings.

Residual limitation: Anthropic catalog errors still omit the upstream body request_id. The gate explicitly constrains this known warning, so the change establishes status, error-type, and message parity rather than full response-body parity.

Base automatically changed from blitz/response-consolidation/final-history to main October 18, 2026 02:20
@tylerslaton
tylerslaton dismissed contextablemark’s stale review October 18, 2026 02:20

The merge-base changed after approval.

The drift gate still required empty cursor pages after the server fix
returned native 400 errors. Require 400 errors at head and allow old
empty pages only in cached base evidence.

Bind the known request_id warning, reject other evidence changes, and
test the actual workflow CLI.
@tylerslaton
tylerslaton force-pushed the tyler/fix-anthropic-model-cursors branch from 7a27660 to c4f03b5 Compare October 18, 2026 02:20

This branch has not been deployed

No deployments
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.

2 participants