Skip to content

[STALE: REBASE FROM NEW FORK] AgentRadar account pin admits Copilot, Cursor and Devin sign-ins (.22) - #20

Open
vadymhimself wants to merge 1 commit into
core-be-r4b/xai-apikey-2278from
core-be-r4b/pin-signin-providers-2323
Open

vadymhimself wants to merge 1 commit into
core-be-r4b/xai-apikey-2278from
core-be-r4b/pin-signin-providers-2323

Conversation

@vadymhimself

Copy link
Copy Markdown
Collaborator

AgentRadar AGE-2323 (Vadym 21431, "Let them in too"): hosted sign-ins for GitHub Copilot, Cursor and Devin. Stacked on #19 (.21); release tag .22.

What changes

Every hosted AgentRadar turn carries an account pin. The gateway accepted only claude, codex, grok and kimi pins, so a Copilot, Cursor or Devin sign-in could never serve a pinned turn.

  • AGENTRADAR_PIN_PROVIDERS in src/server/responses/core-options.ts maps each AgentRadar sign-in name to the OCX OAuth provider it may serve: claude -> anthropic, grok -> xai, kimi -> kimi, copilot -> github-copilot, cursor -> cursor, devin -> devin. Codex keeps its own pool path.
  • The header parser and the route check in request-prepare.ts both read that table.
  • The check is unchanged otherwise: only an oauth candidate of exactly the pinned provider serves the pin. A pin never reaches another provider's account and never reaches an API key (the no-hijack rule from [STALE: REBASE FROM NEW FORK] feat(providers): xAI by API key as its own provider; keys never take the sign-ins' traffic (.21) #19).

Tests

tests/server/agentradar-account-pin-e2e.test.ts:

  • github-copilot with two accounts: a copilot pin on the non-active account serves with that account's token (Bearer tcA), and the active account stays cB.
  • A copilot pin on a kimi route is refused (404) before any inference.
  • Copilot, Cursor and Devin pins join the cross-provider refusal loop.

Lane run (typecheck plus the pin e2e): TSC=0, 3 pass, 0 fail.

Not in this PR

This PR adds no provider login, no model list and no adapter change. The Copilot, Cursor and Devin bridges are already in the fork; they are labelled experimental or unofficial there, and that label is with the AgentRadar lead before any of them is offered to customers.

🤖 Generated with Claude Code

…vin sign-ins (.22)

AgentRadar AGE-2323 (Vadym 21431, "Let them in too") adds hosted sign-ins for GitHub Copilot, Cursor and Devin next to Claude, ChatGPT, Grok and Kimi. Every hosted turn carries the x-agentradar-account-pin header, and the gateway refused any pin provider other than claude, codex, grok or kimi, so a signed-in Copilot, Cursor or Devin account could never serve a pinned turn.

The pin's provider names now come from one table, AGENTRADAR_PIN_PROVIDERS, which maps each AgentRadar sign-in name to the OCX OAuth provider whose stored account it may serve (copilot -> github-copilot, cursor -> cursor, devin -> devin). The header parser and the route check in prepareResponsesRequest both read it, so they cannot drift. Codex keeps its own pool path. The check is otherwise unchanged: only an oauth candidate of exactly that provider serves the pin, so a pin never reaches another provider's account or an API key.

Tests: tests/server/agentradar-account-pin-e2e.test.ts adds a github-copilot provider with two accounts. A copilot pin on the second-listed account serves with that account's token while the active account stays the other one, and a copilot pin on a kimi route is refused before any inference. Copilot, Cursor and Devin pins all join the cross-provider refusal loop.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Nov 13, 2026
@vadymhimself vadymhimself changed the title AgentRadar account pin admits Copilot, Cursor and Devin sign-ins (.22) [STALE: REBASE FROM NEW FORK] AgentRadar account pin admits Copilot, Cursor and Devin sign-ins (.22) Nov 18, 2026
@vadymhimself

Copy link
Copy Markdown
Collaborator Author

This PR is based on the superseded 2.65 gateway line. Rebuild the change from port/ar-on-upstream-2026-11-18 (upstream-derived 2.100 AR overlay, PR #46): #46 . Do not rebase onto or merge the old release line. Preserve the new gateway quota/cache gate and re-run the affected regressions. The candidate is not deployed; do not publish or replace a running gateway without explicit approval.

@vadymhimself

Copy link
Copy Markdown
Collaborator Author

main is now the stable upstream-derived AgentRadar gateway line: 2.100.0-vadymhimself.2, merged via #47 (merge commit ad594a0778). Its tree is identical to the tested candidate 6a14467972, and it shares history with upstream lidge-jun/opencodex dev at 6bae884cbc.

Trial evidence: before the merge the build ran 30.5 h on the laptop gateway and 24 h on the personal Mac Mini gateway, both with OPENCODEX_AGENTRADAR=1. Neither restarted and neither left unresolved spend. The Mini served 11,138 requests with 2 5xx; the old build had 303 502s over the prior day. The remaining non-2xx were exhausted provider quota, not gateway faults. The fork's GitHub Actions has not run since Nov 18, so there is no CI result. Run checks locally.

For new work:

  • Branch from main. Do not target release/2.65.0-vadymhimself.*.
  • Check FORK-DELTA.md first; many old-line fixes are already carried or upstream-equivalent.
  • If a behavior is still missing, re-cut it as a small, single-concern change on main.

Before opening a PR, use pinned Bun 1.4.4 with an isolated HOME/OPENCODEX_HOME, synthetic credentials and loopback providers (never live accounts):

  • bun run test:gateway-quota (29-file AR gateway gate)
  • affected suites: bun scripts/test.ts --changed=main
  • bun run typecheck, bun run structure:check, bun run privacy:scan, git diff --check

Hosted-only behavior needs OPENCODEX_AGENTRADAR=1 set inside the test; without it the branch behaves like upstream. Register new test files in scripts/test-layout/layout-agentradar.json.

For this PR: the pin provider allowlist on main is claude/codex/grok/kimi (src/lib/agentradar-account-pin.ts). Re-cut by extending that allowlist, with E2E coverage in tests/server/agentradar-account-pin-e2e.test.ts.

🤖 Generated with Claude Code

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

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant