Repository navigation
Studio: only strip a valid trailing __IMAGES__/__RAG_SOURCES__ envelope - #10668
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (2)
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Reproduction and before/after evidence1. The defect on Actions. Two branches off the same fresh
What the model loses on Four cases pass on both sides, so the envelope is still being stripped: the sandbox 2. What it looks like in Studio. Two isolated installs, merge base The tool card is identical on both halves — all four lines, artifact URL and sha256 plainly visible. That is the point: nothing looks wrong on screen while the model answers from a log cut at the quoted marker.
Held on both sides: 3. Follow-up commit |
|
Confirmed this hits strip_result_for_model in studio/backend/core/inference/tool_loop_controller.py, where an unanchored split still cuts any tool result that merely quotes the marker while the card shows the whole thing, and the stacked code_execution case is covered too. Will get this reviewed. |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Follow-up on the security review item, and the A/B re-run on the final head.
Re-partitioning copied the shortened string once per marker, so the cost was quadratic in the marker count even though the search itself was not. It now records the leftmost valid envelope by index and slices once. The regression test asserts the scaling rather than a wall-clock budget, so it means the same thing on a loaded runner as on a laptop: quadrupling the markers must cost under 10x the time. On A/B re-run on
The before/after Studio evidence above has been re-shot against |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56e2b63d76
ℹ️ 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".
| if tool_name is None or tool_name in _IMAGE_SENTINEL_TOOLS: | ||
| result = _strip_images_sentinel(result) |
There was a problem hiding this comment.
Gate frontend image parsing by the emitting tool
When an MCP or fetch result ends with a valid line such as __IMAGES__:["icon.png"]—the exact case this new allowlist preserves—the frontend still finds the marker for every tool and converts the suffix into an image result without checking toolName (chat-adapter.ts:6742-6743, 6801-6815). Consequently the model receives the complete document while the user's card hides its final line and attempts to load icon.png from the sandbox, contrary to the consistency this change relies on; apply the same emitter gate in the frontend parser.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in d779666. Checked the adapter first: it already gates FILES on SANDBOX_FILE_TOOLS and WEB_IMAGES on SEARCH_IMAGE_TOOL, each with a comment that elsewhere the line is content, and the IMAGES slice right below them was the one left ungated. It is now gated on IMAGE_SENTINEL_TOOLS, exported next to SANDBOX_FILE_TOOLS in sandbox-files.ts and matching the backend set exactly: python, terminal, and the hosted code_execution. A document an MCP tool read that ends in a well-formed line now stays on the card as text, and the card no longer asks the sandbox route for a file nobody wrote. Test asserts the set and, like the other chat-adapter tests, the source: it fails on the previous head with 'the IMAGES slice is no longer gated'. Frontend suite: 208 pre-existing failures on this box before and after, none new. The search index (use-chat-search-index.ts) still slices the marker for every tool, but it has no tool name in scope and only decides what text is searchable, so I left it.
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Lyxot
left a comment
There was a problem hiding this comment.
Reproduced the truncation on the merge base (a terminal grep hit quoting __IMAGES__: reached the model as tools.py:16134: out += f"\n) and confirmed the head keeps the full result while still stripping the sandbox, stacked Gemini code_execution, and retrieval envelopes. The anchored, validated strippers mirror _strip_files_sentinel and _strip_mcp_image_suffix beside them, the emitter allowlists match every producer of both markers, and the frontend gate keeps the card and the model in agreement. Touched backend tests and the new frontend test pass locally. LGTM.
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |

A tool result that merely mentions
__IMAGES__:or__RAG_SOURCES__:, even mid-line, gets cut off there before the model sees it. The tool card still shows the full output, so nothing looks wrong. Grepping this repo or reading a file that contains the marker triggers it.The two markers are now handled like
__FILES__next to them: the marker has to start a line and be followed by a real JSON list, only the tools that emit the envelope have it removed, and every trailing envelope goes, not just the last one. Test fixtures that used shapes no tool produces are updated.