Issue 40038 performance proof

Two separate source worktrees, base 8cfd2b5211e9c377379a52195bdb31924655e845 and head 07cd361f50a89c2339968fb993f7a3f8b3d57403. Each installed with vp i and started with T3CODE_DEV_SEED=0 vp run dev --home-dir <scratch>/<side>. Fresh databases; synthetic projects created through /api/projects/mutate. Real browser at 1280x800, light theme. Videos scaled from device pixel ratio 2 and cropped to the same chat region to exclude machine labels.

Run proxy.py in scratch. It reads existing Anthropic connection configuration without publishing credentials. claude-wrapper.py runs real /usr/local/bin/claude (2.1.330) with the proxy as its API endpoint. Configure claudeAgent.config.binaryPath to that wrapper, customModels=["mercury-3"], textGenerationModelSelection={instanceId:"claudeAgent",model:"mercury-3"}, defaultModelSelection={instanceId:"devReplay",model:"showcase"} in each isolated settings.json.

The proxy returns an immediate HTTP 400 invalid_request_error ("Image inputs are not supported for this model") for messages with images. Other messages are forwarded to Haiku 5.5. No sleeps, synthetic delay or cached model responses. HTTP status, payload size and time are recorded without prompts or credentials.

In each paired web client, evaluate driver.js, then await proof.seed(<synthetic scratch directory>), then await proof.batch(16). Save proof.rows to <side>-rows.json. Driver uses the same WebSocket commands as the client, uploads a deterministic 240x180 260 KiB valid PNG, creates a new thread for every sample alternating two projects, and sends the same message. It measures from message dispatch until the generated title is persisted, polling at 50 ms. Each sample has a 120 second failure ceiling. Both versions use the same script. The first sample is excluded from each median. Head had already learned the model was text-only during the initial exploratory generation; its initial cold service span is retained in spans.ndjson. Later title samples measure the cache behavior the issue describes.

For a visible recording: set proof.watch=true, start browser recording, await proof.run(16), stop browser recording. This extra run is excluded from the performance sample. It navigates to the new thread without a document reload before dispatching its message. The videos show the title changing; the replay agent independently fails because this revision does not negotiate image prompt support. This is the same on base and head and does not prevent title generation.

collect.py retains only text-generation and Claude subprocess span timings across normal trace-file rotation. requests.ndjson records all proxy requests, including exploratory and recorded runs. spans.ndjson similarly includes exploration. base-rows.json and head-rows.json are the uninterrupted formal batches used by analyze.py. Run analyze.py then capture.py to regenerate measurement.json and the two measurement output PNGs. Full range (maximum minus minimum), not a trimmed range, is the spread criterion.

Observed result: later-title median 7.547s on base, 5.405s on head; improvement 2.142s (28.4%). Full sample ranges 1.672s and 1.517s, both smaller than the improvement. Fifteen later base generations sent 90 rejected image requests totaling 33,782,385 bytes; head sent zero.
