Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Cursor SDK sessions ignore the CLI active team and bill another team on the same login #16840

Closedpedrobarco(GitHub profile, opens in a new tab) opened this issue 1 comment

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

One Cursor login belongs to two teams. agent team list --format json marks one of them isActive: true and isExplicitSelection: true. Cursor CLI 2026.09.28 and the Cursor IDE bill that team. T3, using the same login, bills the other team.

  1. agent team switch writes authInfo.activeTeamId, authInfo.teamId, and authInfo.teamName in ~/.cursor/cli-config.json. getEffectiveTeamId in src/shared/effective-team.ts returns authInfo.activeTeamId when cursor-config accepts it as a positive integer, and otherwise falls back to authInfo.teamId. Status calls getMe with that id. Agent requests set the header x-cursor-team-id from the same value (cursor-config/dist/request.js).
  2. Start a T3 Cursor thread on that same login. T3 0.0.46-nightly.20261005.2667 talks to Cursor through @cursor/sdk (cursor-agent-sdk.local). An untouched composer sends only {"id":"grok-4.7","params":[{"id":"fast","value":"false"}]}.
  3. Compare the Cursor usage dashboard (UTC) for the CLI/IDE team with the team that received the T3 rows. Match T3 run start times to the dashboard clock.

Expected behavior

Every Cursor SDK session this provider opens, including text generation, bills the CLI active team. With authInfo.activeTeamId set, usage lands on that team. When activeTeamId is absent, the SDK call follows the CLI fallback (authInfo.teamId).

Actual behavior

T3's Cursor provider does not send a team id. Usage from the same login shows on the other team.

The T3 rows are grok-4.7-high and line up with one T3 thread's run start times. A later T3 thread billed both grok-4.7-high and composer-2.5 to that same other team. composer-2.5 is T3's textGenerationModelSelection, so this is every Cursor SDK call, not one model.

The active team's grok-4.7-medium rows are a different client (CLI or IDE), not those T3 threads. The IDE cache's selected team matches the CLI active team.

agent team can only list and switch. Switching the active team updates the CLI and IDE. Logging out is not a fix: there is one login, so signing out drops both teams.

Where the team id is dropped:

  • The SDK credential (Cursor.auth / keychain) stores an API key and email. It has no team id.
  • This repo has no activeTeamId references. teamId is also absent under apps/server.
  • CursorDriver.ts only passes CURSOR_API_KEY into the SDK (apiKey on open).
  • CursorTextGeneration.ts calls Agent.create with apiKey, model, and local options, and no team.
  • CursorAgentSdk.ts forwards AgentOptions to Agent.create / Agent.resume.

@cursor/sdk 1.0.35 (the pin in apps/server/package.json) and the current release 1.0.36 (2026-10-05) have nowhere to put that id:

  • AgentOptions and CursorRequestOptions accept apiKey and do not accept a team id.
  • CloudApiClient.getMe() is GET /v1/me with no team argument. SDKUser returns the API key owner, not a team.
  • SDK request headers are Authorization, x-ghost-mode, x-cursor-client-version, and x-cursor-client-type: sdk (plus streaming / idempotency / localhost flags). The bundle contains zero x-cursor-team-id and zero activeTeamId references. No CURSOR_* env var carries a team id.

The T3 rows are grok-4.7-high because an untouched composer sends only fast: false, so Cursor uses its default effort. The CLI's saved effort is medium, which is why those rows are grok-4.7-medium. That is #16149 (context window / default options), not team billing. #15788 is the same family: SDK requests never set Max Mode.

Impact

Major degradation or frequent failure

Version or commit

T3 0.0.46-nightly.20261005.2667. Current main 611132c1 still has the same gap. @cursor/sdk 1.0.35 in tree, 1.0.36 on npm. Cursor CLI 2026.09.28.

Environment

macOS, one Cursor login that belongs to more than one team, Cursor provider via @cursor/sdk (cursor-agent-sdk.local). Dashboard clock is UTC.

Logs or stack traces

# agent team list --format json (shape only)
# team A: isActive true, isExplicitSelection true
# team B: isActive false

# T3 thread model payload
{"id":"grok-4.7","params":[{"id":"fast","value":"false"}]}

# team B dashboard: grok-4.7-high rows at the T3 thread's run start times
# a later T3 thread on team B billed both:
grok-4.7-high
composer-2.5

# team A dashboard: grok-4.7-medium from the CLI/IDE, not from those T3 threads

Workaround

None from the client. Leaving the other team requires a team or org admin and is not a substitute for sending the active team. agent team switch updates the CLI and IDE only.

The SDK change this depends on is https://github.com/cursor/cookbook/issues/73.

Related, and separate from this bug: #16149, #15781, #15906, #15788.

  1. Note

    🤖 Claude Opus 5.5 responding on behalf of Theo

    Thanks for the report. This fault is outside T3 Code, so we cannot fix it here. Please report it to the project that owns that tool. If you find a fault in T3 Code itself, please open a new issue with steps to reproduce it.

Sign in to join this conversation.