Repository navigation
Description
Checks on upstream T3 Code (pingdotgg/t3code) for an agent on a machine with Cursor installed. Work only against upstream T3 Code on an isolated dev server. Don't post anything to pingdotgg/t3code; report back on this issue.
Status (2026-10-26): A and B are done; see the two result comments below. C is the open ask. Do C only; the Safety section and steps 1–4 below still apply for setting up.
C. Does signing Cursor out from Settings break running turns in other threads? (open)
B found that a /logout sent to thread Y killed a running Cursor turn in thread X. X showed only "The provider event stream closed unexpectedly. Retry the turn; if it keeps failing, check the provider and server logs." and a "Cursor is unauthenticated" banner, with nothing about a sign-out. Its shell item stayed running, leaving a stale "Running… / Stop" row. We now plan to report that upstream, instead of the permission issue. Settings' sign-out button and the /logout command call the same code (ProviderAuthService.logout and tryHandlePromptCommand both run auth.logout(stopSessions(...)) in apps/server/src/provider/ProviderAuthService.ts). So the owner signing out from Settings should cause the same damage, but that's only from reading the code. Confirm it.
- Set up as in steps 1–3, on current
main(record the SHA), with Cursor signed in inside the test server as the owner. Only the owner's session is needed; no narrowed client. - In thread X, start a Cursor turn that runs for at least a minute, for example "Count slowly from 1 to 60, running
sleep 1in the shell between numbers". Use the cheapest model. - While X is running, as the owner, sign Cursor out from Settings → Providers → Cursor, using the normal button.
- Record, for thread X:
- the exact error text and banner shown;
- whether anything mentions a sign-out;
- whether the composer is stuck showing "Running… / Stop" instead of Send, and for how long (check again after a minute and after a page reload);
- the run's and shell item's status in the test database (read-only), as in B.
- Sign Cursor back in as the owner. In X, can you send a new message, or press Retry, and does it work? Is the stale row cleared?
- Control: a Cursor thread that was idle when you signed out. Does it show anything odd afterwards?
- Screenshots of X right after the sign-out, after a reload, and after signing back in. Attach them to your comment here this time.
- Clean up as before, and confirm the real Cursor sign-in survived.
Report: SHA, the answers to 4–6, screenshots, anything surprising.
Done
A. Does Cursor ask before T3's own MCP tools run? (done)
T3 attaches its own t3-code MCP server to Cursor sessions (packages/provider-cursor/src/server/adapter.ts, makeCursorAgentOptions, about lines 304–329). There's no per-tool approval rule. Cursor's autoReview is on in Supervised (approval-required) and Auto, and off in Full access. From the code, T3 never shows the person an approval request for these tools. Whether Cursor's own auto-review blocks a call is Cursor's behaviour, and only a live run shows it. On other providers, Codex asks before mutating T3 tools in Supervised, and Claude doesn't.
After step 3 below (Cursor signed in inside the test server, with a working thread), and before the /logout steps:
-
A1. In a Cursor thread set to Supervised, send: "This is a test of MCP tool approvals. Use only the t3-code MCP tools, no shell commands. 1. Call
t3_thread_listonce. 2. Callt3_thread_updateonce with actionrenameand titlecursor-supervised-rename(omit threadId so it renames this thread). Don't retry a failed call. Report whether each call succeeded, and quote any error text exactly." -
A2. For each call, record:
- whether it ran (did the thread's title change?);
- whether Cursor's auto-review blocked it, with the exact text;
- whether an approval prompt appeared in T3's UI.
Take a screenshot of the thread.
-
A3. Repeat in a new Cursor thread set to Full access, with title
cursor-full-rename. -
Use the cheapest Cursor model available, and nothing else in these turns.
B. The /logout claim to verify (done)
On upstream main (first read at 16918b57d6; still the same code at b808f7fc6d), a message whose whole text is /logout, sent to a Cursor thread, signs the Cursor provider out. It does this even when the sender lacks the Manage providers permission (providers:manage), which the Settings sign-out button requires.
- Settings sign-out →
providerAuthLogout→ requiresproviders:manage(apps/server/src/auth/RpcAuthorization.ts:72). - Sending a message only requires
orchestration:operate(RpcAuthorization.ts:42). At turn start,ProviderTurnStartService(around line 400) callsProviderAuthService.tryHandlePromptCommand. Cursor'sisLogoutPromptmatches the exact text/logoutwith no attachments (packages/provider-cursor/src/server/auth.ts, about line 484 now), and T3 runs the same sign-out as Settings: it stops every session on that sign-in and deletes T3's stored Cursor credential.
Safety
- Never point anything at the machine's real J5 Code or T3 Code install, or its home directory (
~/.j5code,~/.t3). - Start the server with the inherited variables unset and a fresh temp home:
env -u T3CODE_PORT -u T3CODE_HOST -u J5CODE_HOME -u T3CODE_HOME vp run dev --home-dir <tmp>/home
Ifvpisn't on PATH, use the clone'snode_modules/.bin/vp. - Kill only PIDs or process groups you started. Never use
pkill, or kill by name. - The Cursor sign-in must happen inside the test server, using "Sign in with Cursor" in the test server's Settings → Providers. T3 stores that sign-in in the test home's secrets directory (
credentialOwner: "t3"). Before relying on that, confirm the test sign-out doesn't affect the Cursor desktop app's own sign-in or the machine's real install: check the Cursor app is still signed in afterwards. If anything suggests it would sign out the real account, stop and report. - Spend as little as possible: send one short prompt, such as "say hi", to prove the Cursor thread works.
Steps
git clone https://github.com/pingdotgg/t3code <tmp>/t3code && cd <tmp>/t3code, and stay on currentmain. Record its SHA. Then runvp i. Record the OS and the Node version. Upstream needs Node^24.13.1; use fnm if available, without changing its default.- Start the dev server as above. Open the
pairingUrlit prints in the Browser panel. That session is the owner, with every permission. - As the owner, in Settings → Providers, enable Cursor and Sign in with Cursor. Create a project on a scratch folder, open a Cursor thread, and send one short prompt to confirm it works.
- Mint a narrowed pairing link without Manage providers, from the clone, against the same temp home. The server CLI calls it
--base-dir; it is the same directory the dev runner prints asbaseDir=:
node apps/server/src/bin.ts pair --base-dir <tmp>/home --scope orchestration:read --scope orchestration:operate
Open it in a separate browser profile, or a private window, so it is a different session: the narrowed session. - Control: in the narrowed session, open Settings → Providers and try Cursor's sign-out. Expect a refusal (missing
providers:manage), or no sign-out control at all. Record which. - Test: in the narrowed session, open the Cursor thread and send a message whose whole text is
/logout.- Expected if the bug is real: Cursor is signed out, the thread shows a provider sign-out item with no agent reply, and the owner's Settings → Providers shows Cursor signed out.
- Expected if it isn't: the message is refused, or goes to the agent as ordinary text.
- Optional, only if cheap: sign Cursor back in as the owner, approve an outside MCP client with "full access", and have it call
t3_thread_sendwith text/logoutto the Cursor thread. Skip this if setting up an MCP client is involved, and say so. - Clean up: stop the server by its PID, then delete
<tmp>. Confirm the Cursor desktop app, if any, is still signed in.
Report back here
-
A: for Supervised and Full access, what happened to
t3_thread_listand tot3_thread_update(ran, blocked by auto-review with the exact text, or prompted), plus the screenshots. -
OS, Node version, SHA.
-
What step 5 showed: refused, or no control.
-
What step 6 showed: signed out or not, with a screenshot of the thread and one of the owner's Providers page.
-
Step 7's result, or "skipped".
-
Whether the real Cursor sign-in survived.
-
Anything surprising.
Superseded 2026-10-26: the permission issue we decided not to file (kept for reference)
Title: /logout in a message signs a provider out without the "Manage providers" permission
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
Server: provider auth and permissions
Steps to reproduce
- Use a Cursor or Antigravity provider instance that is signed in.
- Send a message whose whole text is
/logoutto a thread on that instance, from a client paired without Manage providers (providers:manage). Or have an outside MCP client do it throught3_thread_send.
Expected behavior
The message path applies the same rule as Settings. Signing a provider out through Settings calls providerAuthLogout, which requires providers:manage (apps/server/src/auth/RpcAuthorization.ts:72). A caller without that permission should get the same refusal when it sends /logout.
Actual behavior
The provider is signed out. Sending a message only requires orchestration:operate (RpcAuthorization.ts:42). At turn start, ProviderTurnStartService (around line 400) passes the text to ProviderAuthService.tryHandlePromptCommand. When the adapter's isLogoutPrompt matches (Cursor and Antigravity: exactly /logout, no attachments), T3 runs the same sign-out as Settings. It stops every session using that sign-in, including other threads' running turns. For Cursor it also deletes T3's stored credential. For Antigravity it asks the runtime to sign out. By the time the turn starts, nothing records who sent the message, so no permission can be checked there.
Impact
- Who can trigger it: a person paired with a narrowed grant that lacks Manage providers. Also an outside MCP client:
mcpClientScopesnever includesproviders:manage, even at full access (apps/server/src/auth/EnvironmentAuth.ts). It can send/logoutwitht3_thread_send, rewrite a queued message into it witht3_queue_edit, or save it as a scheduled-task prompt. - Effect: the provider account is signed out, and every session on it stops. This is recoverable by signing in again, and no data is exposed.
- Out of scope: thread agents. They carry no session grant, and an agent at full access could run the provider's own logout command anyway. So this report only asks that callers who carry a grant be checked consistently.
Possible fix
People and outside MCP clients each enter through one place that already knows their grant. A small context reference, modeled on DispatchModeLimit, could carry "may sign providers out" from those places to where message text is accepted:
- Set it in
ws.tsfromsession.scopes, next toRpcAuthorization.layer(session.scopes)(line 3156). For MCP calls with an OAuth client (McpInvocationContextscope.client), set it frommcpClientScopes(scope.client.access). Thread agents and internal paths leave it unset, which means allowed. - Check it in the Orchestrator, next to the existing mode-limit check (
refuseAboveDispatchModeLimit, around line 3510), formessage.dispatch,queued-run.editanddelegated_task.request. Also check it inScheduledTaskService.upsertfor the saved prompt. Each refuses/logouttext with no attachments when the reference says no.
No contract or persistence change is needed: replays (queued starts, steer follow-ups, retries, scheduled fires) only reuse text that was checked when it was accepted. Two details:
- Commands queued during startup (
ServerRuntimeStartup.enqueueCommand) run in another fiber, so the reference has to be set inside the queued effect. - The check doesn't know the provider, so it would also refuse
/logoutsent to a Codex or Claude thread, where the text is harmless.
A smaller, WebSocket-only alternative is to add the /logout case to requiredScopesForRpcCall in RpcAuthorization.ts, which already derives providers:manage from settings payloads. That leaves outside MCP clients uncovered.
I found this by reading main at 16918b57d6 and have not run it. I'm happy to send a PR for whichever direction you prefer.
Posted by Claude Opus 5.5, an AI agent, on Jackson's behalf.
Activity
[-]Verify on a Cursor machine: /logout in a message signs Cursor out without Manage providers (upstream give-back)[/-][+]Verify on a Cursor machine: T3 MCP tool approvals on Cursor, and /logout without Manage providers (upstream give-back)[/+]Jacksondr5 commentedon Oct 25, 2026
Results
Both checks ran on this Mac against upstream T3 Code, on an isolated dev server with a temp home. Two Cursor agents in J5 did the work, coordinated from one thread.
a0e0f8a80ae4caa6c32d3306a10a284e252c88d3(pingdotgg/t3codemain)fnm exec. Upstreammainnow pins Node 26.12.1 and pnpm 12.14.0, not the^24.13.1this issue says.vpwasn't on PATH, so the agents used the clone'snode_modules/.bin/vp.A. Cursor doesn't ask before T3's own MCP tools run
t3_thread_listt3_thread_update(rename)approval-required)cursor-supervised-renamecursor-full-renameThe test database agrees.
orchestration_eventshas no approval or request events for either thread, and both tool items arecompleted. So on Cursor, Supervised doesn't gate T3's mutating tools at all. Codex asks before mutating T3 tools in Supervised; Cursor behaves like Claude here.B.
/logoutsigns Cursor out without Manage providers: confirmedpair --scope orchestration:read --scope orchestration:operateand opened it in a separate (incognito) browser session.ProviderAuthenticationSectionwhenreadOnly(apps/web/src/components/settings/ProviderSettingsPanel.tsx, about line 1362). Nothing was refused because there was nothing to click./logoutto a working Cursor thread./logoutmessage, "Worked for 1ms", and no agent reply. The turn holds one command-style/logoutitem. A banner then read: "Cursor is unauthenticated. Sign in with Cursor or add CURSOR_API_KEY in provider settings."userdata/secrets/provider-auth-….bin) was deleted. The other secrets were untouched./logoutcommand row and the unauthenticated banner.cursor-agent statussaid "Logged in" both before and after, and the Cursor desktop app still had its auth. T3's Cursor logout is local only: it stops the sessions and clears T3's credential store. It doesn't runcursor-agent logoutor revoke anything remotely.The draft's code references at
a0e0f8a8The claim still holds. Only some line numbers moved; the draft should be updated before filing:
apps/server/src/auth/RpcAuthorization.ts:74:providerAuthLogoutrequiresproviders:manage(the draft says:72).dispatchCommandrequiringorchestration:operateis still at:42.apps/server/src/orchestration-v2/ProviderTurnStartService.ts:431callstryHandlePromptCommand(the draft says "around line 400"). The implementation is atapps/server/src/provider/ProviderAuthService.ts:285.packages/provider-cursor/src/server/auth.ts:484:isLogoutPromptis unchanged.logoutis at:395.apps/server/src/auth/EnvironmentAuth.ts:77:mcpClientScopesat full access gives read, operate,settings:writeandsourceControl:write, and still notproviders:manage.ws.ts:3285:RpcAuthorization.layer(session.scopes, (method, payload) => …)(the draft says:3156, and the call now takes a second argument).Orchestrator.ts:3950:refuseAboveDispatchModeLimit(the draft says around3510).Two more changes to the draft: the step 5 control is a hidden control, not a refusal; and in "Actual behavior", the thread shows only a generic
/logoutcommand item.Anything surprising
Posted by Claude Opus 5.5, an AI agent, on Jackson's behalf. The tests were run by two Cursor agents (Claude Opus 5.5 through Cursor) in J5 Code.
Jacksondr5 commentedon Oct 26, 2026
Follow-up: full testing
This closes the gaps left by the first run. Antigravity is still untested, because Jackson couldn't do it right now. It ran on this Mac against upstream
mainat5b35402623d7d1d88eaa472807272a6c2e78012a(Node 26.12.1), on a fresh isolated test server. Unless noted, the Cursor turns used Gemini 3.6 Flash.A. Cursor auto-review never stops T3's MCP tools
agent.openoptions object touserdata/logs/provider/events.<threadId>.log. Supervised and Auto sessions logged"autoReview":true, and Full access logged"autoReview":false. That matchescursorRuntimeAgentPolicyinpackages/provider-cursor/src/server/adapter.ts. So auto-review is on, and it lets these calls through.t3_thread_listand thet3_thread_updaterename both ran.t3_thread_organize action:archive) and at3_thread_sendto another thread both ran.orchestration_v2_projection_runtime_requestshas 0 rows.t3_thread_sendto, a thread whose mode is broader than the caller's: "Child runtime mode full-access is broader than parent mode approval-required."B.
/logoutwithout Manage providers: every route signs Cursor outControl (step 5), now checked on the server. From the narrowed session (
orchestration:read,orchestration:operate), a raw WebSocket RPCprovider.auth.logout {instanceId:"cursor"}was refused withEnvironmentAuthorizationError: "The authenticated token is missing required scope: providers:manage." Cursor stayed signed in. Small oddity: the error object reportsrequiredScope: "orchestration:operate"next torequiredPermission: "providers:manage".providers:manage/logoutorchestration:read orchestration:operate settings:write source-control:write),t3_thread_send/logoutdelivery: startedwith no error.t3_queue_editchanging a queued "say ok" behind a running turn to/logoutschedule_taskwith prompt/logout, thenrun_scheduled_task_nowt3_project_update, which its scopes allow.It stops running sessions in other threads. Thread X had a long Cursor turn running. A
/logoutsent to thread Y at 23:30:31.891Z made T3 sendagent.closeandrun.cancelto X at .909Z and .910Z, and X's run failed at .910Z.What the killed thread shows:
runningin the database. The thread kept a "Running: … / Stop" row in place of Send.What the threads that ran
/logoutshow: "Worked for 1ms" and no reply. After the queue edit, the thread shows only the final/logout. The scheduled run's thread shows only an "Automation · " chip; the/logouttext isn't visible at all.It's recoverable. Copying T3's saved credential file back and refreshing provider status restored Cursor with no restart, and a "say hi" turn worked. Signing in again works too.
Codex and Claude don't treat
/logoutas a command. Both were sent exactly/logoutfrom the narrowed session, on threads at full access:orchestration:operatecan already prompt a full-access agent to do anything. But it does mean the draft's "harmless on Codex or Claude" is true only of T3. The agent may still act on the text.The real logins survived. The Cursor desktop app,
cursor-agent, Codex and Claude were all still signed in at the end.For the upstream draft
t3_thread_send, throught3_queue_edit, and through a scheduled-task prompt. So is "stops every session on that sign-in, including other threads' running turns."Screenshots
Jackson will attach them below. All were taken on the test machine; the test server was stopped and its temp directory deleted.
Posted by Claude Opus 5.5, an AI agent, on Jackson's behalf. The tests were run by Cursor agents (Claude Opus 5.5 through Cursor) in J5 Code.
[-]Verify on a Cursor machine: T3 MCP tool approvals on Cursor, and /logout without Manage providers (upstream give-back)[/-][+]Verify on a Cursor machine: does a Cursor sign-out break other threads' running turns? (upstream give-back)[/+]evidence: screenshots for #659 (/logout and Cursor MCP approvals)
Jacksondr5 commentedon Oct 26, 2026
Screenshots for A and B
These are the screenshots from the two result comments above, stored on
j5/evidenceatissue-659/. The machine's hostname and an account email are blacked out. The first run's two test A screenshots aren't included, because they came out blurred.First run (upstream
a0e0f8a80a)Step 5, the narrowed session's Providers page. Cursor has no sign-in or sign-out control. (Taken after the logout, so Cursor already shows Not authenticated.)

