Add persisted sections for organizing threads (#35722)

## What changed

- Replace the `isPinned` thread metadata and filters with an optional persisted
  `section` and `sectionId`.
- Add the paginated `threadSection/list` app-server method so clients can
  discover sections even when they contain no threads.
- Seed a stable `Pinned` section, validate section assignments, and support
  filtering for a specific section or for unsectioned threads.

## Testing

- Cover section protocol serialization, listing and pagination, metadata
  updates, filtering, persistence, migration compatibility, and operation
  without SQLite state.

GitOrigin-RevId: 7972b5471d29317b9387bfd90aa9f573f691ad4c
This commit is contained in:
joeytrasatti-openai
2026-07-28 05:26:16 +00:00
committed by copyberry
parent 9291a123fb
commit 85c6da1c79
85 changed files with 1826 additions and 419 deletions
+2 -2
View File
@@ -1485,7 +1485,7 @@ async fn resolve_resume_thread_id(
model_providers: model_providers.clone(),
source_kinds: Some(all_thread_source_kinds()),
archived: Some(false),
is_pinned: None,
section_id: None,
parent_thread_id: None,
ancestor_thread_id: None,
cwd: None,
@@ -1553,7 +1553,7 @@ async fn resolve_resume_thread_id(
model_providers: model_providers.clone(),
source_kinds: Some(all_thread_source_kinds()),
archived: Some(false),
is_pinned: None,
section_id: None,
parent_thread_id: None,
ancestor_thread_id: None,
cwd: None,
+2 -2
View File
@@ -335,7 +335,7 @@ fn turn_items_for_thread_returns_matching_turn_items() {
parent_thread_id: None,
preview: String::new(),
ephemeral: false,
is_pinned: false,
section: None,
history_mode: Default::default(),
model_provider: "openai".to_string(),
created_at: 0,
@@ -803,7 +803,7 @@ fn sample_thread_start_response() -> ThreadStartResponse {
parent_thread_id: None,
preview: String::new(),
ephemeral: false,
is_pinned: false,
section: None,
history_mode: Default::default(),
model_provider: "openai".to_string(),
created_at: 0,