add turn items view to app-server turns#21063
Conversation
82f46ee to
1832cf6
Compare
1832cf6 to
d648764
Compare
d648764 to
7083fd8
Compare
| @@ -163,6 +164,7 @@ pub(crate) async fn apply_bespoke_event_handling( | |||
| state.active_turn_snapshot().unwrap_or_else(|| Turn { | |||
There was a problem hiding this comment.
This can make
turn/startedreportitemsView: "full":active_turn_snapshot()is built through the history reducer, whosePendingTurn -> Turnconversion setsitems_viewtoFull. Sinceturn/startedis a lifecycle notification and should not claim to include the complete item history, this path should normalize the payload before sending, e.g. clearitemsand forceitems_view = TurnItemsView::NotLoaded.
let's always make sure a turn/started notification returns itemsView: notLoaded
| Turn { | ||
| id: turn_id, | ||
| items, | ||
| items_view: TurnItemsView::Full, |
There was a problem hiding this comment.
ReviewStartResponseshould not reportFullhere. This turn is synthesized for a start response, not reconstructed from persisted app-server history. If we want it to behave liketurn/start, this should beNotLoaded; if the synthetic prompt item is intentionally a display-only preview,Summarywould be more accurate thanFull.
for consistency with turn/start, let's also always return itemsView: notLoaded for review/start as well
Why
Turn.itemscurrently overloads an empty array to mean either that no items exist or that the server intentionally did not load them for this response. That ambiguity blocks future lazy-loading work where clients need to distinguish unloaded, summary, and fully hydrated turn payloads.What changed
TurnItemsViewenum withnotLoaded,summary, andfullvariantsitemsViewmetadata to app-serverTurnpayloadsfulland live shell-style turn payloads asnotLoadedthread/turns/listbehavior unchanged and document that it still returnsfullturns todayVerification
just write-app-server-schemacargo test -p codex-app-server-protocolcargo test -p codex-app-server thread_read_can_include_turnscargo test -p codex-app-server thread_turns_list_can_page_backward_and_forwardcargo test -p codex-app-server thread_resume_rejects_history_when_thread_is_runningjust fix -p codex-app-server-protocoljust fix -p codex-app-serverjust fmt