Skip to content

[app-server] Add stored-thread view helpers#28461

Draft
adamvy-oai wants to merge 2 commits into
adamvy/app-server-lossless-eventsfrom
adamvy/app-server-thread-views
Draft

[app-server] Add stored-thread view helpers#28461
adamvy-oai wants to merge 2 commits into
adamvy/app-server-lossless-eventsfrom
adamvy/app-server-thread-views

Conversation

@adamvy-oai

@adamvy-oai adamvy-oai commented Jun 16, 2026

Copy link
Copy Markdown

Overview

This is the third change in a five-PR stack that improves the Rust embedding API for codex-app-server. It gives stored-thread consumers one intentional module for producing the same views, filters, and pages as the built-in request processors.

What

  • add codex_app_server::thread_views
  • expose from_stored_thread() for projecting a StoredThread into the app-server representation
  • expose ThreadSourceFilter for the two-stage source filtering used by thread list and search requests
  • clarify that an empty backing-store allowed_sources list applies no source filter
  • expose paginate_loaded_thread_ids() and paginate_turns()
  • move the built-in request processors to these helpers without intentionally changing request behavior

Why

Stored-thread projection and pagination previously lived inside request-processing code, while source filtering lived in a separate private module. Embedders with another ThreadStore would have to reproduce that behavior to return app-server-compatible views.

The new module defines that behavior once and makes the built-in request processors use the same API. ThreadSourceFilter retains the existing split between coarse store filtering and precise in-memory classification for source kinds that the store cannot distinguish directly. The backing-store contract is now explicit: an empty allowed_sources list applies no store-level source filter, so ThreadSourceFilter::matches() can perform the precise classification afterwards.

Stack

Each PR is based on the preceding branch:

  1. #28459 — custom in-process thread stores
  2. #28460 — lossless in-process event delivery
  3. #28461 — stored-thread view helpers (this PR)
  4. #28462 — rollout-history turn boundaries
  5. #30369 — durable external thread goals

Validation

Validation for the final stacked commits:

  • six focused thread_views tests, including unfiltered backing-store queries followed by precise source classification
  • loaded-thread pagination integration test
  • turn pagination and item-view integration tests
  • just test -p codex-app-server: 886 passed; one timing retry passed on its second attempt
  • just test -p codex-core: 2,717 passed; eight timing-sensitive failures passed in focused reruns, while five high-output code-mode failures remained
  • just test --test-threads=8: 10,944 of 10,958 passed; the remaining failures were the same five high-output tests, three timing-sensitive tests that pass in focused reruns, and six tests in untouched exec/TUI code affected by this host's managed permission policy
  • a representative high-output failure reproduces on the exact upstream/main commit
  • just fix -p codex-app-server, just fix -p codex-core, and just fmt; final worktree clean

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@adamvy-oai adamvy-oai force-pushed the adamvy/app-server-thread-views branch from 48321c1 to 7a32119 Compare June 25, 2026 06:34
@adamvy-oai adamvy-oai force-pushed the adamvy/app-server-lossless-events branch from aa5343c to 16d35f1 Compare June 25, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant