Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(cursor): show which step Cursor is in while a turn starts #41242

MergedYash-Singh1(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/41242/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Cursor 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/sdk has no progress callback while it loads workspace services, so patches/@cursor__sdk@1.4.2.patch calls a @cursor/sdk.startupPhase hook as it enters each step (plugins, MCP, hooks, skills, connecting), in all three bundles.
  • Server: CursorAgentSdk routes 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 optional startupPhase on the provider session, clearing it when the run starts or fails.
  • Clients: packages/client-runtime maps 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 sendRow
0.35sCursor logo · Starting Cursor
0.6sCursor logo · Loading Cursor plugins
6.6sCursor logo · Starting Cursor MCP servers
6.8sCursor logo · Loading Cursor rules and skills
7.1sCursor 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 on main.

Fixes #40503

Model and harness: Claude Opus 5.5 in Claude Code via T3 Code.

🤖 Generated with Claude Code

    1. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      CodexLive turn WebSocket decoded21.5 KiB21.5 KiB0 B (0.0%)24.4 KiB✅
      CodexLive turn messages110 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.9 KiB21.9 KiB0 B (0.0%)24.4 KiB✅
      ClaudeLive turn messages110 (0.0%)8✅

      Other scenarios

      All 64 scenario measurements match main.

      All 64 scenario measurements
      ProviderScenarioMetricMain baselineThis PRImpactPR ceiling
      Codexshort turn resumeWebSocket decoded10.5 KiB10.5 KiB0 B (0.0%)12.7 KiB✅
      Codexshort turn resumeWebSocket messages220 (0.0%)2✅
      Codexlong turn running, cold openHTTP decoded281.7 KiB281.7 KiB0 B (0.0%)302.7 KiB✅
      Codexlong turn running, cold openrows75750 (0.0%)75✅
      Codexlong turn running, history pageHTTP decoded92.4 KiB92.4 KiB0 B (0.0%)107.4 KiB✅
      Codexlong turn running, history pagerows75750 (0.0%)75✅
      Codexlong turn finished, cold openHTTP decoded381.5 KiB381.5 KiB0 B (0.0%)410.2 KiB✅
      Codexlong turn finished, cold openrows1511510 (0.0%)151✅
      Codexlong turn finished, socket cold openWebSocket decoded381.6 KiB381.6 KiB0 B (0.0%)410.2 KiB✅
      Codexlong turn finished, socket cold openWebSocket messages220 (0.0%)2✅
      Codexlong turn finished, socket cold openrows1511510 (0.0%)151✅
      Codexlong turn finished, work pageHTTP decoded186.2 KiB186.2 KiB0 B (0.0%)200.2 KiB✅
      Codexlong turn finished, work pagerows1501500 (0.0%)150✅
      Codexidle thread resumeWebSocket decoded65 B65 B0 B (0.0%)200 B✅
      Codexidle thread resumeWebSocket messages110 (0.0%)1✅
      Codexfleet shell snapshotHTTP decoded42.4 KiB42.4 KiB0 B (0.0%)53.7 KiB✅
      Codexfleet shell snapshotrows27270 (0.0%)27✅
      Codexfleet shell subscribeWebSocket decoded65 B65 B0 B (0.0%)200 B✅
      Codexfleet shell subscribeWebSocket messages110 (0.0%)1✅
      Codexfleet shell resume checkHTTP decoded18 B18 B0 B (0.0%)100 B✅
      Codexfleet shell resume checkrows0000✅
      Codexstale shell reloadHTTP decoded42.4 KiB42.4 KiB0 B (0.0%)53.7 KiB✅
      Codexstale shell reloadrows27270 (0.0%)27✅
      Codexstale shell resumeWebSocket decoded140 B140 B0 B (0.0%)400 B✅
      Codexstale shell resumeWebSocket messages220 (0.0%)2✅
      Codexstale todo list cold openHTTP decoded72.4 KiB72.4 KiB0 B (0.0%)83.0 KiB✅
      Codexstale todo list cold openrows75750 (0.0%)75✅
      Codexstale todo list cold opennodes220 (0.0%)4✅
      Codexstale todo list cold opensubagents220 (0.0%)4✅
      Codexstale todo list cold openplans110 (0.0%)2✅
      Codexstale todo list cold openproviderTurns110 (0.0%)2✅
      Codexstale todo list cold opencheckpoints110 (0.0%)2✅
      Claudeshort turn resumeWebSocket decoded10.6 KiB10.6 KiB0 B (0.0%)12.7 KiB✅
      Claudeshort turn resumeWebSocket messages220 (0.0%)2✅
      Claudelong turn running, cold openHTTP decoded283.3 KiB283.3 KiB0 B (0.0%)302.7 KiB✅
      Claudelong turn running, cold openrows75750 (0.0%)75✅
      Claudelong turn running, history pageHTTP decoded93.4 KiB93.4 KiB0 B (0.0%)107.4 KiB✅
      Claudelong turn running, history pagerows75750 (0.0%)75✅
      Claudelong turn finished, cold openHTTP decoded384.2 KiB384.2 KiB0 B (0.0%)410.2 KiB✅
      Claudelong turn finished, cold openrows1511510 (0.0%)151✅
      Claudelong turn finished, socket cold openWebSocket decoded384.3 KiB384.3 KiB0 B (0.0%)410.2 KiB✅
      Claudelong turn finished, socket cold openWebSocket messages220 (0.0%)2✅
      Claudelong turn finished, socket cold openrows1511510 (0.0%)151✅
      Claudelong turn finished, work pageHTTP decoded188.1 KiB188.1 KiB0 B (0.0%)200.2 KiB✅
      Claudelong turn finished, work pagerows1501500 (0.0%)150✅
      Claudeidle thread resumeWebSocket decoded66 B66 B0 B (0.0%)200 B✅
      Claudeidle thread resumeWebSocket messages110 (0.0%)1✅
      Claudefleet shell snapshotHTTP decoded43.0 KiB43.0 KiB0 B (0.0%)53.7 KiB✅
      Claudefleet shell snapshotrows27270 (0.0%)27✅
      Claudefleet shell subscribeWebSocket decoded66 B66 B0 B (0.0%)200 B✅
      Claudefleet shell subscribeWebSocket messages110 (0.0%)1✅
      Claudefleet shell resume checkHTTP decoded18 B18 B0 B (0.0%)100 B✅
      Claudefleet shell resume checkrows0000✅
      Claudestale shell reloadHTTP decoded43.0 KiB43.0 KiB0 B (0.0%)53.7 KiB✅
      Claudestale shell reloadrows27270 (0.0%)27✅
      Claudestale shell resumeWebSocket decoded140 B140 B0 B (0.0%)400 B✅
      Claudestale shell resumeWebSocket messages220 (0.0%)2✅
      Claudestale todo list cold openHTTP decoded73.4 KiB73.4 KiB0 B (0.0%)83.0 KiB✅
      Claudestale todo list cold openrows75750 (0.0%)75✅
      Claudestale todo list cold opennodes220 (0.0%)4✅
      Claudestale todo list cold opensubagents220 (0.0%)4✅
      Claudestale todo list cold openplans110 (0.0%)2✅
      Claudestale todo list cold openproviderTurns110 (0.0%)2✅
      Claudestale todo list cold opencheckpoints110 (0.0%)2✅

      Baseline: 21e7fc1 · PR result: d25c583 · Source CI: success

      Scenario 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.

      • Codex decoded thread snapshot: 108.5 KiB
      • Claude decoded thread snapshot: 108.8 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    2. Explain Change →
      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.ts
      Provider 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.ts
      The 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.ts
      The 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/*.json
      Client 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 icon

      Suggested reviewers: juliusmarminge, stienswout

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe 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/sdk prepares a run, and the changeset ca…
      Description checkPassedThe 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 checkPassed[#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 checkPassedThe 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/sdk prepares 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 session startupPhase, 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 field startupPhase, 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 web providerStarting plumbing 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

      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.yaml is excluded by !**/pnpm-lock.yaml
      Files selected for processing: 41

      • apps/mobile/src/features/threads/ThreadFeed.tsx
      • apps/mobile/src/features/threads/thread-work-log.tsx
      • apps/mobile/src/i18n/translations/de.json
      • apps/mobile/src/i18n/translations/en.json
      • apps/mobile/src/i18n/translations/es.json
      • apps/mobile/src/i18n/translations/fr.json
      • apps/mobile/src/i18n/translations/ja.json
      • apps/mobile/src/i18n/translations/ko.json
      • apps/mobile/src/i18n/translations/pt-BR.json
      • apps/mobile/src/i18n/translations/ru.json
      • apps/mobile/src/i18n/translations/sv.json
      • apps/mobile/src/i18n/translations/zh.json
      • apps/mobile/src/lib/threadActivity.ts
      • apps/web/src/components/ChatView.tsx
      • apps/web/src/components/chat/MessagesTimeline.tsx
      • apps/web/src/components/chat/ProviderStartingIcon.tsx
      • apps/web/src/components/chat/TimelineWorkGroupRows.tsx
      • apps/web/src/components/chat/timelineRowContext.ts
      • apps/web/src/i18n/translations/de.json
      • apps/web/src/i18n/translations/en.json
      • apps/web/src/i18n/translations/es.json
      • apps/web/src/i18n/translations/fr.json
      • apps/web/src/i18n/translations/ja.json
      • apps/web/src/i18n/translations/ko.json
      • apps/web/src/i18n/translations/pt-BR.json
      • apps/web/src/i18n/translations/ru.json
      • apps/web/src/i18n/translations/sv.json
      • apps/web/src/i18n/translations/zh.json
      • packages/client-runtime/src/state/models.ts
      • packages/client-runtime/src/state/threadExecution.test.ts
      • packages/client-runtime/src/state/threadExecution.ts
      • packages/contracts/src/orchestrationV2.ts
      • packages/provider-cursor/src/server/CursorAgentSdk.test.ts
      • packages/provider-cursor/src/server/CursorAgentSdk.ts
      • packages/provider-cursor/src/server/CursorAgentSdkProcessRunner.test.ts
      • packages/provider-cursor/src/server/CursorAgentSdkProcessRunner.ts
      • packages/provider-cursor/src/server/CursorAgentSdkWorker.ts
      • packages/provider-cursor/src/server/CursorAgentSdkWorkerProtocol.ts
      • packages/provider-cursor/src/server/adapter.test.ts
      • packages/provider-cursor/src/server/adapter.ts
      • patches/@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.

Sign in to join this conversation.