# T3 Code + Pydantic Logfire recording handoff

Copy setup.txt into your coding agent. It prepares a separate desktop with three constructed chats and an empty investigation thread, publishes a fresh baseline to your Logfire project, and stops before the investigation. You supply your own Logfire token locally and complete account sign-in.

Source PR: https://github.com/pingdotgg/t3code/pull/13671
Pinned commit: b83de9d84a86a687642f3514094ae2480d816a13
Source branch: demo/logfire-title-handoff in SunkenInTime/t3code.
Demo only. DO NOT MERGE. This branch deliberately reproduces a title-input truncation regression; it is not a claim about released T3 Code.

## What you get

- The same three first-message inputs and recorded starting titles. No personal thread database is distributed.
- A separate T3 Code Dev desktop with an Astra Medium investigator.
- Native Logfire Agent Run conversations, intermediate replies, model spans and nested MCP tool arguments/results. Messages appear in Live while the turn runs.
- One baseline and one after evaluation using the real T3 title prompt builder and Codex adapter with Luna.

The source repository supplies the runnable app. This small download contains the setup and recording prompts, the constructed corpus, recorded reference results, and a manifest. Installing and building the app happens before recording. Runtime has been verified on macOS; this handoff does not certify a fresh Windows or Linux desktop build.

## Accounts and tools

Git, Node 24, vp, uv, an authenticated Codex CLI with gpt-6-luna and gpt-6-astra access, and your own Logfire project with write-token and MCP access. The handoff page requires no login. Your model provider and Logfire still require their normal authentication. Model calls consume your account usage.

## Manual setup

Use an unused destination directory:

```sh
git clone --single-branch --branch demo/logfire-title-handoff https://github.com/SunkenInTime/t3code.git t3-logfire-demo
cd t3-logfire-demo
git switch -c record-logfire b83de9d84a86a687642f3514094ae2480d816a13
vp i
cp docs/operations/logfire-demo.env.example .env.local
```

Privately edit .env.local with your Logfire write token. The template is for the US region; use your project's matching trace endpoint if elsewhere. The launcher keeps state within this checkout. Keep that file private.

Reuse an existing matching MCP connection, or for a US project:

```sh
codex mcp add logfire --url https://logfire-us.pydantic.dev/mcp
codex mcp login logfire
```

Start and keep running in terminal 1:

```sh
node demos/logfire-titles/start.mjs
```

Build and start the recording app in terminal 2:

```sh
vp run build:desktop
node demos/logfire-titles/desktop.mjs
```

Wait for "Recording desktop ready". Ports 14242 and 6202 must be available. The launcher gives you the actual investigation URL and preserves that investigator on later launches.

With the recording app running, publish your own before measurement in terminal 3:

```sh
uv run demos/logfire-titles/evaluate.py --name baseline
```

This makes three real Luna calls, prints the Logfire evaluation URL, saves .t3/title-evals/baseline/results.json and updates the recording sidebar. Run names must be unique. The reference result is 1/3 subject checks passing and 2/3 failing. Fresh wording and results may vary; report what your run actually produced. The saved reference results alone do not put traces in your project, so verify the fresh baseline through your Logfire MCP before recording.

## Record

1. Show the offline-search request and the wrong label-color title together.
2. Open the empty investigator in the recording desktop, with Astra / Medium / Full access. Paste record.txt. If your MCP has access to multiple projects, name the project that received this baseline.
3. Keep your Logfire project's Live view beside T3. Select Last 15 minutes and Live. Filter by service_name = 't3-logfire-demo' to follow the agent and title traces. Select the new T3 Code / Codex run, then Agent Run. Expand tool calls and the nested logfire.query_run span to show inputs and results. Evaluations appear separately under T3 first-message titles.
4. Let the agent diagnose and apply a focused fix. It should run one after evaluation using uv run demos/logfire-titles/evaluate.py --name after. That process reads the edited title builder without restarting the recording backend and copies real new titles into the sidebar.
5. Finish on corrected titles and the comparison with your baseline. The target is 3/3 subjects passing with zero task errors. Select the two experiments with the same corpus hash and evaluator in Logfire's T3 first-message titles dataset. Read the titles as well as the score.

The recorded repair rehearsal reached 3/3. That is one rehearsal, not a guaranteed repair success rate. The evaluator checks subject vocabulary groups; it is not a general title-quality judge.

## Why Logfire helps

For the presenter: the title pipeline keeps the end of a long first message and loses the actual request at the beginning. Logfire lets the investigator compare the original conversation, the actual supplied model input, and the resulting title. The agent can then fix the input construction and verify the change against the same cases. Keep the recording prompt open-ended; it does not need to name the cause.

The TypeScript setup shot is optional. Basic SDK setup and this custom T3 provider instrumentation are different scopes. Do not imply one SDK call created all of T3's agent telemetry. Captured agent messages cover observed current-turn events; provider-hidden instructions/history are not exposed. Oversized values are marked when truncated.

## Another take

Save the investigator's patch first. Restore only its changed files to the pinned baseline after reviewing them, then rerun one baseline with a unique name, such as baseline-take-2. Run the baseline while the recording desktop is open so its sidebar receives those results. Create a fresh empty investigation thread for the next take. Preserve existing investigations and unrelated work. Restarting alone preserves state and does not reset a repair.

The simplest completely clean setup is a new clone with the setup prompt. Stop the old launchers by their tracked PIDs or their own terminals first because the recording ports are fixed. Never point the demo server at your regular T3 home.

## Validation for this package

The pinned code includes the three-case scenario, native Logfire conversation/tool formatting, and bounded desktop startup checks. A real Astra run was inspected in Logfire's native Agent Run view; prompts and progress messages were observed before completion. The recording desktop was rebuilt and visually checked. The 26 telemetry tests, focused lint, server typecheck and desktop build passed. This packaging pass does not claim a new clean-machine end-to-end rehearsal.
