Capture saved Daybreak preferences for native helpers (#60749)

## What changed

Add the disabled-by-default `daybreak_program_propagation` feature to capture a parent's saved Daybreak choice when spawning native helpers. Retain the choice and account identity for helper turns and nested spawns, while preserving explicit `cyber_access_program` overrides. A helper's own saved preference takes precedence on later turns.

Read pending metadata before persisted metadata so preferences survive thread materialization, with stored choices taking precedence. Share this resolution logic with `thread/read` and support refreshing the feature through user configuration.

## Testing

Add coverage for saved and pending preferences, unset choices, explicit overrides, failed metadata reads, nested spawns, parent unloading, feature withdrawal, and preference changes between helper turns.

GitOrigin-RevId: b3b349da8cb3d48154cddf058890587385efcda2
This commit is contained in:
jamy-OAI
2026-11-11 07:39:04 +00:00
committed by copyberry
parent c320b5c69e
commit d9a32c1789
23 changed files with 780 additions and 24 deletions
+18
View File
@@ -81,6 +81,24 @@ pub enum ThreadStoreError {
},
}
impl ThreadStoreError {
/// Whether a read found no persisted record for this specific thread.
pub fn is_missing_for_read(&self, requested_thread_id: ThreadId) -> bool {
match self {
Self::ThreadNotFound { thread_id } => *thread_id == requested_thread_id,
// The local store's strict read uses this legacy error for an unmaterialized rollout.
Self::InvalidRequest { message } => {
message == &format!("no rollout found for thread id {requested_thread_id}")
}
Self::Conflict { .. }
| Self::Unsupported { .. }
| Self::Retryable { .. }
| Self::OutcomeUnknown { .. }
| Self::Internal { .. } => false,
}
}
}
#[cfg(test)]
#[path = "error_tests.rs"]
mod tests;