feat(cursor): show which step Cursor is in while a turn starts #41242
main fromrefs/pull/41242/head·merged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHubCursor can sit on "Starting Cursor" for seconds to minutes while its SDK prepares a run (#40503 waited ~7¾ minutes on a broken plugin install), and the row never says what it is waiting on. It also showed the thinking brain, though nothing is thinking yet.
What changed#
- SDK hook:
@cursor/sdkhas no progress callback while it loads workspace services, sopatches/@cursor__sdk@1.4.2.patchcalls a@cursor/sdk.startupPhasehook as it enters each step (plugins, MCP, hooks, skills, connecting), in all three bundles. - Server:
CursorAgentSdkroutes each phase to the send that caused it through async context, since the hook is global and one worker hosts many sessions. The worker forwards it to the runner, and the Cursor adapter publishes it as a new optionalstartupPhaseon the provider session, clearing it when the run starts or fails. - Clients:
packages/client-runtimemaps known phases to "Loading Cursor plugins", "Starting Cursor MCP servers", "Loading Cursor hooks", "Loading Cursor rules and skills", and "Connecting to Cursor". Unknown phases keep "Starting Cursor", so older clients and other providers are unaffected. - Icon: while a provider is starting, the row shows that provider's logo instead of the brain, on web and mobile, for every provider.
- Locales: the new strings are translated in all web and mobile locales.
Evidence#
A live Composer 2.5 turn in a dev sandbox, timed from the page:
| After send | Row |
|---|---|
| 0.35s | Cursor logo · Starting Cursor |
| 0.6s | Cursor logo · Loading Cursor plugins |
| 6.6s | Cursor logo · Starting Cursor MCP servers |
| 6.8s | Cursor logo · Loading Cursor rules and skills |
| 7.1s | Cursor logo · Connecting to Cursor |
| 7.3s | 🧠 Thinking, then the reply |
Tests cover the hook attribution (CursorAgentSdk.test.ts), worker forwarding (CursorAgentSdkProcessRunner.test.ts), adapter publish-and-clear (adapter.test.ts), and the label and provider mapping (threadExecution.test.ts).
Known gaps#
- The phases only explain the wait; they don't make the SDK's plugin step faster. That slowness is in
@cursor/sdk(#40503's broken plugin install). - For about a third of a second after sending, before the provider session exists, the row still shows the brain.
- Mobile shows the logo from the driver only, so an ACP Registry agent gets a generic icon there.
ChatView.browser.test.tsx"a shortcut conditioned on rightPanelOpen…" times out locally when its whole file runs; it fails the same way onmain.
Fixes #40503
Model and harness: Claude Opus 5.5 in Claude Code via T3 Code.
🤖 Generated with Claude Code
- 1
Yash-Singh1(GitHub profile, opens in a new tab) linked this to fix #40503
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
Walkthrough
-
The Cursor startup flow now reports startup phases through provider sessions. Client activity state maps recognized phases to localized labels and carries provider identity to mobile and web thinking rows, where provider icons can replace the default icon.
Changes: Provider startup progress
Layer / File(s) Summary Startup-phase contracts
packages/contracts/src/orchestrationV2.ts,packages/client-runtime/src/state/models.tsProvider sessions can include a startup phase. Thread run summaries can include the starting provider’s instance ID and driver. Cursor phase capture and routing
packages/provider-cursor/src/server/CursorAgentSdk*.ts,packages/provider-cursor/src/server/CursorAgentSdk*.test.tsThe Cursor worker sends startup-phase messages during send startup. The process runner and SDK route phases to the active send’s callback. Provider-session phase updates
packages/provider-cursor/src/server/adapter.ts,packages/provider-cursor/src/server/adapter.test.tsThe adapter publishes changed startup phases, suppresses duplicate updates, and clears the phase when send startup ends or fails. Startup labels and translations
packages/client-runtime/src/state/threadExecution.ts,packages/client-runtime/src/state/threadExecution.test.ts,apps/mobile/src/i18n/translations/*.json,apps/web/src/i18n/translations/*.jsonClient runtime maps recognized phases to provider-specific labels and uses the generic provider label for other phases. Translation catalogs add labels for the startup stages. Provider identity in thinking rows
apps/mobile/src/lib/threadActivity.ts,apps/mobile/src/features/threads/ThreadFeed.tsx,apps/mobile/src/features/threads/thread-work-log.tsx,apps/web/src/components/ChatView.tsx,apps/web/src/components/chat/*Mobile and web activity state carries the starting provider’s identity into thinking rows. The rows render the provider icon when that identity is available. Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature · Severity of issue fixed: Medium
Sequence Diagram(s)#
sequenceDiagram participant CursorAgentSdkWorker participant CursorAgentSdkProcessRunner participant CursorAdapter participant ClientRuntime participant ChatTimeline CursorAgentSdkWorker->>CursorAgentSdkProcessRunner: Send startup phase CursorAgentSdkProcessRunner->>CursorAdapter: Forward phase to active send CursorAdapter->>ClientRuntime: Publish provider session update ClientRuntime->>ChatTimeline: Provide startup label and provider identity ChatTimeline->>ChatTimeline: Render localized status and provider iconSuggested reviewers:
juliusmarminge,stienswout
Pre-merge checks:
4-
Check name Status Explanation Title check The title "feat(cursor): show which step Cursor is in while a turn starts" matches the main change. The PR adds startup-phase feedback for Cursor while @cursor/sdkprepares a run, and the changeset ca…Description check The description is thorough and follows the template's intent. It states the problem (Cursor shows "Starting Cursor" with no detail, and the thinking brain appears before thinking starts) and gives th… Linked Issues check [ #40503] The issue asks for progress or diagnostic feedback while Cursor startup blocks on "Starting Cursor". The PR adds that feedback. The SDK patch emits a startup-phase hook (plugins, MCP, hooks, …Out of Scope Changes check The changes trace to the startup-feedback objective of [ #40503]. These include the SDK hook, per-send attribution, worker and protocol forwarding, adapter publish-and-clear, contract field `startupPha…Full details: Title check
-
Explanation
The title "feat(cursor): show which step Cursor is in while a turn starts" matches the main change. The PR adds startup-phase feedback for Cursor while
@cursor/sdkprepares a run, and the changeset carries it through the SDK patch, server, adapter, and clients. The title is specific and follows the conventional commit style used in the repository template.
Full details: Description check
-
Explanation
The description is thorough and follows the template's intent. It states the problem (Cursor shows "Starting Cursor" with no detail, and the thinking brain appears before thinking starts) and gives the change, scope rationale through a linked issue (Fixes
#40503), and verification. The verification section gives a timed live run, names the focused tests, and lists known gaps. Some template items are only partly met: the Scope section does not say why this feature-like change is an accepted bug fix, and the template asks for before/after screenshots for UI changes. The evidence is a timing table, not screenshots. The author also left the template's model and harness line filled in. Overall the description is mostly complete.Resolution
Optional improvements: explain in the Scope section why this change counts as a bug fix rather than a feature, since the template says features are not accepted. Add before/after screenshots of the logo and label change for the UI parts, as the template requests for UI changes.
Full details: Linked Issues check
-
Explanation
[
#40503] The issue asks for progress or diagnostic feedback while Cursor startup blocks on "Starting Cursor". The PR adds that feedback. The SDK patch emits a startup-phase hook (plugins, MCP, hooks, skills, connecting). CursorAgentSdk routes each phase to the originating send through AsyncLocalStorage. The worker, protocol, and adapter forward it as optional provider sessionstartupPhase, and the adapter clears it on start or failure. The client-runtime maps known phases to specific labels and keeps "Starting Cursor" for unknown phases. The summary cites tests for each layer; I did not run them. The PR does not reduce the multi-minute SDK delay. The PR description and objectives state this. The issue's requested progress feedback is met. The issue's workaround and the connection-timeout idea are not stated requirements, so they are not assessed. The "Fixes#40503" closing keyword overstates the fix because the root delay remains.
Full details: Out of Scope Changes check
-
Explanation
The changes trace to the startup-feedback objective of [
#40503]. These include the SDK hook, per-send attribution, worker and protocol forwarding, adapter publish-and-clear, contract fieldstartupPhase, client label mapping, and locale strings for the new labels. The icon change (provider logo instead of the brain while a provider is starting) is a UI change on web and mobile for all providers. It is not requested by#40503. It is closely tied to the same starting row and the same startup state, so it is not a demonstrated unrelated change. The mobile and webproviderStartingplumbing supports that icon. The ChatView browser test failure is pre-existing and no changed file in the summary touches that test. The ignored pnpm-lock.yaml was not inspected and is excluded by the review rules.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: t3/cursor-start-phases
- File: .coderabbit.config.ts
- Commit: d25c583
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Team
- Run ID:
9635707d-5449-4cc7-87a8-cf320274b9dd
Commits-
Reviewing files that changed from the base of the PR and between 21e7fc1545068b9cc95ed646f080b793b15f27d8 and d25c5839dc4d33a217bee6cf4b769f90698f6a55.
Files ignored due to path filters: 1-
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
Files selected for processing: 41-
apps/mobile/src/features/threads/ThreadFeed.tsxapps/mobile/src/features/threads/thread-work-log.tsxapps/mobile/src/i18n/translations/de.jsonapps/mobile/src/i18n/translations/en.jsonapps/mobile/src/i18n/translations/es.jsonapps/mobile/src/i18n/translations/fr.jsonapps/mobile/src/i18n/translations/ja.jsonapps/mobile/src/i18n/translations/ko.jsonapps/mobile/src/i18n/translations/pt-BR.jsonapps/mobile/src/i18n/translations/ru.jsonapps/mobile/src/i18n/translations/sv.jsonapps/mobile/src/i18n/translations/zh.jsonapps/mobile/src/lib/threadActivity.tsapps/web/src/components/ChatView.tsxapps/web/src/components/chat/MessagesTimeline.tsxapps/web/src/components/chat/ProviderStartingIcon.tsxapps/web/src/components/chat/TimelineWorkGroupRows.tsxapps/web/src/components/chat/timelineRowContext.tsapps/web/src/i18n/translations/de.jsonapps/web/src/i18n/translations/en.jsonapps/web/src/i18n/translations/es.jsonapps/web/src/i18n/translations/fr.jsonapps/web/src/i18n/translations/ja.jsonapps/web/src/i18n/translations/ko.jsonapps/web/src/i18n/translations/pt-BR.jsonapps/web/src/i18n/translations/ru.jsonapps/web/src/i18n/translations/sv.jsonapps/web/src/i18n/translations/zh.jsonpackages/client-runtime/src/state/models.tspackages/client-runtime/src/state/threadExecution.test.tspackages/client-runtime/src/state/threadExecution.tspackages/contracts/src/orchestrationV2.tspackages/provider-cursor/src/server/CursorAgentSdk.test.tspackages/provider-cursor/src/server/CursorAgentSdk.tspackages/provider-cursor/src/server/CursorAgentSdkProcessRunner.test.tspackages/provider-cursor/src/server/CursorAgentSdkProcessRunner.tspackages/provider-cursor/src/server/CursorAgentSdkWorker.tspackages/provider-cursor/src/server/CursorAgentSdkWorkerProtocol.tspackages/provider-cursor/src/server/adapter.test.tspackages/provider-cursor/src/server/adapter.tspatches/@cursor__sdk@1.4.2.patch
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
-
Yash-Singh1(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Other scenarios#
All 64 scenario measurements match
main.All 64 scenario measurements
short turn resumeWebSocket decodedshort turn resumeWebSocket messageslong turn running, cold openHTTP decodedlong turn running, cold openrowslong turn running, history pageHTTP decodedlong turn running, history pagerowslong turn finished, cold openHTTP decodedlong turn finished, cold openrowslong turn finished, socket cold openWebSocket decodedlong turn finished, socket cold openWebSocket messageslong turn finished, socket cold openrowslong turn finished, work pageHTTP decodedlong turn finished, work pagerowsidle thread resumeWebSocket decodedidle thread resumeWebSocket messagesfleet shell snapshotHTTP decodedfleet shell snapshotrowsfleet shell subscribeWebSocket decodedfleet shell subscribeWebSocket messagesfleet shell resume checkHTTP decodedfleet shell resume checkrowsstale shell reloadHTTP decodedstale shell reloadrowsstale shell resumeWebSocket decodedstale shell resumeWebSocket messagesstale todo list cold openHTTP decodedstale todo list cold openrowsstale todo list cold opennodesstale todo list cold opensubagentsstale todo list cold openplansstale todo list cold openproviderTurnsstale todo list cold opencheckpointsshort turn resumeWebSocket decodedshort turn resumeWebSocket messageslong turn running, cold openHTTP decodedlong turn running, cold openrowslong turn running, history pageHTTP decodedlong turn running, history pagerowslong turn finished, cold openHTTP decodedlong turn finished, cold openrowslong turn finished, socket cold openWebSocket decodedlong turn finished, socket cold openWebSocket messageslong turn finished, socket cold openrowslong turn finished, work pageHTTP decodedlong turn finished, work pagerowsidle thread resumeWebSocket decodedidle thread resumeWebSocket messagesfleet shell snapshotHTTP decodedfleet shell snapshotrowsfleet shell subscribeWebSocket decodedfleet shell subscribeWebSocket messagesfleet shell resume checkHTTP decodedfleet shell resume checkrowsstale shell reloadHTTP decodedstale shell reloadrowsstale shell resumeWebSocket decodedstale shell resumeWebSocket messagesstale todo list cold openHTTP decodedstale todo list cold openrowsstale todo list cold opennodesstale todo list cold opensubagentsstale todo list cold openplansstale todo list cold openproviderTurnsstale todo list cold opencheckpointsBaseline:
21e7fc1· PR result:d25c583· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.