Allow setting daybreakEnabled when starting a thread (#45513)

## What changed

Add experimental `thread/start.daybreakEnabled` so clients can set the initial preference for persistent threads. Omitted or null values leave it unset; explicit values are rejected for ephemeral threads.

Return the choice in the start response, `thread/started`, and reads before persistence. Stage it with the initial thread metadata and save it when the thread is persisted. Later changes still use `thread/metadata/update`. The preference does not select `turn/start.cyberAccessProgram` or grant access.

## Testing

Add coverage for true, false, and unset values in responses, notifications, reads, and reads after persistence and restart, plus rejection for ephemeral threads. Update existing metadata and access-program tests to exercise threads with an initial preference.

GitOrigin-RevId: 3bff3dc55a18436067bc2a3f156f5abf52d7321b
This commit is contained in:
faizan-oai
2026-09-14 20:45:04 +00:00
committed by copyberry
parent ea3c4848d8
commit ef8b356c22
8 changed files with 181 additions and 4 deletions

View File

@@ -126,6 +126,12 @@ pub struct ThreadStartParams {
#[experimental("thread/start.projectId")]
#[ts(optional = nullable)]
pub project_id: Option<String>,
/// Initial Daybreak choice for this persistent thread. Omitted or null
/// leaves it unset. This does not select a turn's `cyberAccessProgram`
/// or grant access. Not supported for ephemeral threads.
#[experimental("thread/start.daybreakEnabled")]
#[ts(optional = nullable)]
pub daybreak_enabled: Option<bool>,
/// Optional sticky environments for this thread.
///
/// Omitted selects the default environment when environment access is