Expose model settings in app-server thread metadata (#42151)

## What changed

- Add nullable `model` and `reasoningEffort` fields to the shared app-server `Thread` object and generated schemas.
- Report current settings for loaded threads and the latest persisted settings for unloaded threads across thread read, list, start, resume, rollback, metadata update, and notification paths.
- Keep unavailable legacy or filesystem-only settings nullable, and allow metadata reads without loading a thread or dispatching queued work.

## Testing

- Cover live-setting precedence, persisted settings after restart, null legacy values, and model metadata returned by thread lifecycle operations.

GitOrigin-RevId: 22ebe8a8d1910a820d90a97730d812a00d8c1372
This commit is contained in:
Brent Traut authored and copyberry committed 2026-09-01 22:56:18 +00:00
1 parent 6b59cefcbb
commit 986ff1cc7c
50 files changed
+633 -33

No files matched your search

+6
View File
@@ -1298,6 +1298,8 @@ fn fill_missing_thread_item_metadata(item: &mut ThreadItem, state_item: ThreadIt
agent_nickname,
agent_role,
model_provider,
model,
reasoning_effort,
cli_version,
created_at,
updated_at,
@@ -1312,6 +1314,8 @@ fn fill_missing_thread_item_metadata(item: &mut ThreadItem, state_item: ThreadIt
}
item.section = section;
item.project_id = project_id;
item.model = model;
item.reasoning_effort = reasoning_effort;
if item.cwd.is_none() {
item.cwd = cwd;
}
@@ -2040,6 +2044,8 @@ fn thread_item_from_state_metadata(
agent_nickname: item.agent_nickname,
agent_role: item.agent_role,
model_provider: Some(item.model_provider),
model: item.model,
reasoning_effort: item.reasoning_effort,
cli_version: Some(item.cli_version),
created_at: Some(item.created_at.to_rfc3339_opts(SecondsFormat::Secs, true)),
updated_at: Some(item.updated_at.to_rfc3339_opts(SecondsFormat::Millis, true)),