Repository navigation
Edit text in selected Runner tool results before tracing and publication - #6141
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)
ℹ️ 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. |
There was a problem hiding this comment.
Approved at e05a2ee67a5447052d48e1e58d95764fd1e31391. Reviewed the full nine-file change and surrounding invocation, MCP conversion, tracing, and publication paths, with two independent reviews. No actionable findings. Exact function/server identity selection, edited text and retained-media ordering, typed JSON validation and conversion preservation, approval/resume and stream argument isolation, failure/timeout/cancellation handling, and process-control diagnostic redaction are consistent with the documented scope. Regression tests cover SDK/OpenTelemetry traces, streamed output, saved history, and the next model request.
The editor and retained media remain trusted; completed tool side effects cannot be undone, and hosted/native tools are outside this feature. Hosted CI is complete: 33 checks passed and 2 skipped; no failures. Static review only; no candidate code or local tests executed.
Preserve native approval receipts and optional run budgets in the same checkpoint.
Update feat/runner-tool-text-transforms against feat/simple-codex.
There was a problem hiding this comment.
Re-reviewed current commit b2ed3f71cb8f2777bf77ebc8756afbee680304b7 and the selector/admission/restore changes since the prior approval. Checked exact function and MCP server identity, namespaced dispatch collisions, weak-reference preservation through tool copying, requirement binding before admission and rechecking before side effects, and persistence of incomplete selected calls in schema 1.23. Missing or stale editors are rejected before a paused session becomes active; nested agent-tool policies follow the same live override/inheritance rules as execution, and rejected calls do not require an editor. Reviewed the new restore and retryability cases alongside the existing output transformation and redaction paths; no actionable regression found.
Hosted CI: {'SUCCESS': 17, 'IN_PROGRESS': 7}. Unfinished checks remain pending follow-up. Static review only; no candidate code or local tests executed.
Hosted CI follow-up (2026-11-22 22:40 UTC): all 33 executed checks passed; 2 checks skipped. No checks remain pending for this commit. Static review only; no local tests executed.
Update feat/runner-observed-budgets against feat/simple-codex.
Update feat/runner-tool-text-transforms against feat/simple-codex.
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 62e9fddd40
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Request changes at 62e9fddd407ff12239585432369076e740f1bc15: independently confirmed the existing canonical MCP identity mismatch.
HTTP/SSE default names include the raw URL, while MCP tool bindings strip credentials, query, and fragment. If the application recreates the same endpoint with a rotated query token but retains the prior object selector, bind_text_transform skips the registration on raw-name inequality before reaching its same-key/exact-object guard. A fresh call can then publish the result without its editor even though its canonical server/tool binding is unchanged. Previously marked paused calls still fail closed; the issue is fresh calls with a stale selector.
Compare the same canonical server identity used by bindings before deciding a selector is unrelated, then retain the exact-object requirement. Add a regression for a changed URL credential/query/fragment and verify no call or unedited output occurs until the new object is registered. Linking the existing finding rather than adding a duplicate inline comment.
Static review with independent confirmation; no candidate code or tests were executed locally. Hosted CI follow-up remains tracked.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved after static re-review and independent confirmation of edfb871. The canonical MCP identity finding is addressed: discovery and selector comparison now use the same sanitized identity, while exact server-object and raw-tool requirements remain enforced. Stale registrations fail before invocation; a registration for the replacement object permits edited output. Reviewed HTTP/SSE credential, query and fragment rotation regressions in both Runner modes and alias handling. No new actionable findings.
Hosted CI at review: 9 checks passed, 15 running. Follow-up remains tracked. Static review only; no candidate code or tests executed locally.
Update feat/runner-tool-text-transforms against feat/simple-codex.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved after static re-review of the current commit and independent review.
The redaction integration checks edited function and MCP text before publication while preserving protected raw-stream behavior. Restored MCP transform requirements are validated against the saved server index, raw tool name, canonical name, and current exact selector before the durable claim, then live binding is checked again before invocation. Missing required editors leave the paused checkpoint available for a compatible worker. The added coverage exercises approval restoration, redaction, and missing-editor recovery in both run modes.
No actionable findings in the refreshed diff or surrounding integration. Hosted checks were still running at the latest observation; no failures observed. Static review only; no candidate code or local tests executed.
Update feat/runner-observed-budgets against feat/simple-codex.
Update feat/runner-tool-text-transforms against feat/simple-codex.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved after independent static re-review of the refreshed base and session integration. The approved-function availability check and pending text-transform validation both run before claiming the paused checkpoint. Missing functions or editors leave it retryable; a compatible retry executes once and reaches ready. Native recovery validation and live binding checks remain intact. No new actionable findings.
Hosted CI: 22 passed and 2 running at the latest observation. Static review only; no candidate code or local tests executed.
|
Hosted CI update for For history, attempt 1 installed successfully but its native approval verifier's Hosted logs and check results only; no candidate code or local tests were executed. |
Update feat/runner-tool-text-transforms against feat/simple-codex.
There was a problem hiding this comment.
Approved after static re-review and an independent second review of the refreshed base. Workspace-tool availability, approved-function availability, and required text-editor checks all remain before the paused-session claim. Native approval validation is preserved. Declaration preparation/resume checks coexist with exact tool/server text-transform bindings; MCP recipient, filter, and name are rechecked before the peer call, including after metadata resolution.
Reviewed persisted invocation fields, canonical MCP identity, selected-tool error protection, and the refreshed integration with output redaction. No new actionable findings; the previous canonical-identity finding remains addressed.
Hosted CI at review: 5 checks passed and 19 running, with no failures observed. Pending checks remain tracked. Static review only; no candidate code or local tests executed.
CI follow-up (November 23): all hosted checks at this reviewed commit have completed: 33 passed and 2 skipped, including all eight wheel verifiers. The pending CI follow-up above is resolved. No candidate code or local tests executed.
Update feat/runner-observed-budgets against feat/simple-codex.
Keep the budget reader from #6129 in the next approval checkpoint version.
There was a problem hiding this comment.
Approved after static re-review of the changes since the previous approval and their integration with the previously reviewed budget dependency, with an independent second review. No new actionable findings.
The shared resume preflight checks current-context grants, unique delegate/function bindings, and required child editors before claiming a paused session or running approved siblings. Schema 1.26 preserves editor requirements through nested restoration while accepting genuine 1.25 budget snapshots. MCP discovery retains exact object and canonical identity checks; the unfiltered raw-name snapshot rejects stale or misspelled selectors, with filtered/no-catalog limitations documented. Existing selected-output redaction and failure protection remain intact.
Retain the documented merge order: merge #6129 first.
Hosted CI at review: 14 successful checks and 10 still running; no failures observed. Pending checks remain tracked. Static review only; no candidate code or local tests executed.
Hosted CI update (2026-11-24 01:31 UTC): all checks are terminal, with 33 successful and 2 skipped; no failures.
There was a problem hiding this comment.
Approved after static re-review and an independent second review. The incremental change clarifies FunctionTool versus MCP server-object selectors, text-slot ordering, and media preservation. Invalid-target diagnostics remain constant and do not expose caller-supplied names; the added regression covers the wrong selector route. Previously reviewed validation and execution behavior is unchanged. No actionable findings.
Hosted CI at review: 20 checks passed and 4 running, with no failures. Remaining checks require follow-up. The dependency on PR #6129 remains. Static review only; no candidate code or local tests executed.
Hosted CI follow-up (2026-11-24 02:20 UTC): all checks at this reviewed commit are complete: 33 passed and 2 skipped, with no failures. The pending CI follow-up is resolved. Static review only; no candidate code or local tests executed.
Update feat/runner-observed-budgets against feat/simple-codex.
Keep the budget reader from #6129 in the next approval checkpoint version.
There was a problem hiding this comment.
Approved after static re-review and an independent second review at 2444a27. Malformed registrations and invalid editor results now receive actionable, payload-free errors. Reviewed the exact sentinel handling, both tool routes, cancellation, selector/resume checks, and integration with the updated budget dependency. No actionable findings. The dependency on PR #6129 remains.
Hosted CI: 17 passed, 7 in progress; remaining checks need follow-up. No candidate code or local tests were executed.
Hosted CI follow-up (2026-11-24 03:32 UTC): all checks at this reviewed commit are complete: 33 passed and 2 skipped, with no failures. The pending CI follow-up is resolved. Static review only; no candidate code or local tests executed.
…ings Update feat/runner-tool-text-transforms against feat/simple-codex.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved after static re-review and an independent second review. MCPTextTransform preserves exact server identity and raw-name selection, including the prior canonical-identity fix. Built-in filtered catalogs retain raw names from completed discovery; namespace-source checks reject accidental registration of the original function while allowing the exact namespaced copy. Editor list results are frozen and shape-validated before publication. Rechecked shared resume preflight and schema compatibility with the now-merged budget dependency. No actionable findings.
Hosted CI at the latest observation: 9 passed and 15 running, with no failures. Completion remains pending. Static review only; no candidate code or local tests executed.
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ 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". |
There was a problem hiding this comment.
Re-reviewed the two-file refresh with an independent second static review. Whitespace-only MCP tool names now fail before use while valid raw names are preserved exactly; the separate editor-callability error remains payload-free. Added documentation accurately explains existing selected-editor precedence and native-MCP scope. No new actionable findings.
Fresh hosted CI is running (latest inspected snapshot: 12 passed, 12 running). The prior head's Windows/Python 3.14 job failed in the unchanged native-close observation test: https://github.com/openai/openai-agents-python/actions/runs/45343677776/job/138281400168. That historical failure is not evidence about this new head's eventual CI result. Static review only; no candidate code or tests executed.
Hosted CI update (2026-11-24 07:47 UTC): 33 passed, 2 skipped; no checks remain pending in the current rollup. Approval is unchanged. No local tests were run.
Summary
Built on #6129. Its call and token limits stay in effect when a saved tool approval also requires an editor.
A tool result may reach a trace before a general output hook can edit it. This change lets a Python Runner edit selected text before publishing the result to SDK traces, history or the next model call.
Use the exact function in the agent's tools. For MCP, use the connected server object and the tool's original name.
The editor returns a list or tuple with one replacement per text slot. Media stays in place. Typed function output uses one JSON slot and must still pass validation.
redact_text, when configured, runs on edited text before validation. A selected call skipsprepare_tool_output, even when the editor returns the original text. For SDK-discovered MCP, the generic hook runs after custom data extraction. Apply required output rules in the selected editor or at the source. An invalid edit or a tool failure stops publication. Completed tool effects cannot be undone.tool_namespace. After reconnecting, register the new server object. A name match never grants permission to edit another object.Only SDK functions and SDK-discovered MCP tools use this option. #6133 edits whole native MCP results on servers configured in Codex. Hosted tools, media, application logs and transport diagnostics need their own protections.
Test plan
The SDK suite passed 14,137 tests with 53 skipped and 88 deselected. The latest 279 focused tests covered the editor, approval checks and validation of blank raw names. The earlier budget integration passed 859 focused tests. Four saved approvals from the earlier editor build resumed in regular and streamed runs with the same budget and editor. Additional checks covered a missing editor, a disabled tool, nested approvals, filtered MCP names and preservation of media. These were offline checks.
Checks