Skip to content

[codex] Test code-mode variable truncation#28471

Merged
aibrahim-oai merged 6 commits into
mainfrom
codex/fix-code-mode-output-budgets
Jun 17, 2026
Merged

[codex] Test code-mode variable truncation#28471
aibrahim-oai merged 6 commits into
mainfrom
codex/fix-code-mode-output-budgets

Conversation

@aibrahim-oai

@aibrahim-oai aibrahim-oai commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Code mode has two separate truncation points: the nested tool result returned to JavaScript and the code-mode output later recorded for the model. These tests now verify those behaviors independently.

  • Report whether result.output was truncated before printing it.
  • Verify omitted or sufficiently large nested limits produce Variable truncated: False, while allowing the printed value to be truncated downstream.
  • Verify an explicit nested limit produces Variable truncated: True when the command output exceeds it.
  • Use a token-policy model fixture so downstream truncation is visible as …N tokens truncated….
  • Align the explicit nested-truncation expectation with the warning header.

This PR changes test coverage only; runtime truncation behavior is unchanged.

Validation

  • env -u CODEX_SANDBOX_NETWORK_DISABLED RUST_MIN_STACK=8388608 cargo test -p codex-core --test all code_mode_exec -- --nocapture (8 passed)

@aibrahim-oai
aibrahim-oai marked this pull request as ready for review June 16, 2026 15:27
@aibrahim-oai
aibrahim-oai requested a review from a team as a code owner June 16, 2026 15:27

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5db4e82910

ℹ️ 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".

Comment thread codex-rs/core/src/context_manager/history.rs Outdated
@aibrahim-oai aibrahim-oai reopened this Jun 16, 2026
@aibrahim-oai
aibrahim-oai force-pushed the codex/fix-code-mode-output-budgets branch from 5db4e82 to a1a28e7 Compare June 16, 2026 19:54
@aibrahim-oai aibrahim-oai changed the title [codex] Preserve code-mode output budgets in history [codex] Test code-mode variable truncation Jun 16, 2026

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a1a28e7d58

ℹ️ 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".

Comment thread codex-rs/core/tests/suite/code_mode.rs

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0270bc4f53

ℹ️ 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".

Comment thread codex-rs/core/tests/suite/code_mode.rs Outdated
Comment thread codex-rs/core/tests/suite/code_mode.rs Outdated
@aibrahim-oai
aibrahim-oai merged commit 0a3ad4c into main Jun 17, 2026
31 checks passed
@aibrahim-oai
aibrahim-oai deleted the codex/fix-code-mode-output-budgets branch June 17, 2026 03:14
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 17, 2026
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.

2 participants