You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeScript SDK tests: the approval_list fake should answer only the cursor it gave #867
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):
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
In the fake, answer the second page only when f.cursor === oldest.approval_id.
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).
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.
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.
Activity
DeviousCardi commentedon Nov 15, 2026
I'll take this.
LoopGlitch26 commentedon Nov 15, 2026
It's yours, @DeviousCardi, thanks. The issue body has everything: the fake in
sdk/typescript/test/adapters.test.mjsshould answer the second page only foroldest.approval_id, and any other cursor gets an empty last page. In the PR, say that both tests fail with line 42 ofgate.tschanged to send a different cursor. Sign off each commit withgit commit -s.test(ts): make the approval_list fake answer only its own cursor (#867)…
LoopGlitch26 commentedon Nov 16, 2026
Done in #875 by @DeviousCardi: the approval_list fake now answers only the cursor it gave. Closing.