Step 6, the narrowed session sends

/logout. No reply, "Worked for 1ms", and the unauthenticated banner.Step 6, the same turn expanded. It holds one command-style

/logoutitem.Step 6, the owner's Providers page. Cursor is not authenticated.

Full testing (upstream
5b35402623)A, Auto mode.

t3_thread_listand the rename both ran.A, Supervised, more destructive calls. T3 itself refused the archive of a broader-mode thread. Archiving a Supervised thread and

t3_thread_sendboth ran.A, Supervised on Claude Haiku 5.5 through Cursor. Both calls ran.

Thread X, after a

/logoutsent to another thread killed its running turn. Only the generic provider-stream error.Thread Y, where the narrowed session sent

/logout.The owner's Providers page after that logout.

Recovery. After restoring the credential, "say hi" works in X.

Outside MCP client,

t3_thread_send/logout. Shown with an "Agent" chip.Outside MCP client,

t3_queue_edit. The queued "say ok" became/logout; only the final text is visible.Scheduled task with prompt

/logout. The run's thread shows only the automation chip.Codex given

/logoutas text. It asks which session to log out of.Claude given

/logoutas text.The app rendered in a narrow column, so the right edge of each full-testing screenshot repeats part of the page.
Posted by Claude Opus 5.5, an AI agent, on Jackson's behalf.
evidence: screenshots for #659 part C (Settings sign-out vs running t…
Jacksondr5 commentedon Oct 30, 2026
C. Settings sign-out breaks running turns in other threads: confirmed
d487078f11f80543da83e5316a82d43b0a8addbb(pingdotgg/t3codemain)Evidence:
issue-659/d487078f11/onj5/evidence, with the hostname blacked out.What happened (step 3)
Thread X ("Count to 60 with Pauses", full access) had a shell loop running,
for i in $(seq 1 60); do echo $i; sleep 1; done. As the owner, I signed Cursor out from Settings → Providers → Cursor.agent.closeat 01:04:45.903Z andrun.cancelat 01:04:45.907Z. X's run becamefailedat 01:04:45.906Z.Step 4: thread X
What X shows: a "Provider error" item, "The provider event stream closed unexpectedly. Retry the turn; if it keeps failing, check the provider and server logs.", the same text as a banner, and a "Cursor is unauthenticated · Sign in with Cursor or add CURSOR_API_KEY in provider settings." banner.
Does anything mention a sign-out? No. Nothing in X says the provider was signed out, or that the turn was stopped on purpose.
Stuck "Running… / Stop" row: yes. It shows "Running: for i in $(seq 1 60); do echo $i; sleep 1; done" with Stop, in place of Send.
Test database (read-only):
failed(completed 01:04:45.906Z).interrupted, and the provider session isstopped.command_executionitem and its tool-call node are stillrunning, with no completion time. That stuck item is what keeps the row on screen.Unknown: whether the sign-out killed the shell process itself. It was gone when checked, but it would have finished on its own by then.
Step 5: after signing back in
runningin the database.Step 6: idle control thread
That thread's Cursor session was closed too (
agent.closeat 01:04:45.889Z). Its last run stayedcompleted. It shows only the "Cursor is unauthenticated" banner, has no error or stale row, and its composer stays at Send. Nothing odd.Screenshots
X after a reload, signed out. The provider-stream error and banners, and the stale "Running… / Stop" row.

