Repository navigation
fix(cursor): discover account Agent endpoint - #10804
Merged
diegosouzapw merged 2 commits intoAug 21, 2026
Merged
diegosouzapw merged 2 commits into
diegosouzapw merged 2 commits into
Conversation
Cursor assigns Agent RPC hosts through ServerConfigService. Resolve and cache both privacy endpoints per connection and token, then select the endpoint that matches ghost mode. Validate discovered hosts before sending credentials and preserve upstream status errors. Refs diegosouzapw#10802
xiaoyaner0201
added a commit
to xiaoyaner0201/OmniRoute
that referenced
this pull request
Aug 21, 2026
…fd4040) Additive two-parent merge onto the current live head, which advanced again during O5/R6 from b87056a to 6fd4040 (five commits: diegosouzapw#10830 Grok Build custom host, diegosouzapw#10854 skills marketplace API-key installs, diegosouzapw#10804 Cursor account Agent endpoint, diegosouzapw#10531 freebuff translate-path golden regen, diegosouzapw#10805 SSE silent-close truncation). Zero file overlap with this PR's 34-file diff; the merge is conflict-free and introduces no adaptation of either side. No force, rebase, amend, or squash.
backryun
added a commit
to backryun/OmniRoute
that referenced
this pull request
Aug 21, 2026
diegosouzapw#10804 (fa0cd5a) moved agent-endpoint discovery (a live api2.cursor.sh GetServerConfig call) ahead of request building inside CursorExecutor.execute. The two executor-level image-validation tests use a fake access token, so discovery now fails with a real 401 before image validation ever runs — the tests saw 401/500 instead of the sanitized 400 they assert. Stub globalThis.fetch for the ServerConfigService call with a minimal valid protobuf response (field-27 submessage, varint-encoded tag, *.api5.cursor.sh hosts accepted by validateCursorAgentUrl). Image validation itself is untouched and still exercised end-to-end. 28/28 green.
backryun
added a commit
to backryun/OmniRoute
that referenced
this pull request
Aug 21, 2026
diegosouzapw#10804 (fa0cd5a) moved agent-endpoint discovery (a live api2.cursor.sh GetServerConfig call) ahead of request building inside CursorExecutor.execute. The two executor-level image-validation tests use a fake access token, so discovery now fails with a real 401 before image validation ever runs — the tests saw 401/500 instead of the sanitized 400 they assert. Stub globalThis.fetch for the ServerConfigService call with a minimal valid protobuf response (field-27 submessage, varint-encoded tag, *.api5.cursor.sh hosts accepted by validateCursorAgentUrl). Image validation itself is untouched and still exercised end-to-end. 28/28 green.
backryun
added a commit
to backryun/OmniRoute
that referenced
this pull request
Aug 21, 2026
diegosouzapw#10804 (fa0cd5a) moved agent-endpoint discovery (a live api2.cursor.sh GetServerConfig call) ahead of request building inside CursorExecutor.execute. The two executor-level image-validation tests use a fake access token, so discovery now fails with a real 401 before image validation ever runs — the tests saw 401/500 instead of the sanitized 400 they assert. Stub globalThis.fetch for the ServerConfigService call with a minimal valid protobuf response (field-27 submessage, varint-encoded tag, *.api5.cursor.sh hosts accepted by validateCursorAgentUrl). Image validation itself is untouched and still exercised end-to-end. 28/28 green.
backryun
added a commit
to backryun/OmniRoute
that referenced
this pull request
Aug 22, 2026
diegosouzapw#10804 (fa0cd5a) moved agent-endpoint discovery (a live api2.cursor.sh GetServerConfig call) ahead of request building inside CursorExecutor.execute. The two executor-level image-validation tests use a fake access token, so discovery now fails with a real 401 before image validation ever runs — the tests saw 401/500 instead of the sanitized 400 they assert. Stub globalThis.fetch for the ServerConfigService call with a minimal valid protobuf response (field-27 submessage, varint-encoded tag, *.api5.cursor.sh hosts accepted by validateCursorAgentUrl). Image validation itself is untouched and still exercised end-to-end. 28/28 green.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
Requests AgentUrlConfig from Cursor with each selected account token and selects the account's actual server-assigned Agent endpoint (agentUrl/agentnUrl) instead of a fixed global/us host, which fails for teams pinned to a different region. Caches validated endpoints by connection+token. Closes diegosouzapw#10802. Validated in an isolated worktree boarded onto origin/release/v3.8.50 (0 conflicts, 4 files): - 18/18 focused tests pass (cursor-agent-host, cursor-apikey-provider). - provider-translate-path-golden.test.ts initially failed — traced to a pre-existing base-red (stale golden snapshot left by an earlier freebuff merge, diegosouzapw#10531, unrelated to this PR) and confirmed it reproduces on the pure release tip without this PR's changes. Fixed directly on release/v3.8.50 (mechanical key-ordering regen, values unchanged) rather than folding it into this PR's scope; green after merging that fix in. - check-file-size, check-changelog-integrity: OK. - typecheck:core: clean. - check-complexity / check-cognitive-complexity: OK, both under baseline. - Author additionally validated live: a real Cursor request selected agentn.us.api5.cursor.sh and returned HTTP 200/PING. Co-authored-by: tuandinh0801 <tuandinh0801@users.noreply.github.com>
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.
Summary
AgentUrlConfigfrom Cursor with each selected account token.agentUrloragentnUrlfrom the account server config.Related Issues
Validation
node --import tsx/esm --test tests/unit/cursor-agent-host.test.tsnode --import tsx/esm --test tests/unit/provider-translate-path-golden.test.tsnpm run check:provider-consistencynpm run check:provider-assetsnpm run typecheck:corenpm run lintrelease/v3.8.50at3d7ed7aa8agentn.us.api5.cursor.shand returned HTTP 200 withPINGTests Added Or Updated
tests/unit/cursor-agent-host.test.tsCoverage Notes
The unit test covers regional endpoint selection, privacy-mode selection, token rotation, cache reuse, and untrusted-host rejection.
Reviewer Notes
Cursor controls endpoint assignment through
ServerConfigService.GetServerConfig. Fixedglobalorushosts can fail for other teams. No migration or feature flag applies.