# R05 — New tab and second thread

Environment: fs-50; Linux 6.8.0-117-generic x86_64; Node v26.12.1; Playwright 1.60.0; Chrome Headless Shell 157.0.8103.38; isolated dev:server, T3CODE_DEV_SEED=0, fresh per-checkout SQLite; synthetic Fx fixture; RPC/MCP over loopback; UTC timestamps.

Scripted interaction (same inputs on both revisions; generated ids differ): After the held-tab refusals and the fixed reconnect allowance, open B in the owner session and C in a second synthetic thread; evaluate and status each.

What differed: Both can recover through fresh tabs. After keeps the same server-browser host connection; before needs broker reconnections after timeouts.

## C1 steps and timestamps

Before step times (UTC):

```jsonl
{"time":"2026-11-10T11:41:04.858Z","tool":"preview_open","caller":0,"args":{"reuseExistingTab":false,"open":false}}
{"time":"2026-11-10T11:41:05.152Z","tool":"preview_recording_start","caller":0,"args":{"tabId":"tab_1_1322bfd2-cca3-4137-992e-c9da3d086a36"}}
{"time":"2026-11-10T11:41:05.619Z","tool":"preview_set_appearance","caller":0,"args":{"tabId":"tab_1_1322bfd2-cca3-4137-992e-c9da3d086a36","colorScheme":"dark"}}
{"time":"2026-11-10T11:41:27.173Z","tool":"preview_open","caller":0,"args":{"reuseExistingTab":false,"open":false}}
{"time":"2026-11-10T11:41:27.227Z","tool":"preview_evaluate","caller":0,"args":{"tabId":"tab_2_1322bfd2-cca3-4137-992e-c9da3d086a36","expression":"document.body.dataset.probe=\"ok\"; \"ok\""}}
{"time":"2026-11-10T11:41:27.239Z","tool":"preview_open","caller":1,"args":{"reuseExistingTab":false,"open":false}}
{"time":"2026-11-10T11:41:27.297Z","tool":"preview_evaluate","caller":1,"args":{"tabId":"tab_3_1322bfd2-cca3-4137-992e-c9da3d086a36","expression":"\"second thread works\""}}
{"time":"2026-11-10T11:41:27.311Z","tool":"preview_status","caller":1,"args":{"tabId":"tab_3_1322bfd2-cca3-4137-992e-c9da3d086a36"}}
```

After step times (UTC):

```jsonl
{"time":"2026-11-10T11:39:22.279Z","tool":"preview_open","caller":0,"args":{"reuseExistingTab":false,"open":false}}
{"time":"2026-11-10T11:39:22.933Z","tool":"preview_recording_start","caller":0,"args":{"tabId":"tab_1_b49bf147-bc21-4874-9243-25ceadea1fd3"}}
{"time":"2026-11-10T11:39:23.623Z","tool":"preview_set_appearance","caller":0,"args":{"tabId":"tab_1_b49bf147-bc21-4874-9243-25ceadea1fd3","colorScheme":"dark"}}
{"time":"2026-11-10T11:39:42.398Z","tool":"preview_open","caller":0,"args":{"reuseExistingTab":false,"open":false}}
{"time":"2026-11-10T11:39:42.445Z","tool":"preview_evaluate","caller":0,"args":{"tabId":"tab_2_b49bf147-bc21-4874-9243-25ceadea1fd3","expression":"document.body.dataset.probe=\"ok\"; \"ok\""}}
{"time":"2026-11-10T11:39:42.457Z","tool":"preview_open","caller":1,"args":{"reuseExistingTab":false,"open":false}}
{"time":"2026-11-10T11:39:42.517Z","tool":"preview_evaluate","caller":1,"args":{"tabId":"tab_3_b49bf147-bc21-4874-9243-25ceadea1fd3","expression":"\"second thread works\""}}
{"time":"2026-11-10T11:39:42.528Z","tool":"preview_status","caller":1,"args":{"tabId":"tab_3_b49bf147-bc21-4874-9243-25ceadea1fd3"}}
```

<a id="before"></a>
## Before — C1