X after signing back in and a successful Composer 2.5 turn. The stale row is still there.

The idle control thread after the sign-out. Only the banner.

The owner's Providers page after the sign-out.

There's no screenshot of X right after the sign-out. Screenshots of a browser tab that wasn't on screen timed out, and the after-reload one shows the same state.
Cleanup
cursor-agentstill reports it logged in.Surprises
new Date()in the page timed out, while the Settings tab and the server kept responding. A fresh tab on X loaded normally. I didn't find the cause, and it may come from the browser panel rather than T3's page.For the upstream report
Both routes stop the turn the same way. The Settings path warns the person first, and the
/logoutpath doesn't. Either way, the interrupted thread is left in a bad state:Posted by Claude Opus 5.5, an AI agent, on Jackson's behalf. A Cursor agent (Claude Opus 5.5 through Cursor) ran most of C in J5 Code; Claude finished the final check and cleanup after that agent stopped.
evidence: screenshots for #659 (/logout and Cursor MCP approvals)
evidence: screenshots for #659 part C (Settings sign-out vs running t…
bryantderosier commentedon Dec 1, 2026
Closing this one, all three checks have answers:
/logoutwithout Manage providers): confirmed, and upstream has since fixed it.b5bef4d939"fix(server): /logout in chat needs providers:manage" (fix(server): /logout in chat needs providers:manage pingdotgg/t3code#39027), so we don't need to report this one anymore.d487078f11in the 2026-10-30 comment, with screenshots onj5/evidenceunderissue-659/d487078f11/.C is still open upstream:
ProviderAuthService.logoutstill runsauth.logout(stopSessions(...)), which kills other threads' running turns and leaves a stuck "Running… / Stop" row. If we decide to report that upstream, it'll be its own give-back with this issue's evidence linked. The verification this issue asked for is done.