mirror of
https://github.com/openai/codex.git
synced 2026-05-06 06:12:59 +03:00
feat(core): add conversational permission preset foundation
Add the opt-in `request_permission_preset` flow across `codex-core`, `codex-protocol`, and `codex-tools`, including preset definitions, request state, tool wiring, and focused regression coverage for preset-driven permission changes. Validate preset responses against pending call ids before applying them, re-resolve accepted presets against the current session, and record turn-local overrides only after `update_settings` succeeds so stale or rejected replies cannot widen permissions.
This commit is contained in:
@@ -97,6 +97,8 @@ pub enum Feature {
|
||||
CodexHooks,
|
||||
/// Expose the built-in request_permissions tool.
|
||||
RequestPermissionsTool,
|
||||
/// Expose the built-in request_permission_preset tool.
|
||||
RequestPermissionPresetTool,
|
||||
/// Allow the model to request web searches that fetch live content.
|
||||
WebSearchRequest,
|
||||
/// Allow the model to request web searches that fetch cached content.
|
||||
@@ -706,8 +708,14 @@ pub const FEATURES: &[FeatureSpec] = &[
|
||||
FeatureSpec {
|
||||
id: Feature::RequestPermissionsTool,
|
||||
key: "request_permissions_tool",
|
||||
stage: Stage::UnderDevelopment,
|
||||
default_enabled: false,
|
||||
stage: Stage::Stable,
|
||||
default_enabled: true,
|
||||
},
|
||||
FeatureSpec {
|
||||
id: Feature::RequestPermissionPresetTool,
|
||||
key: "request_permission_preset_tool",
|
||||
stage: Stage::Stable,
|
||||
default_enabled: true,
|
||||
},
|
||||
FeatureSpec {
|
||||
id: Feature::UseLinuxSandboxBwrap,
|
||||
|
||||
@@ -107,12 +107,15 @@ fn request_permissions_is_under_development() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn request_permissions_tool_is_under_development() {
|
||||
assert_eq!(
|
||||
Feature::RequestPermissionsTool.stage(),
|
||||
Stage::UnderDevelopment
|
||||
);
|
||||
assert_eq!(Feature::RequestPermissionsTool.default_enabled(), false);
|
||||
fn request_permissions_tool_is_stable_and_enabled_by_default() {
|
||||
assert_eq!(Feature::RequestPermissionsTool.stage(), Stage::Stable);
|
||||
assert_eq!(Feature::RequestPermissionsTool.default_enabled(), true);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn request_permission_preset_tool_is_stable_and_enabled_by_default() {
|
||||
assert_eq!(Feature::RequestPermissionPresetTool.stage(), Stage::Stable);
|
||||
assert_eq!(Feature::RequestPermissionPresetTool.default_enabled(), true);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user