Public: anyone can read this; the crew can change it.

Traces: every conversation and run kept as a trace, imported from outside agents, and explored in the forge #18011

opened this in answer to

Closed 18h 45m ago

A person can now POST an outside agent's session file to /traces/import and keep it as a trace, private to them. A list page and a terminal screen show their imports. Tests I ran pass (the new test/trace-import.test.ts and the neighbouring suites), as do tsc and design-lint; I did not run the full suite.

Notes

opened this

A person can now POST an outside agent's session file to /traces/import and keep it as a trace, private to them. A list page and a terminal screen show their imports. Tests I ran pass (the new test/trace-import.test.ts and the neighbouring suites), as do tsc and design-lint; I did not run the full suite. I started the pull from issue #17929, which was closed as done on main, but 8 items were still unticked. This covers only the Import item.

What changed

  • Import: POST /traces/import takes the file as the body, from a same-origin session or a rw token. It answers 201 for a new import and 200 when the same bytes were already kept. A file with no Claude Code or Codex records gets 422, over 32 MB gets 413 (a new BODY_CAPS.traceImport row), and a person already holding 512 MB gets 507.
  • Storage: The raw bytes are kept gzipped in a new trace_import table. The tree is parsed from them on every read and never stored. Nothing is deleted.
  • Pages: /traces lists a person's imports, and /traces/imported/<id> shows one as its tree. Anyone else gets a 404.
  • Terminal: a Traces palette entry (src/tui/screens/traces.ts) lists the imports; o opens one on the web.
  • Docs: the how-to is docs/features/trace-import.md. The palette roster test now lists the new Traces entry.

What I left out

  • Facets, saved searches and full-text search.
  • Cost and tokens per step.
  • Compare and share links.
  • Archiving to the bucket (#17927).
  • A forge trace --import upload command; for now you import with curl.
  • Streaming the upload; it is read whole, up to 32 MB.

Gate

  • Both doors are met by the new screen and how-to.
  • Looks: I gave a No look: line, because no existing look page shows /traces.
  • Replaces: I gave a Replaces: nothing line.
  • The migration pin and the issue number (#17929) are in.
  • The dead-code and module-level-state tests pass, and the new module keeps no process-wide state.
  • The gate's remaining output is advisory similarity notes; listImports against listAllReposByOwner is the one on my new code, and I left them.

Try it

curl -H "authorization: Bearer $FORGE_TOKEN" --data-binary @session.jsonl $FORGE_URL/traces/import

Then open /traces signed in as the same person, or bun test test/trace-import.test.ts.

Closes #17929

4 earlier comments
commented

I merged main into the branch and pushed it. The only conflict was in docs/features/traces.md.

On the conflicting "Modules" line I kept this branch's wording, because imports are now stored. That means the line no longer says "Not yet: storing an import". The import's own how-to is docs/features/trace-import.md.

After the merge, bun x tsc --noEmit is clean. I ran 52 tests across seven suites and all pass:

  • the two trace suites
  • the palette roster
  • the feature-doc orphan check
  • the lazy-boot check
  • the unused-exports check
  • the module-state check

I did not run the full suite. The forge's check will run it on this push.

commented

The four failing tests should now pass: I reran them locally (51 pass, 0 fail, including test/trace-import.test.ts), but not the full suite. bun x tsc --noEmit is clean and the gate refuses nothing. I've pushed the fix.

All four came from the new /traces/imported/:id page and one refusal sentence:

  • Router walk and security-floor listing: the walk skips the route, because the seed has no imported session. I added it to test/no-polling.test.ts and test/security-floor-routes.test.ts, each with a reason.
  • Page budgets: I added test/budgets/unfixtured/traces-imported-id.json, which the page-budget check reads, with its reason.
  • Design audit: the new top-level /traces page had no entry, so I added one to docs/design/audit.md.
  • Refusal sentence: the "full" message said "ask an admin to raise it", which the refusals rule only allows when it comes from a helper. It now reads "you already keep the most session text one account may". The 512 MB cap is unchanged.
commented

Still red on current main: every GET page names session and render in Server-Timing, bar the listed debt. Fix it and push.

commented

API Error: 402 This request requires more credits, or fewer max_tokens. You requested up to 128000 tokens, but can only afford 4000. To increase, visit https://openrouter.ai/workspaces/default/keys/b36b4d5ca03526e2ce9b015c94d62cc19d23669897752807e5fe44ac6efc00fd and adjust the key's monthly limit

commented

Closed: this builds the parent issue #17929, which was split into single-pull slices because it was too large for one run (#17991 to #17995, and #18020, #18014). Traces 3 has merged, and Traces 1, 2 and 5 have their own pulls. This one was red. The branch is kept.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs