Skip to content

fix(app): omit attachments from turn preview index - #57712

Closed
kitlangton wants to merge 1 commit into
betafrom
prompt-index
Closed

kitlangton wants to merge 1 commit into
betafrom
prompt-index

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

The turn navigator builds a text-only index by requesting up to 1,000 user messages. Those requests include file attachments, so image bytes pass through SQLite, message decoding, JSON serialization and client parsing without being used by the previews.

Add includeFiles=false to message listing and use it for navigator index requests. SQLite removes the top-level files field before JS decoding. Prompt text, metadata, durable ordering and cursor behavior are preserved. The default and explicit true still include attachments.

Measurement

Real ServerFetch handler and generated client, in-memory SQLite, 1,000 synthetic prompts with 22,000 base64 characters each. One warmup and seven alternating before/after pairs on M4 Pro. This is an attachment-heavy fixture, not an exact HOME replay.

Metric Before After
Five-page index, median 519.872 ms 90.773 ms
Range 300.562–3,597.225 ms 65.644–199.138 ms
Response bytes 22,637,587 569,587
Requests 5 5

All seven pairs improved. The measurement includes handler execution, serialization and generated-client parsing; it excludes network latency and browser painting. No newest-message paint improvement is claimed.

Prompt index measurements

Paired samples and reproduction
Pair Order Before ms After ms
Warmup Before, after 663.209500 649.020000
1 After, before 392.665917 199.137917
2 Before, after 300.561541 118.924042
3 After, before 375.529458 81.771500
4 Before, after 592.060375 101.738083
5 After, before 1,799.917208 90.773042
6 Before, after 519.871708 65.644291
7 After, before 3,597.225208 71.711708

From packages/server, run bun script/benchmark-message-index.ts. It uses isolated temporary global paths, an in-memory database and in-process HTTP requests. Each sample asserts message count, ID order, display metadata and attachment presence.

Verification

  • Generated client rebuilt with bun run generate from packages/client.
  • packages/server/test/message.test.ts: 3 tests, 32 assertions pass, including projection, attachment preservation and cursor continuation through the generated client.
  • Full bun run check: all 36 tasks pass. Checks and benchmark ran through HiveMind.

Scope

Optional public API query parameter plus one navigator call site; no database migration. Older servers may ignore the parameter and return the larger payload. This does not strip nested tool media; #56989 owns that separate optimization. Undo is one revert.

@kitlangton

Copy link
Copy Markdown
Contributor Author

CI finished with passing Linux/Windows builds and unit tests, but failing app E2E and app component jobs. This PR is not fully green.

Compared the logs for the two independent session-loading branches: #57700 run and #57712 run. Both fail the same new-session color, artifact reread, pending-steer color, mobile Home navigation, busy-tab activity, cached-timeline focus/disposal, activity-chip, virtualizer reconnect and websearch component cases. The navigator branch also fails the painted-motion disappearance assertion. Session-ui component jobs pass on both platforms.

The navigator branch does not contain the enrichment change, and the enrichment branch does not contain the navigator projection. The shared failures therefore are not isolated evidence against either change. A clean-base reproduction was not run, so this is not a claim that every failure is pre-existing. Targeted tests and full lint/typecheck passed as recorded above. Both PRs remain unmerged.

@kitlangton

Copy link
Copy Markdown
Contributor Author

Closing: the turn navigator was removed from beta in ee8221c, and we're not bringing it back.

@kitlangton kitlangton closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant