Add persisted thread pinning to the app server (#34840)

## What changed

- Add `isPinned` to thread responses and allow `thread/metadata/update` to pin or unpin stored threads.
- Add an `isPinned` filter to `thread/list`, including cursor-based pagination and combinations with relationship filters.
- Persist pin state in SQLite without modifying rollout files, default existing threads to unpinned, and preserve pins through reconciliation and archive transitions.

## Testing

- Cover protocol serialization, database migration and indexing, pin updates, filtered pagination, rollout reconciliation, and archive/unarchive behavior.

GitOrigin-RevId: c2eacabd6dae465e2ae6ce8a169e00740960cdb7
This commit is contained in:
joeytrasatti-openai authored and copyberry committed 2026-07-22 22:54:28 +00:00
1 parent d7e8f4c3dc
commit 400ee190c3
71 files changed
+1058 -60

No files matched your search

+1
View File
@@ -142,6 +142,7 @@ mod tests {
parent_thread_id: None,
preview: String::new(),
ephemeral: false,
is_pinned: false,
history_mode: Default::default(),
model_provider: "openai".to_string(),
created_at: 0,
+3
View File
@@ -3439,6 +3439,7 @@ async fn inactive_thread_started_notification_initializes_replay_session() -> Re
parent_thread_id: None,
preview: "agent thread".to_string(),
ephemeral: false,
is_pinned: false,
history_mode: Default::default(),
model_provider: "agent-provider".to_string(),
created_at: 1,
@@ -3535,6 +3536,7 @@ async fn inactive_thread_started_notification_preserves_primary_model_when_path_
parent_thread_id: None,
preview: "agent thread".to_string(),
ephemeral: false,
is_pinned: false,
history_mode: Default::default(),
model_provider: "agent-provider".to_string(),
created_at: 1,
@@ -3598,6 +3600,7 @@ async fn thread_read_session_state_does_not_reuse_primary_permission_profile() {
parent_thread_id: None,
preview: "read thread".to_string(),
ephemeral: false,
is_pinned: false,
history_mode: Default::default(),
model_provider: "read-provider".to_string(),
created_at: 1,
@@ -417,6 +417,7 @@ mod tests {
parent_thread_id: None,
preview: "read thread".to_string(),
ephemeral: false,
is_pinned: false,
history_mode: Default::default(),
model_provider: "read-provider".to_string(),
created_at: 1,