Skip to content

Conversation

@aibrahim-oai
Copy link
Collaborator

  1. Avoid double truncation by giving 10% above the tool default constant
  2. Add tests that fails when const = 1

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

let remaining = MODEL_FORMAT_MAX_BYTES.saturating_sub(result.len());
if remaining == 0 {
return result;
}
let tail_part = take_last_bytes_at_char_boundary(tail_slice, remaining);
result.push_str(tail_part);

P1 Badge Honor limit_bytes when appending tail section

The new signature of truncate_formatted_exec_output accepts limit_bytes, but the tail assembly at lines 128‑133 still subtracts from the hard coded MODEL_FORMAT_MAX_BYTES. As a result the function never returns more than 10 KiB of body text even when the caller (e.g. ContextManager::process_item) passes the new 1.1× limits, so the additional headroom you introduced is never honored and tool outputs can still be double‑truncated. remaining (and therefore the tail slice) needs to be computed from limit_bytes, otherwise the change in history.rs has no effect.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@aibrahim-oai aibrahim-oai merged commit 9890ceb into main Nov 14, 2025
25 checks passed
@aibrahim-oai aibrahim-oai deleted the avoid-double-truncation branch November 14, 2025 00:59
@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants