Tailor TUI cyber refusal notices to Daybreak eligibility (#42667)

## What changed

- Prefetch ChatGPT account eligibility in the background and cache it across TUI widget replacements.
- Show an application link when Daybreak is available but not enabled, an Astra-specific explanation for unsupported models, and neutral copy when access is already present or eligibility cannot be determined.
- Refresh eligibility after account changes and reconnects without changing the selected model or delaying refusal handling.

## Testing

- Cover eligibility responses, account changes, model-specific notices, fallback behavior, and rendered notice snapshots.

GitOrigin-RevId: 7ae8613a946cb46b8f0b46bf47e5e15ae258ed86
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-04 03:30:21 +00:00
1 parent a7ab2d66d7
commit ff2f01b0c2
21 files changed
+469 -80

No files matched your search

+8 -4
View File
@@ -395,12 +395,16 @@ impl ChatWidget {
pub(super) fn on_cyber_policy_error(&mut self) {
self.input_queue.submit_pending_steers_after_interrupt = false;
self.finalize_turn();
let plan_type = if self.has_chatgpt_account {
self.plan_type
let notice = if self.config.model_provider_id == "openai" {
self.cyber_policy_notice
.get()
.copied()
.unwrap_or_default()
.for_model(self.current_model())
} else {
None
crate::daybreak::Notice::Limited
};
self.add_to_history(history_cell::new_cyber_policy_error_event(plan_type));
self.add_to_history(history_cell::new_cyber_policy_error_event(notice));
self.request_redraw();
// After an error ends the turn, try sending the next queued input.