mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Move Guardian permission context into the shared section registry (#43538)
## What changed Represent denied read paths and globs with `PermissionContext` and render them through a sync-only section in `codex-guardian-context`. Keep policy resolution in the host and preserve the existing permission warning in Guardian review prompts. ## Testing Extend registry tests to verify permission sections appear only for synchronous reviews. Extend the session reuse test to check that resolved denied paths and globs appear in both the initial review request and the next review's delta. GitOrigin-RevId: a966a14b367f1eedb5a577f7ed74a869559ae646
This commit is contained in:
1 parent
93ac341410
commit
81f23bc186
11 files changed
+139
-26
No files matched your search
@@ -583,7 +583,8 @@ impl GuardianV2Extension {
|
||||
let mut classification_input = Vec::new();
|
||||
for section in transcript.sections {
|
||||
match section {
|
||||
ContextSection::RootConversation { items }
|
||||
ContextSection::PermissionContext { items }
|
||||
| ContextSection::RootConversation { items }
|
||||
| ContextSection::RetainedUserInstructions { items }
|
||||
| ContextSection::TrustedUserAnswers { items } => {
|
||||
classification_input.extend(items)
|
||||
|
||||
@@ -200,6 +200,7 @@ impl TranscriptConfig {
|
||||
root_conversation,
|
||||
trusted_user_answers,
|
||||
planned_action,
|
||||
permissions: None,
|
||||
})?;
|
||||
let mut truncations = Vec::new();
|
||||
let sections = context
|
||||
@@ -219,6 +220,9 @@ impl TranscriptConfig {
|
||||
ContextSection::RetainedUserInstructions { items } => {
|
||||
ContextSection::RetainedUserInstructions { items }
|
||||
}
|
||||
ContextSection::PermissionContext { items } => {
|
||||
ContextSection::PermissionContext { items }
|
||||
}
|
||||
ContextSection::PlannedAction(action) => ContextSection::PlannedAction(action),
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
@@ -191,7 +191,8 @@ impl PromptBuilder {
|
||||
|
||||
for section in transcript.sections {
|
||||
match section {
|
||||
ContextSection::RootConversation { items }
|
||||
ContextSection::PermissionContext { items }
|
||||
| ContextSection::RootConversation { items }
|
||||
| ContextSection::RetainedUserInstructions { items }
|
||||
| ContextSection::TrustedUserAnswers { items } => {
|
||||
for text in items {
|
||||
|
||||
Reference in new issue
Block a user