mirror of
https://github.com/openai/codex.git
synced 2026-09-04 15:08:45 +00:00
guardian: cap planned action context
This commit is contained in:
@@ -54,7 +54,7 @@ const GUARDIAN_MAX_MESSAGE_TRANSCRIPT_TOKENS: usize = 10_000;
|
||||
const GUARDIAN_MAX_TOOL_TRANSCRIPT_TOKENS: usize = 10_000;
|
||||
const GUARDIAN_MAX_MESSAGE_ENTRY_TOKENS: usize = 2_000;
|
||||
const GUARDIAN_MAX_TOOL_ENTRY_TOKENS: usize = 1_000;
|
||||
const GUARDIAN_MAX_ACTION_STRING_TOKENS: usize = 16_000;
|
||||
const GUARDIAN_MAX_ACTION_STRING_TOKENS: usize = 10_000;
|
||||
const GUARDIAN_RECENT_ENTRY_LIMIT: usize = 40;
|
||||
const TRUNCATION_TAG: &str = "truncated";
|
||||
|
||||
|
||||
@@ -827,6 +827,10 @@ fn format_guardian_action_pretty_truncates_large_string_fields() -> serde_json::
|
||||
assert!(rendered.text.contains("\"tool\": \"apply_patch\""));
|
||||
assert!(rendered.text.contains("<truncated omitted_approx_tokens="));
|
||||
assert!(rendered.text.len() < patch.len());
|
||||
assert!(
|
||||
rendered.text.len() < 80_000,
|
||||
"guardian action text should stay below the 10k-token context review cap"
|
||||
);
|
||||
assert!(rendered.truncated);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user