Skip to content

TypeScript SDK tests: the approval_list fake should answer only the cursor it gave #867

Closed

Description

@LoopGlitch26

The pagination tests added in #855 (for #842) check that the OpenAI Agents and Vercel AI adapters read every page of approval_list. Their fake signer answers the second page for any cursor (sdk/typescript/test/adapters.test.mjs L642-644):

override: (f) => f.method === "approval_list" && (f.cursor
  ? { approvals: rest, next_cursor: null }
  : { approvals: [oldest], next_cursor: oldest.approval_id }),

So a client that sends back the wrong cursor still passes them. Checked on main (cac5efc): with approvalStates in sdk/typescript/src/v2/adapters/gate.ts (L42) changed to send cursor + "x", both "finds approvals on the second page" tests still pass.

What to do

  1. In the fake, answer the second page only when f.cursor === oldest.approval_id.
  2. For any other cursor, answer as the real signer does for a cursor it doesn't know: an empty last page, { approvals: [], next_cursor: null } (_approval_list in tracekit/signer/service.py, L3848-3865: the cursor loop runs off the end, so the page is empty; tests/test_signer_approvals.py L145 checks it).
  3. Leave the rest of both tests as they are.

Acceptance

  • Both pagination tests pass with main's gate.ts.
  • With L42 of gate.ts changed to send a different cursor, both fail. Say in the PR that you checked this.
  • make test-ts passes.

Commits need a DCO sign-off (git commit -s). Comment here before you start.

Activity

  1. DeviousCardi commented on Nov 15, 2026

    @DeviousCardi
    Contributor

    I'll take this.

  2. LoopGlitch26 commented on Nov 15, 2026

    @LoopGlitch26
    MemberAuthor

    It's yours, @DeviousCardi, thanks. The issue body has everything: the fake in sdk/typescript/test/adapters.test.mjs should answer the second page only for oldest.approval_id, and any other cursor gets an empty last page. In the PR, say that both tests fail with line 42 of gate.ts changed to send a different cursor. Sign off each commit with git commit -s.

  3. LoopGlitch26 commented on Nov 16, 2026

    @LoopGlitch26
    MemberAuthor

    Done in #875 by @DeviousCardi: the approval_list fake now answers only the cursor it gave. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions