Skip to content

feat(app-server): always return limited thread history#20682

Merged
owenlin0 merged 1 commit into
mainfrom
owen/always_return_limited_history
May 4, 2026
Merged

feat(app-server): always return limited thread history#20682
owenlin0 merged 1 commit into
mainfrom
owen/always_return_limited_history

Conversation

@owenlin0
Copy link
Copy Markdown
Collaborator

@owenlin0 owenlin0 commented May 1, 2026

Why

Whenever we return a thread's history (turns and items) over app-server, always return the limited form as specified by the rollout policy EventPersistenceMode::Limited, even if the thread was previously started with EventPersistenceMode::Extended.

We're finding it is quite unscalable to be returning the extended history, so let's apply the same filtering logic of the rollout policy when we load and return the thread's history.

What Changed

  • Reuse the rollout persistence policy when reconstructing app-server ThreadItem history so only EventPersistenceMode::Limited rollout items are replayed into API turns.
  • Route thread/read, thread/resume, thread/fork, thread/turns/list, and rollback responses through the same filtered app-server history projection.
  • Keep live active turns intact when composing a response for a currently running thread.
  • Update command execution coverage so persisted extended command events are excluded from returned history for thread/read, thread/fork, and thread/turns/list.

Test Plan

  • cargo test -p codex-app-server limited
  • cargo test -p codex-app-server thread_shell_command
  • cargo test -p codex-app-server thread_read
  • cargo test -p codex-app-server thread_rollback
  • cargo test -p codex-app-server thread_fork
  • cargo test -p codex-app-server-protocol

@owenlin0 owenlin0 force-pushed the owen/always_return_limited_history branch 3 times, most recently from 68972fe to 1d0ead1 Compare May 1, 2026 23:31
@owenlin0 owenlin0 marked this pull request as ready for review May 1, 2026 23:41
@owenlin0 owenlin0 force-pushed the owen/always_return_limited_history branch 2 times, most recently from 0f149c1 to 9e7312a Compare May 1, 2026 23:46
@owenlin0 owenlin0 requested review from celia-oai and pakrym-oai May 1, 2026 23:53
@owenlin0 owenlin0 force-pushed the owen/always_return_limited_history branch from 9e7312a to 37e00fd Compare May 4, 2026 16:01
@owenlin0 owenlin0 force-pushed the owen/always_return_limited_history branch from 37e00fd to 75e943e Compare May 4, 2026 16:43
@owenlin0 owenlin0 merged commit 541e99c into main May 4, 2026
37 of 38 checks passed
@owenlin0 owenlin0 deleted the owen/always_return_limited_history branch May 4, 2026 17:37
@github-actions github-actions Bot locked and limited conversation to collaborators May 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants