Skip to content

Instantly share code, notes, and snippets.

@only21mil
Created November 11, 2026 06:29
Show Gist options
  • Select an option

  • Save only21mil/3b348c323ff88d95ef3f61f7000e4774 to your computer and use it in GitHub Desktop.

Select an option

Save only21mil/3b348c323ff88d95ef3f61f7000e4774 to your computer and use it in GitHub Desktop.
#22549 fix(web): release route send state once a route is idle, verification transcript

#22549 verification transcript

Full text behind the excerpts in the PR description. Main ba4d01cf7f ran first, then this head 1e080f0ac0, on a T3 dev server named "Test machine" with synthetic data and the Replay (dev) provider. Readouts come from readout.js, a test script injected into the page that reads the app's in-memory route send-state Map through a test hook that is not part of the build; it draws nothing. Each readout was saved at the moment of its screenshot. Span listings come from launch-spans.py, which reads the test server's own trace file and prints each ws.rpc.orchestration.launchThread span (one per launch request the server receives); each listing was saved at its step with the time window shown in its last line. The excerpts in the description re-run launch-spans.py over launch-spans-head.ndjson, the launchThread span lines taken from the head server's trace files (the main server's trace has none), with the time window given on the command line. Each block below is one evidence file, unedited.

Unit tests, main ba4d01cf7f then this head 1e080f0ac0

tests-main.txt:

$ git rev-parse --short=10 HEAD
ba4d01cf7f
$ git show 1e080f0ac0:apps/web/src/components/ChatView.logic.test.ts > src/components/ChatView.logic.test.ts
$ vp test run --project unit --reporter verbose --hideSkippedTests src/components/ChatView.logic.test.ts -t "route send state" 2>&1 | grep -E "^ (×|✓)|^   →|Tests  "
 × |unit| src/components/ChatView.logic.test.ts > route send state > drops idle routes once they unmount 2ms
   → countDraftSendStatesForTests is not a function
 × |unit| src/components/ChatView.logic.test.ts > route send state > registers nothing for a render that never commits 0ms
   → countDraftSendStatesForTests is not a function
 × |unit| src/components/ChatView.logic.test.ts > route send state > keeps the same state across a remount while a send is in flight 0ms
   → draftSendState is not a function
 × |unit| src/components/ChatView.logic.test.ts > route send state > keeps an uncertain submission until its retry is allowed 0ms
   → draftSendState is not a function
 × |unit| src/components/ChatView.logic.test.ts > route send state > restores a state released by a double-invoked effect 0ms
   → draftSendState is not a function
 × |unit| src/components/ChatView.logic.test.ts > route send state > reports a newer send after the earlier state was released 0ms
   → draftSendState is not a function
      Tests  6 failed | 44 skipped (50)
$ git grep -n -E "draftSendStateByRouteKey\.(set|get|delete|clear)" HEAD -- src
HEAD:src/components/chat/chatViewSend.ts:60:  let state = draftSendStateByRouteKey.get(routeKey);
HEAD:src/components/chat/chatViewSend.ts:63:    draftSendStateByRouteKey.set(routeKey, state);

tests-head.txt:

$ git rev-parse --short=10 HEAD
1e080f0ac0
$ vp test run --project unit --reporter verbose --hideSkippedTests src/components/ChatView.logic.test.ts -t "route send state" 2>&1 | grep -E "^ (×|✓)|^   →|Tests  "
 ✓ |unit| src/components/ChatView.logic.test.ts > route send state > drops idle routes once they unmount 1ms
 ✓ |unit| src/components/ChatView.logic.test.ts > route send state > registers nothing for a render that never commits 0ms
 ✓ |unit| src/components/ChatView.logic.test.ts > route send state > keeps the same state across a remount while a send is in flight 1ms
 ✓ |unit| src/components/ChatView.logic.test.ts > route send state > keeps an uncertain submission until its retry is allowed 0ms
 ✓ |unit| src/components/ChatView.logic.test.ts > route send state > restores a state released by a double-invoked effect 0ms
 ✓ |unit| src/components/ChatView.logic.test.ts > route send state > reports a newer send after the earlier state was released 0ms
      Tests  6 passed | 44 skipped (50)
$ git grep -n -E "draftSendStateByRouteKey\.(set|get|delete|clear)" HEAD -- src
HEAD:src/components/ChatView.logic.ts:851:  const existing = draftSendStateByRouteKey.get(routeKey);
HEAD:src/components/ChatView.logic.ts:872:  if (!draftSendStateByRouteKey.has(routeKey)) draftSendStateByRouteKey.set(routeKey, state);
HEAD:src/components/ChatView.logic.ts:885:    draftSendStateByRouteKey.get(routeKey) === state
HEAD:src/components/ChatView.logic.ts:887:    draftSendStateByRouteKey.delete(routeKey);
HEAD:src/components/ChatView.logic.ts:893:  return draftSendStateByRouteKey.get(routeKey)?.sendInFlight.current === true;

tests-head-full.txt:

$ git rev-parse --short=10 HEAD
1e080f0ac0
$ cd apps/web
$ vp test run --project unit src/components/ChatView.logic.test.ts src/reactCompilerCoverage.test.ts
note: You are running `vp test` as a Vite+ built-in command. If you meant to run the test npm script, use `vpr test` instead.

 RUN  v5.0.5 /srv/t3code/apps/web


 Test Files  2 passed (2)
      Tests  1404 passed (1404)
   Start at  05:11:38
   Duration  9.56s (tests 88%, import 7%, transform 3%, setup 1%)

lint-fmt-typecheck-head.txt:

$ git rev-parse --short=10 HEAD
1e080f0ac0
$ vp lint apps/web/src/components/ChatView.logic.test.ts apps/web/src/components/ChatView.logic.ts apps/web/src/components/ChatView.tsx apps/web/src/components/chat/chatViewSend.ts apps/web/src/components/chat/useComposerResume.browser.test.tsx apps/web/src/components/chat/useComposerResume.ts apps/web/src/components/chat/useComposerSend.ts apps/web/src/components/chat/useMultipleModelSend.ts 
note: You are running `vp lint` as a Vite+ built-in command. If you meant to run the lint npm script, use `vpr lint` instead.
exit 0
$ vp fmt --check apps/web/src/components/ChatView.logic.test.ts apps/web/src/components/ChatView.logic.ts apps/web/src/components/ChatView.tsx apps/web/src/components/chat/chatViewSend.ts apps/web/src/components/chat/useComposerResume.browser.test.tsx apps/web/src/components/chat/useComposerResume.ts apps/web/src/components/chat/useComposerSend.ts apps/web/src/components/chat/useMultipleModelSend.ts 
Checking formatting...

All matched files use the correct format.
Finished in 110ms on 8 files using 32 threads.
exit 0
$ cd apps/web && vp run typecheck
1250 export class ThemeLibraryStorageError extends Schema.TaggedError<ThemeLibraryStorageError>()(
                                                                      ~~~~~~~~~~~~~~~~~~~~~~~~


exit 0

E1: idle routes (main, then this head)

readout-e1-main.txt:

readout 2026-11-11T06:02:44.527Z | main ba4d01cf7f | E1: after visiting Idle route 1..16 from the starting draft
launchThread frames sent by the page since mark: 0   held: 0   max Map size since reset: 17
route send-state Map size: 17
  route bf49b371…  state #1  sendInFlight false  uncertain []
  route c0ff23b9…  state #2  sendInFlight false  uncertain []
  route 5afedc7f…  state #3  sendInFlight false  uncertain []
  route e8d49fcb…  state #4  sendInFlight false  uncertain []
  route dc1aaf15…  state #5  sendInFlight false  uncertain []
  route 7fac1d14…  state #6  sendInFlight false  uncertain []
  route d474ac4c…  state #7  sendInFlight false  uncertain []
  route 9f9d43fe…  state #8  sendInFlight false  uncertain []
  route a7ee674d…  state #9  sendInFlight false  uncertain []
  route 4271ff7e…  state #10  sendInFlight false  uncertain []
  route ea08ee65…  state #11  sendInFlight false  uncertain []
  route 0f87337f…  state #12  sendInFlight false  uncertain []
  route 5c5b4848…  state #13  sendInFlight false  uncertain []
  route 66f0e4c3…  state #14  sendInFlight false  uncertain []
  route 61c0983c…  state #15  sendInFlight false  uncertain []
  route e3c88355…  state #16  sendInFlight false  uncertain []
  route 87819eb2…  state #17  sendInFlight false  uncertain []

readout-e1-main-settings.txt:

readout 2026-11-11T06:02:58.157Z | main ba4d01cf7f | E1: Settings opened afterwards (/settings/general)
launchThread frames sent by the page since mark: 0   held: 0   max Map size since reset: 17
route send-state Map size: 17
  route bf49b371…  state #1  sendInFlight false  uncertain []
  route c0ff23b9…  state #2  sendInFlight false  uncertain []
  route 5afedc7f…  state #3  sendInFlight false  uncertain []
  route e8d49fcb…  state #4  sendInFlight false  uncertain []
  route dc1aaf15…  state #5  sendInFlight false  uncertain []
  route 7fac1d14…  state #6  sendInFlight false  uncertain []
  route d474ac4c…  state #7  sendInFlight false  uncertain []
  route 9f9d43fe…  state #8  sendInFlight false  uncertain []
  route a7ee674d…  state #9  sendInFlight false  uncertain []
  route 4271ff7e…  state #10  sendInFlight false  uncertain []
  route ea08ee65…  state #11  sendInFlight false  uncertain []
  route 0f87337f…  state #12  sendInFlight false  uncertain []
  route 5c5b4848…  state #13  sendInFlight false  uncertain []
  route 66f0e4c3…  state #14  sendInFlight false  uncertain []
  route 61c0983c…  state #15  sendInFlight false  uncertain []
  route e3c88355…  state #16  sendInFlight false  uncertain []
  route 87819eb2…  state #17  sendInFlight false  uncertain []

readout-e1-head.txt:

readout 2026-11-11T06:04:54.466Z | head 1e080f0ac0 | E1: after visiting Idle route 1..16 from the starting draft
launchThread frames sent by the page since mark: 0   held: 0   max Map size since reset: 1
route send-state Map size: 1
  route 5fdf32c9…  state #1  consumers 1  sendInFlight false  uncertain []

A2: on another thread while the draft's launch is held

readout-a2-head.txt:

readout 2026-11-11T06:05:58.080Z | head 1e080f0ac0 | A2: on Idle route 1 while the launch is held (/2b38b414-b079-4494-aab6-9ef07f62b624/mcp%3A19099690-6490-4390-970b-1d201dad18e8)
launchThread frames sent by the page since mark: 1   held: 1   max Map size since reset: 2
route send-state Map size: 2
  route 4a0cc9ea…  state #1  consumers 0  sendInFlight true  uncertain []
  route 19099690…  state #2  consumers 1  sendInFlight false  uncertain []

server-launch-spans-a2.txt:

launchThread spans since 2026-11-11T06:05:00Z: 0

A4: back on the draft, Enter and the send button

readout-a4-head.txt:

readout 2026-11-11T06:06:11.999Z | head 1e080f0ac0 | A3: back on the draft via history.back() (/draft/876d079e-bce5-4dcc-8ebe-15aea9d59182)
launchThread frames sent by the page since mark: 1   held: 1   max Map size since reset: 2
route send-state Map size: 1
  route 4a0cc9ea…  state #1  consumers 1  sendInFlight true  uncertain []
composer text: "\n"
readout 2026-11-11T06:06:25.546Z | head 1e080f0ac0 | A4a: typed a second prompt and pressed Enter (/draft/876d079e-bce5-4dcc-8ebe-15aea9d59182)
launchThread frames sent by the page since mark: 1   held: 1   max Map size since reset: 2
route send-state Map size: 1
  route 4a0cc9ea…  state #1  consumers 1  sendInFlight true  uncertain []
composer text: "E2E-A second send attempt"
readout 2026-11-11T06:06:33.009Z | head 1e080f0ac0 | A4: after Enter and a send-button click with a second prompt (/draft/876d079e-bce5-4dcc-8ebe-15aea9d59182)
launchThread frames sent by the page since mark: 1   held: 1   max Map size since reset: 2
route send-state Map size: 1
  route 4a0cc9ea…  state #1  consumers 1  sendInFlight true  uncertain []
composer text: "E2E-A second send attempt"

server-launch-spans-a4.txt:

launchThread spans since 2026-11-11T06:05:00Z: 0

A5: after the release

readout-a5-head.txt:

released 1 frame(s) at 2026-11-11T06:06:46.873Z
readout 2026-11-11T06:06:56.692Z | head 1e080f0ac0 | A5: 6 s after the release (/2b38b414-b079-4494-aab6-9ef07f62b624/4a0cc9ea-6897-40f5-896f-f5d76402d711)
launchThread frames sent by the page since mark: 1   held: 0   max Map size since reset: 2
route send-state Map size: 1
  route 4a0cc9ea…  state #1  consumers 1  sendInFlight false  uncertain []
user messages in DOM ([data-message-role="user"]): 1
composer text: "E2E-A second send attempt"

server-launch-spans-a5.txt:

2026-11-11T06:06:46.877Z  ws.rpc.orchestration.launchThread  99.8 ms  exit Success
launchThread spans since 2026-11-11T06:05:00Z: 1

B2: uncertain multiple-model start

readout-b2-head.txt:

armed at 2026-11-11T06:07:34.320Z; composer: "E2E-B two models, uncertain"
readout 2026-11-11T06:07:41.636Z | head 1e080f0ac0 | B2: after Enter with two models, socket closed after 2 launch frames (/draft/87fe5709-61c7-4c9b-9b13-d5681933a64e)
launchThread frames sent by the page since mark: 2   held: 0   max Map size since reset: 2
route send-state Map size: 1
  route 66230d45…  state #3  consumers 1  sendInFlight false  uncertain [multi-turn, showcase]

server-launch-spans-b2.txt:

2026-11-11T06:07:35.812Z  ws.rpc.orchestration.launchThread  11.5 ms  exit Interrupted
2026-11-11T06:07:35.813Z  ws.rpc.orchestration.launchThread  10.8 ms  exit Interrupted
launchThread spans since 2026-11-11T06:07:00Z: 2

B5: away, back, send again

readout-b5-head.txt:

readout 2026-11-11T06:08:04.528Z | head 1e080f0ac0 | B3: away on Idle route 2 (/2b38b414-b079-4494-aab6-9ef07f62b624/mcp%3Aee9fab5d-9aef-4b5e-8256-ff01e1b13ff0)
launchThread frames sent by the page since mark: 2   held: 0   max Map size since reset: 2
route send-state Map size: 2
  route 66230d45…  state #3  consumers 0  sendInFlight false  uncertain [multi-turn, showcase]
  route ee9fab5d…  state #4  consumers 1  sendInFlight false  uncertain []
readout 2026-11-11T06:08:08.156Z | head 1e080f0ac0 | B4: back on the draft via history.back() (/draft/87fe5709-61c7-4c9b-9b13-d5681933a64e)
launchThread frames sent by the page since mark: 2   held: 0   max Map size since reset: 2
route send-state Map size: 1
  route 66230d45…  state #3  consumers 1  sendInFlight false  uncertain [multi-turn, showcase]
marked at 2026-11-11T06:08:15.574Z; models: Multi turn, Showcase
readout 2026-11-11T06:08:22.394Z | head 1e080f0ac0 | B5: sent again after Back (/draft/87fe5709-61c7-4c9b-9b13-d5681933a64e)
launchThread frames sent by the page since mark: 0   held: 0   max Map size since reset: 2
route send-state Map size: 1
  route 66230d45…  state #3  consumers 1  sendInFlight false  uncertain [multi-turn, showcase]
composer text: "\n"

server-launch-spans-b5.txt:

launchThread spans since 2026-11-11T06:08:15Z: 0

C3: Allow retry, send again

readout-c3-head.txt:

readout 2026-11-11T06:08:45.696Z | head 1e080f0ac0 | C2: Allow retry on showcase, Confirm (/draft/87fe5709-61c7-4c9b-9b13-d5681933a64e)
launchThread frames sent by the page since mark: 0   held: 0   max Map size since reset: 2
route send-state Map size: 1
  route 66230d45…  state #3  consumers 1  sendInFlight false  uncertain [multi-turn]
marked at 2026-11-11T06:08:52.800Z; composer: "E2E-C send after allow retry"
readout 2026-11-11T06:09:03.468Z | head 1e080f0ac0 | C3: 8 s after the new send (/draft/87fe5709-61c7-4c9b-9b13-d5681933a64e)
launchThread frames sent by the page since mark: 1   held: 0   max Map size since reset: 2
route send-state Map size: 1
  route 66230d45…  state #3  consumers 1  sendInFlight false  uncertain [multi-turn]
toasts at 2026-11-11T06:09:51.820Z:
A background prompt could not be sent Your newer draft is unchanged. Restore the failed prompt when this composer is empty. Restore prompt
Could not start multi-turn The previous request may have started. Open its thread to check before sending again. Allow retry Open thread
A background prompt could not be sent Your newer draft is unchanged. Restore the failed prompt when this composer is empty. Restore prompt
Could not start multi-turn The previous request may have started. Open its thread to check before sending again. Allow retry Open thread
A background prompt could not be sent Your newer draft is unchanged. Restore the failed prompt when this composer is empty. Restore prompt
Could not start showcase All fibers interrupted without error Allow retry Open thread
Could not start multi-turn All fibers interrupted without error Allow retry Open thread

server-launch-spans-c3.txt:

2026-11-11T06:08:54.086Z  ws.rpc.orchestration.launchThread  40.0 ms  exit Success
launchThread spans since 2026-11-11T06:08:52Z: 1

C4: the retried thread

c4-thread-text.txt:

C4 at 2026-11-11T06:10:12.141Z (/2b38b414-b079-4494-aab6-9ef07f62b624/5f1f4d6b-99f8-4501-a436-f2ccea7c71d1)
user messages in DOM ([data-message-role="user"]): 1
thread text:
E2
e2e-repo
/
E2E-C send after allow retry
You
E2E-C send after allow retry
6:08 AM
Worked for 5.2s
6:08 AM
T3 Code
Done
I added clamp next to sum and the tests pass.
Reads the manifest first
Asks before it writes
Streams a terminal result
clamp(12, 0, 10); // 10
clamp(-3, 0, 10); // 0
Step	Tool	Result
Read	read	1 file
Edit	edit	+4 lines
Test	execute	12 passed
This turn is a replay. It costs nothing, so send it again as often as you need.
6:08 AM
Ask anything. @ files, $ skills, / commands
Showcase
Test machine
Open in editor
Add project script
t3/adfa762d
Publish repository
Changes
vs main
+0
-0

D2/D3: entry dropped, then a new state on the draft

readout-d2-head.txt:

readout 2026-11-11T06:11:02.350Z | head 1e080f0ac0 | D2: on the E2E-C thread, Allow retry on multi-turn, Confirm (/2b38b414-b079-4494-aab6-9ef07f62b624/5f1f4d6b-99f8-4501-a436-f2ccea7c71d1)
launchThread frames sent by the page since mark: 1   held: 0   max Map size since reset: 2
route send-state Map size: 1
  route 5f1f4d6b…  state #5  consumers 1  sendInFlight false  uncertain []

D5: Restore prompt refused while a newer send is held (D3 to D6 readouts)

readout-d3-d5-head.txt:

readout 2026-11-11T06:11:17.495Z | head 1e080f0ac0 | D3: back on the draft via history.back() (/draft/87fe5709-61c7-4c9b-9b13-d5681933a64e)
launchThread frames sent by the page since mark: 1   held: 0   max Map size since reset: 2
route send-state Map size: 1
  route 66230d45…  state #6  consumers 1  sendInFlight false  uncertain []
hold on at 2026-11-11T06:11:56.109Z; composer: "E2E-D newer send held"; models: Showcase
readout 2026-11-11T06:12:00.043Z | head 1e080f0ac0 | D4: one model, newer send held (/draft/87fe5709-61c7-4c9b-9b13-d5681933a64e)
launchThread frames sent by the page since mark: 1   held: 1   max Map size since reset: 2
route send-state Map size: 1
  route 66230d45…  state #6  consumers 1  sendInFlight true  uncertain []
composer text: "\n"
readout 2026-11-11T06:12:10.357Z | head 1e080f0ac0 | D5: Restore prompt on an earlier failure toast (/draft/87fe5709-61c7-4c9b-9b13-d5681933a64e)
launchThread frames sent by the page since mark: 1   held: 1   max Map size since reset: 2
route send-state Map size: 1
  route 66230d45…  state #6  consumers 1  sendInFlight true  uncertain []
composer text: "\n"
models: Showcase
toasts:
A background prompt could not be sent Return to the original draft and send or clear its current prompt before restoring. Restore prompt
A background prompt could not be sent Your newer draft is unchanged. Restore the failed prompt when this composer is empty. Restore prompt
Could not start multi-turn The previous request may have started. Open its thread to check before sending again. Allow retry Open thread
A background prompt could not be sent Your newer draft is unchanged. Restore the failed prompt when this composer is empty. Restore prompt
Could not start showcase All fibers interrupted without error Allow retry Open thread
Could not start multi-turn All fibers interrupted without error Allow retry Open thread
released 1 frame(s) at 2026-11-11T06:12:25.763Z
readout 2026-11-11T06:12:35.690Z | head 1e080f0ac0 | D6: 6 s after the release (/2b38b414-b079-4494-aab6-9ef07f62b624/66230d45-0ef3-4977-adba-d113bb5534f2)
launchThread frames sent by the page since mark: 1   held: 0   max Map size since reset: 2
route send-state Map size: 1
  route 66230d45…  state #6  consumers 1  sendInFlight false  uncertain []

server-launch-spans-d5.txt:

launchThread spans since 2026-11-11T06:11:56Z: 0

server-launch-spans-d6.txt:

2026-11-11T06:12:25.764Z  ws.rpc.orchestration.launchThread  48.0 ms  exit Success
launchThread spans since 2026-11-11T06:11:56Z: 1

All launch spans in each server's trace

server-launch-spans-main-all.txt:

launchThread spans: 0

server-launch-spans-head-all.txt:

2026-11-11T06:06:46.877Z  ws.rpc.orchestration.launchThread  99.8 ms  exit Success
2026-11-11T06:07:35.812Z  ws.rpc.orchestration.launchThread  11.5 ms  exit Interrupted
2026-11-11T06:07:35.813Z  ws.rpc.orchestration.launchThread  10.8 ms  exit Interrupted
2026-11-11T06:08:54.086Z  ws.rpc.orchestration.launchThread  40.0 ms  exit Success
2026-11-11T06:12:25.764Z  ws.rpc.orchestration.launchThread  48.0 ms  exit Success
launchThread spans: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment