[Bug]: Prompt suggestion never shows after a message is steered into the running turn#33705

opened7h agobyTthelogicmatrix

Before submitting

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

Area

apps/web

Steps to reproduce

  1. Turn on Settings > Labs > Suggest next prompt.
  2. In a Claude thread with at least one earlier exchange, send a message.
  3. While that turn is still running, send a second message so it is promoted to Steer and joins the running turn.
  4. Wait for the turn to finish and leave the composer empty.

Expected behavior

The composer shows the predicted next prompt for the turn that just finished.

Actual behavior

No suggestion appears. The provider did send one: the provider event log has an incoming prompt_suggestion about a second after the turn's result, and ClaudeAdapterV2 tags it with the settled turn's run id, the run that finished.

The client hides it. usePromptSuggestion only offers a suggestion whose runId equals thread.latestRun.runId with status completed. Promoting a queued message to Steer cancels that queued run before it starts (dispatchQueuedMessagePromoteToSteer) and delivers its text into the running turn. The cancelled run keeps the higher ordinal, so it stays the thread's latestRun, and the suggestion for the run that actually finished never matches.

From one thread's projection:

ordinalstatusrequestedcompleted
1completed03:51:32.61103:52:41.479
2cancelled03:52:11.66303:52:12.026

The suggestion arrived at 03:52:42.727 for run 1, and latestRun was run 2.

announcedRun in threadActivityAnnouncement.ts already handles the same case for screen-reader announcements by falling back to latestExecutedRun when the latest run was cancelled before it started.

Impact

Minor bug or occasional failure

In one week of local data this pattern (a cancelled run whose previous run completed after it) appeared 97 times against 1,174 completed Claude runs. Each of those turns hides its suggestion.

Version or commit

Desktop 0.1.9-nightly.20261110.4452. The same check is on main @ d1909d68f8

Environment

Windows 11, desktop app, Claude Code provider (Opus)

Logs or stack traces

1incoming {"type":"prompt_suggestion","suggestion":"…"} 03:52:42.727Z (run 1 completed 03:52:41.479Z)

Workaround

Wait for the turn to finish before sending the next message.