core: add extra metadata field to Thread struct (#29675)

# Summary

Adds a field Thread.extras that can be used to hold arbitrary metadata
specific to a given thread.
This commit is contained in:
Boyang Niu authored and GitHub committed 2026-06-23 19:15:59 +00:00
1 parent 2cf2a6a844
commit 354807920e
30 files changed
+113 -44

No files matched your search

+1
View File
@@ -128,6 +128,7 @@ mod tests {
fn test_thread(thread_id: ThreadId, source: SessionSource) -> Thread {
Thread {
id: thread_id.to_string(),
extra: None,
session_id: thread_id.to_string(),
forked_from_id: None,
parent_thread_id: None,
+4
View File
@@ -2874,6 +2874,7 @@ async fn inactive_thread_started_notification_initializes_replay_session() -> Re
ServerNotification::ThreadStarted(ThreadStartedNotification {
thread: Thread {
id: agent_thread_id.to_string(),
extra: None,
session_id: agent_thread_id.to_string(),
forked_from_id: None,
parent_thread_id: None,
@@ -2967,6 +2968,7 @@ async fn inactive_thread_started_notification_preserves_primary_model_when_path_
ServerNotification::ThreadStarted(ThreadStartedNotification {
thread: Thread {
id: agent_thread_id.to_string(),
extra: None,
session_id: agent_thread_id.to_string(),
forked_from_id: None,
parent_thread_id: None,
@@ -3027,6 +3029,7 @@ async fn thread_read_session_state_does_not_reuse_primary_permission_profile() {
let thread = Thread {
id: read_thread_id.to_string(),
extra: None,
session_id: read_thread_id.to_string(),
forked_from_id: None,
parent_thread_id: None,
@@ -5640,6 +5643,7 @@ async fn thread_rollback_response_discards_queued_active_thread_events() {
&ThreadRollbackResponse {
thread: Thread {
id: thread_id.to_string(),
extra: None,
session_id: thread_id.to_string(),
forked_from_id: None,
parent_thread_id: None,
@@ -409,6 +409,7 @@ mod tests {
};
let read_thread = Thread {
id: read_thread_id.to_string(),
extra: None,
session_id: read_thread_id.to_string(),
forked_from_id: None,
parent_thread_id: None,