Repository navigation
Conversation
This was referenced Oct 26, 2026
This was referenced Oct 26, 2026
kartojal
marked this pull request as ready for review
October 26, 2026 15:56
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 976b162. Configure here.
kartojal
force-pushed
the
feat/authenticated-service-client
branch
from
November 2, 2026 14:23
2d90d4f to
138f861
Compare
kartojal
force-pushed
the
feat/authenticated-service-client
branch
from
November 3, 2026 17:52
138f861 to
95f44ce
Compare
kartojal
force-pushed
the
feat/authenticated-service-client
branch
from
November 6, 2026 09:36
95f44ce to
1325104
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds the callback-owned AuthenticatedServiceClient transport on top of the current #442 retry policy. Authentication headers are resolved per attempt; 401 recovery can replay once, excluding authentication endpoints. The transport owns no credentials and preserves serialized bodies, cancellation and per-attempt timeouts.
Workflow GET requests retain their non-retrying transport policy. Restacked the final four-file transport change onto latest #442 instead of replaying superseded intermediate implementations. Bearer credential and session policy remain in #437.
Stack: #442 → #481 → #437 → #463 → #438 → #441.
Restacked on 2026-11-02 with the current retry/transport ancestry and #463 Gateway routing corrections. Existing plain bearer credentials, automatic migration and signer-only restoration are retained.
Combined stack validation on 2026-11-02: build, lint, workspace typecheck, browser bundle check, 415 bindings tests and 1,141 client tests passed (1,556 total, no type errors). No live authentication or financial operations were performed.
Gateway heartbeat compatibility remains blocked as documented in #463. Human approval and outstanding review threads have not been resolved automatically.
Note
Medium Risk
Touches core HTTP/auth transport (401 handling, refresh, replay, timeouts); wrong edge-case behavior could affect sessions or duplicate sensitive calls, though scope is a new experimental class with dedicated tests.
Overview
Introduces
AuthenticatedServiceClient, an experimental transport that never stores credentials: callers supplyresolveHeadersandrefreshToken, and the client runs up to two HTTP attempts—after a 401 it may callrefreshTokenonce and replay the same URL, body, and query string (with headers re-resolved), but/v1/auth/*does not get that recovery loop.Timeout and cancellation: per-request HTTP timeouts apply only to actual fetch attempts, not to header resolution or refresh; abort cancels stalled callbacks without a late replay.
Retries: existing
get/postReadread-retry behavior is preserved;getWorkflowpaths like/commandand/v1/auth/sessionstill do not use read retries; timeouts do not consume the read retry budget.Also adds a minor changeset for
@polymarket/clientand Vitest coverage for the behaviors above (including raw JSON body preservation and non-recursive refresh).packages/client/src/index.tsre-exports the new client and config types (type-only, consistent withServiceClient).Reviewed by Cursor Bugbot for commit 1325104. Bugbot is set up for automated code reviews on this repo. Configure here.