Add backend remember-context RPC

Load source rollouts, extract visible conversation, persist a hidden remembered-context packet, and expose the v2 thread/remember RPC for UI integration.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Lance Pereira
2026-04-10 10:32:42 -07:00
committed by Taylor McIntyre
co-authored by Codex
parent fb547f1a66
commit f341ca973e
23 changed files with 1056 additions and 197 deletions
+24
View File
@@ -47,6 +47,8 @@ use codex_app_server_protocol::ThreadRealtimeStartResponse;
use codex_app_server_protocol::ThreadRealtimeStartTransport;
use codex_app_server_protocol::ThreadRealtimeStopParams;
use codex_app_server_protocol::ThreadRealtimeStopResponse;
use codex_app_server_protocol::ThreadRememberParams;
use codex_app_server_protocol::ThreadRememberResponse;
use codex_app_server_protocol::ThreadResumeParams;
use codex_app_server_protocol::ThreadResumeResponse;
use codex_app_server_protocol::ThreadRollbackParams;
@@ -418,6 +420,28 @@ impl AppServerSession {
Ok(response.thread)
}
#[allow(dead_code)] // The picker wiring will call this once the /remember UI lands.
pub(crate) async fn thread_remember(
&mut self,
thread_id: ThreadId,
source_thread_ids: Vec<ThreadId>,
) -> Result<ThreadRememberResponse> {
let request_id = self.next_request_id();
self.client
.request_typed(ClientRequest::ThreadRemember {
request_id,
params: ThreadRememberParams {
thread_id: thread_id.to_string(),
source_thread_ids: source_thread_ids
.into_iter()
.map(|thread_id| thread_id.to_string())
.collect(),
},
})
.await
.wrap_err("thread/remember failed in TUI")
}
#[allow(clippy::too_many_arguments)]
pub(crate) async fn turn_start(
&mut self,