mirror of
https://github.com/openai/codex.git
synced 2026-10-27 18:48:37 +00:00
Honor configured message limits for encrypted guardian transcripts (#57241)
Remove the hard-coded 9,000-token cap for encrypted agent messages in both synchronous and asynchronous guardian context. Use `message_tokens` directly when converting the configured limit to a byte budget, allowing larger messages when the configured limit permits them. Messages that exceed the configured budget still produce an omission notice; encrypted content remains intact when retained. GitOrigin-RevId: a9032ca19102ebad44be8df1ac4d4892d4404ead
This commit is contained in:
@@ -316,10 +316,8 @@ fn prepare_sync_content<'a>(
|
||||
TranscriptContent::Record(record) => record.text(),
|
||||
TranscriptContent::AgentMessage(_) => {
|
||||
// Native ciphertext stays whole, or leaves an omission at the same position.
|
||||
let limit = codex_protocol::protocol::TruncationPolicy::Tokens(
|
||||
limits.message_tokens.min(/*other*/ 9_000),
|
||||
)
|
||||
.byte_budget();
|
||||
let limit = codex_protocol::protocol::TruncationPolicy::Tokens(limits.message_tokens)
|
||||
.byte_budget();
|
||||
return if entry.original_bytes > limit {
|
||||
std::borrow::Cow::Owned(TranscriptContent::Text(
|
||||
crate::transcript::TRANSCRIPT_OMISSION_NOTICE.to_owned(),
|
||||
|
||||
@@ -217,7 +217,7 @@ fn collect_transcript_for_target(
|
||||
TranscriptContent::AgentMessage(Box::new(item.clone()))
|
||||
} else {
|
||||
let limit = codex_protocol::protocol::TruncationPolicy::Tokens(
|
||||
config.entry_limits.message_tokens.min(9_000),
|
||||
config.entry_limits.message_tokens,
|
||||
)
|
||||
.byte_budget();
|
||||
if bytes <= limit {
|
||||
|
||||
Reference in New Issue
Block a user