Add safer TUI defaults for cyber models (#37055)

## What changed

- Propagate the optional `modelSpecialty` field through the model catalog and
  app-server `model/list` response.
- When a newly selected model has the `cyber` specialty, default an active TUI
  thread to workspace-write permissions with on-request approval. Use auto
  review when available, otherwise keep the user as reviewer, while respecting
  configured permission requirements.
- Show a notice when auto review is applied and strengthen the full-access
  warning for cyber models.
- Preserve explicitly selected permissions when only reasoning settings change.

## Testing

- Cover auto-review defaults, requirement-aware fallback behavior, permission
  preservation across reasoning changes, and the new warning notice.

GitOrigin-RevId: 8f25b0082d3051d9ff91f7355921236d0f82f758
This commit is contained in:
Won Park authored and copyberry committed 2026-08-05 08:04:15 +00:00
1 parent 3171166881
commit 757c151a0e
35 files changed
+536 -39

No files matched your search

@@ -1,6 +1,37 @@
use super::*;
use codex_protocol::models::BUILT_IN_PERMISSION_PROFILE_DANGER_FULL_ACCESS;
pub(crate) fn auto_review_available(config: &Config) -> bool {
cyber_model_approval_reviewer(config) == Some(ApprovalsReviewer::AutoReview)
}
pub(crate) fn cyber_model_approval_reviewer(config: &Config) -> Option<ApprovalsReviewer> {
let requirements = config.config_layer_stack.requirements();
if requirements
.approval_policy
.can_set(&AskForApproval::OnRequest.to_core())
.is_err()
{
return None;
}
let reviewer = if config.features.enabled(Feature::GuardianApproval)
&& requirements
.approvals_reviewer
.can_set(&ApprovalsReviewer::AutoReview)
.is_ok()
{
ApprovalsReviewer::AutoReview
} else {
ApprovalsReviewer::User
};
requirements
.approvals_reviewer
.can_set(&reviewer)
.is_ok()
.then_some(reviewer)
}
impl ChatWidget {
pub(super) fn open_permission_profiles_popup(&mut self) {
let active_profile_id = self