mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
Enable Guardian thread context by default (#47275)
## What changed Mark `guardianv2.thread_context` as stable and enable it by default for synchronous and asynchronous Guardian reviews. Keep it independent of the Guardian v2 `enabled` toggle and preserve explicit configuration and profile overrides. Update the configuration schema documentation to match. ## Testing Update coverage for default configuration and sender user messages, review prompt snapshots, history retention across compaction, and checkpoint provenance. Assert that later user input invalidates an in-flight review's authorization. Keep legacy transcript budgeting coverage by explicitly disabling thread context in that test. GitOrigin-RevId: 19afd34d7bfc0ee36bbf878089c68b732a21bc6a
This commit is contained in:
@@ -135,7 +135,7 @@ pub struct GuardianV2ConfigToml {
|
||||
/// Legacy setting retained for config compatibility; the backend now controls Guardian billing.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub free_guardian: Option<bool>,
|
||||
/// Use thread-owned context for sync and async Guardian. Defaults to false.
|
||||
/// Use thread-owned context for sync and async Guardian. Defaults to true.
|
||||
/// Independent of the Guardian v2 `enabled` toggle.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub thread_context: Option<bool>,
|
||||
|
||||
@@ -1627,8 +1627,8 @@ pub const FEATURES: &[FeatureSpec] = &[
|
||||
FeatureSpec {
|
||||
id: Feature::GuardianThreadContext,
|
||||
key: "guardianv2.thread_context",
|
||||
stage: Stage::UnderDevelopment,
|
||||
default_enabled: false,
|
||||
stage: Stage::Stable,
|
||||
default_enabled: true,
|
||||
},
|
||||
FeatureSpec {
|
||||
id: Feature::GuardianReuseParentCompaction,
|
||||
|
||||
@@ -182,7 +182,8 @@ fn guardian_thread_context_resolves_nested_config_and_profile_overrides() {
|
||||
let enabled_context = "[guardianv2]\nthread_context = true";
|
||||
let disabled_context = "[guardianv2]\nthread_context = false";
|
||||
for (base, profile, enabled) in [
|
||||
("", "", false),
|
||||
("", "", true),
|
||||
("guardianv2 = false", "", true),
|
||||
(disabled_context, "", false),
|
||||
(enabled_context, "", true),
|
||||
(enabled_context, disabled_context, false),
|
||||
@@ -207,9 +208,7 @@ fn guardian_thread_context_resolves_nested_config_and_profile_overrides() {
|
||||
FeatureOverrides::default(),
|
||||
);
|
||||
let mut expected = Features::with_defaults();
|
||||
if enabled {
|
||||
expected.enable(Feature::GuardianThreadContext);
|
||||
}
|
||||
expected.set_enabled(Feature::GuardianThreadContext, enabled);
|
||||
assert_eq!(features.enabled_features(), expected.enabled_features());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user