SHA: [fa2f4ff2a2](https://github.com/pingdotgg/t3code/commit/fa2f4ff2a2bac5ac92e07749f6b83b0003d642a0)

Agent-visible results (status/list fields selected; error text verbatim):

```jsonl
{"time":"2026-11-10T11:41:05.151Z","tool":"preview_open","caller":0,"result":{"isError":false,"selectedStatusFields":{"available":true,"tabId":"tab_1_1322bfd2-cca3-4137-992e-c9da3d086a36","url":null,"loading":false,"control":{"owner":"agent","ownedByCaller":true,"generation":0},"dialog":null,"viewportSetting":{"_tag":"fill"},"viewport":{"width":1280,"height":800},"tabs":[{"tabId":"tab_1_1322bfd2-cca3-4137-992e-c9da3d086a36","owner":"agent","ownedByCaller":true}]}}}
{"time":"2026-11-10T11:41:05.619Z","tool":"preview_recording_start","caller":0,"result":{"isError":false,"structuredContent":{"tabId":"tab_1_1322bfd2-cca3-4137-992e-c9da3d086a36","recording":true,"startedAt":"2026-11-10T11:41:05.615Z"}}}
{"time":"2026-11-10T11:41:21.634Z","tool":"preview_set_appearance","caller":0,"result":{"content":[{"type":"text","text":"Preview automation setColorScheme timed out after 15000ms."}],"isError":true}}
{"time":"2026-11-10T11:41:27.226Z","tool":"preview_open","caller":0,"result":{"isError":false,"selectedStatusFields":{"available":true,"tabId":"tab_2_1322bfd2-cca3-4137-992e-c9da3d086a36","url":null,"loading":false,"control":{"owner":"agent","ownedByCaller":true,"generation":0},"dialog":null,"viewportSetting":{"_tag":"fill"},"viewport":{"width":1280,"height":800},"tabs":[{"tabId":"tab_1_1322bfd2-cca3-4137-992e-c9da3d086a36","owner":"agent","ownedByCaller":true},{"tabId":"tab_2_1322bfd2-cca3-4137-992e-c9da3d086a36","owner":"agent","ownedByCaller":true}]}}}
{"time":"2026-11-10T11:41:27.238Z","tool":"preview_evaluate","caller":0,"result":{"isError":false,"structuredContent":{"value":"ok"}}}
{"time":"2026-11-10T11:41:27.297Z","tool":"preview_open","caller":1,"result":{"isError":false,"selectedStatusFields":{"available":true,"tabId":"tab_3_1322bfd2-cca3-4137-992e-c9da3d086a36","url":null,"loading":false,"control":{"owner":"agent","ownedByCaller":true,"generation":0},"dialog":null,"viewportSetting":{"_tag":"fill"},"viewport":{"width":1280,"height":800},"tabs":[{"tabId":"tab_3_1322bfd2-cca3-4137-992e-c9da3d086a36","owner":"agent","ownedByCaller":true}]}}}
{"time":"2026-11-10T11:41:27.311Z","tool":"preview_evaluate","caller":1,"result":{"isError":false,"structuredContent":{"value":"second thread works"}}}
{"time":"2026-11-10T11:41:27.317Z","tool":"preview_status","caller":1,"result":{"isError":false,"selectedStatusFields":{"available":true,"tabId":"tab_3_1322bfd2-cca3-4137-992e-c9da3d086a36","url":null,"loading":false,"control":{"owner":"agent","ownedByCaller":true,"generation":0},"dialog":null,"viewportSetting":{"_tag":"fill"},"viewport":{"width":1280,"height":800},"tabs":[{"tabId":"tab_3_1322bfd2-cca3-4137-992e-c9da3d086a36","owner":"agent","ownedByCaller":true}]}}}
```

Relevant server milestones:

```jsonl
{"time":"2026-11-10T11:40:40.304Z","event":"host.connected","connectionId":"3544549b-189b-45a7-82f5-323c2a31b83d"}
{"time":"2026-11-10T11:41:04.869Z","event":"request.start","operation":"open","requestId":"preview-0","timeoutMs":660000,"connectionId":"3544549b-189b-45a7-82f5-323c2a31b83d"}
{"time":"2026-11-10T11:41:05.142Z","tabId":"tab_1_1322bfd2-cca3-4137-992e-c9da3d086a36","event":"tab.created","detail":{"desktop":false,"isolatedContext":true}}
{"time":"2026-11-10T11:41:05.144Z","event":"operation.settled","requestId":"preview-0","operation":"open","ok":true}
{"time":"2026-11-10T11:41:05.157Z","event":"request.start","operation":"recordingStart","requestId":"preview-1","tabId":"tab_1_1322bfd2-cca3-4137-992e-c9da3d086a36","timeoutMs":15000,"connectionId":"3544549b-189b-45a7-82f5-323c2a31b83d"}
{"time":"2026-11-10T11:41:05.615Z","event":"operation.settled","requestId":"preview-1","operation":"recordingStart","ok":true}
{"time":"2026-11-10T11:41:05.627Z","event":"request.start","operation":"setColorScheme","requestId":"preview-3","tabId":"tab_1_1322bfd2-cca3-4137-992e-c9da3d086a36","timeoutMs":15000,"connectionId":"3544549b-189b-45a7-82f5-323c2a31b83d"}
{"time":"2026-11-10T11:41:05.628Z","tabId":"tab_1_1322bfd2-cca3-4137-992e-c9da3d086a36","event":"emulateMedia.start","detail":[{"colorScheme":"dark"}]}
{"time":"2026-11-10T11:41:05.628Z","tabId":"tab_1_1322bfd2-cca3-4137-992e-c9da3d086a36","event":"emulateMedia.held","detail":{}}
{"time":"2026-11-10T11:41:22.632Z","event":"host.connected","connectionId":"b8744c25-255d-49da-99b2-c9b7d2fa21c8"}
{"time":"2026-11-10T11:41:26.652Z","event":"host.connected","connectionId":"e4558845-047d-4489-8aed-1f3ec563d9e4"}
{"time":"2026-11-10T11:41:27.181Z","event":"request.start","operation":"open","requestId":"preview-13","tabId":"tab_1_1322bfd2-cca3-4137-992e-c9da3d086a36","timeoutMs":660000,"connectionId":"e4558845-047d-4489-8aed-1f3ec563d9e4"}
{"time":"2026-11-10T11:41:27.221Z","tabId":"tab_2_1322bfd2-cca3-4137-992e-c9da3d086a36","event":"tab.created","detail":{"desktop":false,"isolatedContext":true}}
{"time":"2026-11-10T11:41:27.223Z","event":"operation.settled","requestId":"preview-13","operation":"open","ok":true}
{"time":"2026-11-10T11:41:27.234Z","event":"request.start","operation":"evaluate","requestId":"preview-14","tabId":"tab_2_1322bfd2-cca3-4137-992e-c9da3d086a36","timeoutMs":15000,"connectionId":"e4558845-047d-4489-8aed-1f3ec563d9e4"}
{"time":"2026-11-10T11:41:27.236Z","event":"operation.settled","requestId":"preview-14","operation":"evaluate","ok":true}
{"time":"2026-11-10T11:41:27.248Z","event":"request.start","operation":"open","requestId":"preview-16","timeoutMs":660000,"connectionId":"e4558845-047d-4489-8aed-1f3ec563d9e4"}
{"time":"2026-11-10T11:41:27.291Z","tabId":"tab_3_1322bfd2-cca3-4137-992e-c9da3d086a36","event":"tab.created","detail":{"desktop":false,"isolatedContext":true}}
{"time":"2026-11-10T11:41:27.292Z","event":"operation.settled","requestId":"preview-16","operation":"open","ok":true}
{"time":"2026-11-10T11:41:27.305Z","event":"request.start","operation":"evaluate","requestId":"preview-17","tabId":"tab_3_1322bfd2-cca3-4137-992e-c9da3d086a36","timeoutMs":15000,"connectionId":"e4558845-047d-4489-8aed-1f3ec563d9e4"}
{"time":"2026-11-10T11:41:27.307Z","event":"operation.settled","requestId":"preview-17","operation":"evaluate","ok":true}
{"time":"2026-11-10T11:41:27.313Z","event":"request.start","operation":"status","requestId":"preview-19","tabId":"tab_3_1322bfd2-cca3-4137-992e-c9da3d086a36","timeoutMs":15000,"connectionId":"e4558845-047d-4489-8aed-1f3ec563d9e4"}
{"time":"2026-11-10T11:41:27.314Z","event":"operation.settled","requestId":"preview-19","operation":"status","ok":true}
{"time":"2026-11-10T11:41:28.039Z","tabId":"tab_1_1322bfd2-cca3-4137-992e-c9da3d086a36","event":"emulateMedia.error","detail":"Error: page.emulateMedia: Target page, context or browser has been closed"}
{"time":"2026-11-10T11:41:28.039Z","event":"operation.settled","requestId":"preview-3","operation":"setColorScheme","ok":false,"error":"Error: page.emulateMedia: Target page, context or browser has been closed"}
```

<a id="after"></a>
## After — C1

SHA: [b088b88d19](https://github.com/pingdotgg/t3code/commit/b088b88d19fb0edc43f754da2e1d199bda70d6d8)

Agent-visible results (status/list fields selected; error text verbatim):

```jsonl
{"time":"2026-11-10T11:39:22.933Z","tool":"preview_open","caller":0,"result":{"isError":false,"selectedStatusFields":{"available":true,"tabId":"tab_1_b49bf147-bc21-4874-9243-25ceadea1fd3","url":null,"loading":false,"control":{"owner":"agent","ownedByCaller":true,"generation":0},"dialog":null,"viewportSetting":{"_tag":"fill"},"viewport":{"width":1280,"height":800},"tabs":[{"tabId":"tab_1_b49bf147-bc21-4874-9243-25ceadea1fd3","owner":"agent","ownedByCaller":true}]}}}
{"time":"2026-11-10T11:39:23.621Z","tool":"preview_recording_start","caller":0,"result":{"isError":false,"structuredContent":{"tabId":"tab_1_b49bf147-bc21-4874-9243-25ceadea1fd3","recording":true,"startedAt":"2026-11-10T11:39:23.612Z"}}}
{"time":"2026-11-10T11:39:39.162Z","tool":"preview_set_appearance","caller":0,"result":{"content":[{"type":"text","text":"Preview automation setColorScheme timed out after 15000ms."}],"isError":true}}
{"time":"2026-11-10T11:39:42.444Z","tool":"preview_open","caller":0,"result":{"isError":false,"selectedStatusFields":{"available":true,"tabId":"tab_2_b49bf147-bc21-4874-9243-25ceadea1fd3","url":null,"loading":false,"control":{"owner":"agent","ownedByCaller":true,"generation":0},"dialog":null,"viewportSetting":{"_tag":"fill"},"viewport":{"width":1280,"height":800},"tabs":[{"tabId":"tab_1_b49bf147-bc21-4874-9243-25ceadea1fd3","owner":"agent","ownedByCaller":true},{"tabId":"tab_2_b49bf147-bc21-4874-9243-25ceadea1fd3","owner":"agent","ownedByCaller":true}]}}}
{"time":"2026-11-10T11:39:42.457Z","tool":"preview_evaluate","caller":0,"result":{"isError":false,"structuredContent":{"value":"ok"}}}
{"time":"2026-11-10T11:39:42.517Z","tool":"preview_open","caller":1,"result":{"isError":false,"selectedStatusFields":{"available":true,"tabId":"tab_3_b49bf147-bc21-4874-9243-25ceadea1fd3","url":null,"loading":false,"control":{"owner":"agent","ownedByCaller":true,"generation":0},"dialog":null,"viewportSetting":{"_tag":"fill"},"viewport":{"width":1280,"height":800},"tabs":[{"tabId":"tab_3_b49bf147-bc21-4874-9243-25ceadea1fd3","owner":"agent","ownedByCaller":true}]}}}
{"time":"2026-11-10T11:39:42.527Z","tool":"preview_evaluate","caller":1,"result":{"isError":false,"structuredContent":{"value":"second thread works"}}}
{"time":"2026-11-10T11:39:42.536Z","tool":"preview_status","caller":1,"result":{"isError":false,"selectedStatusFields":{"available":true,"tabId":"tab_3_b49bf147-bc21-4874-9243-25ceadea1fd3","url":null,"loading":false,"control":{"owner":"agent","ownedByCaller":true,"generation":0},"dialog":null,"viewportSetting":{"_tag":"fill"},"viewport":{"width":1280,"height":800},"tabs":[{"tabId":"tab_3_b49bf147-bc21-4874-9243-25ceadea1fd3","owner":"agent","ownedByCaller":true}]}}}
```

Relevant server milestones:

```jsonl
{"time":"2026-11-10T11:38:06.533Z","event":"host.connected","connectionId":"61893f52-5b7b-45e6-b0a0-72e49d4ebf16"}
{"time":"2026-11-10T11:39:22.295Z","event":"request.start","operation":"open","requestId":"preview-0","timeoutMs":660000,"connectionId":"61893f52-5b7b-45e6-b0a0-72e49d4ebf16"}
{"time":"2026-11-10T11:39:22.916Z","tabId":"tab_1_b49bf147-bc21-4874-9243-25ceadea1fd3","event":"tab.created","detail":{"desktop":false,"isolatedContext":true}}
{"time":"2026-11-10T11:39:22.920Z","event":"operation.settled","requestId":"preview-0","operation":"open","ok":true}
{"time":"2026-11-10T11:39:22.943Z","event":"request.start","operation":"recordingStart","requestId":"preview-1","tabId":"tab_1_b49bf147-bc21-4874-9243-25ceadea1fd3","timeoutMs":15000,"connectionId":"61893f52-5b7b-45e6-b0a0-72e49d4ebf16"}
{"time":"2026-11-10T11:39:23.612Z","event":"operation.settled","requestId":"preview-1","operation":"recordingStart","ok":true}
{"time":"2026-11-10T11:39:23.652Z","event":"request.start","operation":"setColorScheme","requestId":"preview-3","tabId":"tab_1_b49bf147-bc21-4874-9243-25ceadea1fd3","timeoutMs":15000,"connectionId":"61893f52-5b7b-45e6-b0a0-72e49d4ebf16"}
{"time":"2026-11-10T11:39:23.654Z","tabId":"tab_1_b49bf147-bc21-4874-9243-25ceadea1fd3","event":"emulateMedia.start","detail":[{"colorScheme":"dark"}]}
{"time":"2026-11-10T11:39:23.655Z","tabId":"tab_1_b49bf147-bc21-4874-9243-25ceadea1fd3","event":"emulateMedia.held","detail":{}}
{"time":"2026-11-10T11:39:42.405Z","event":"request.start","operation":"open","requestId":"preview-13","tabId":"tab_1_b49bf147-bc21-4874-9243-25ceadea1fd3","timeoutMs":660000,"connectionId":"61893f52-5b7b-45e6-b0a0-72e49d4ebf16"}
{"time":"2026-11-10T11:39:42.438Z","tabId":"tab_2_b49bf147-bc21-4874-9243-25ceadea1fd3","event":"tab.created","detail":{"desktop":false,"isolatedContext":true}}
{"time":"2026-11-10T11:39:42.439Z","event":"operation.settled","requestId":"preview-13","operation":"open","ok":true}
{"time":"2026-11-10T11:39:42.451Z","event":"request.start","operation":"evaluate","requestId":"preview-14","tabId":"tab_2_b49bf147-bc21-4874-9243-25ceadea1fd3","timeoutMs":15000,"connectionId":"61893f52-5b7b-45e6-b0a0-72e49d4ebf16"}
{"time":"2026-11-10T11:39:42.453Z","event":"operation.settled","requestId":"preview-14","operation":"evaluate","ok":true}
{"time":"2026-11-10T11:39:42.465Z","event":"request.start","operation":"open","requestId":"preview-16","timeoutMs":660000,"connectionId":"61893f52-5b7b-45e6-b0a0-72e49d4ebf16"}
{"time":"2026-11-10T11:39:42.509Z","tabId":"tab_3_b49bf147-bc21-4874-9243-25ceadea1fd3","event":"tab.created","detail":{"desktop":false,"isolatedContext":true}}
{"time":"2026-11-10T11:39:42.511Z","event":"operation.settled","requestId":"preview-16","operation":"open","ok":true}
{"time":"2026-11-10T11:39:42.524Z","event":"request.start","operation":"evaluate","requestId":"preview-17","tabId":"tab_3_b49bf147-bc21-4874-9243-25ceadea1fd3","timeoutMs":15000,"connectionId":"61893f52-5b7b-45e6-b0a0-72e49d4ebf16"}
{"time":"2026-11-10T11:39:42.525Z","event":"operation.settled","requestId":"preview-17","operation":"evaluate","ok":true}
{"time":"2026-11-10T11:39:42.532Z","event":"request.start","operation":"status","requestId":"preview-19","tabId":"tab_3_b49bf147-bc21-4874-9243-25ceadea1fd3","timeoutMs":15000,"connectionId":"61893f52-5b7b-45e6-b0a0-72e49d4ebf16"}
{"time":"2026-11-10T11:39:42.532Z","event":"operation.settled","requestId":"preview-19","operation":"status","ok":true}
{"time":"2026-11-10T11:39:43.251Z","tabId":"tab_1_b49bf147-bc21-4874-9243-25ceadea1fd3","event":"emulateMedia.error","detail":"Error: page.emulateMedia: Target page, context or browser has been closed"}
{"time":"2026-11-10T11:39:43.252Z","event":"operation.settled","requestId":"preview-3","operation":"setColorScheme","ok":false,"error":"Error: page.emulateMedia: Target page, context or browser has been closed"}
```

AI-assisted; verified with the tests and tools listed above.
