Skip to content

[codex] Forward Codex Apps tool call IDs to backend metadata#19207

Merged
rreichel3-oai merged 4 commits intomainfrom
rreichel3/codex-apps-call-id-meta
Apr 24, 2026
Merged

[codex] Forward Codex Apps tool call IDs to backend metadata#19207
rreichel3-oai merged 4 commits intomainfrom
rreichel3/codex-apps-call-id-meta

Conversation

@rreichel3-oai
Copy link
Copy Markdown
Contributor

Summary

  • include the outer tool call_id in Codex Apps MCP request metadata under _meta._codex_apps.call_id
  • preserve existing Codex Apps metadata like resource_uri and contains_mcp_source
  • add request metadata coverage for both the existing-metadata and no-existing-metadata cases

Why

The paired backend change in openai/openai#850796 updates MCP compliance logging to prefer _meta._codex_apps.call_id instead of the JSON-RPC request id. This client change sends that outer tool call id so the backend can record the model/tool call identifier when it is available.

This is wire-compatible with older backends because _meta._codex_apps is already reserved backend-only metadata. Backends that do not read call_id will ignore the extra field.

Testing

  • cargo test -p codex-core request_meta
  • just fmt
  • just fix -p codex-core

@rreichel3-oai rreichel3-oai requested a review from a team as a code owner April 23, 2026 21:15
Update the Codex Apps file MCP integration test to expect the forwarded outer tool call ID in _meta._codex_apps.

This keeps the suite aligned with the new client metadata contract used by the paired backend compliance logging change.
Update the deferred-tool search integration test to expect the forwarded outer tool call ID in Codex Apps metadata.

This keeps the search-tool flow aligned with the same _meta._codex_apps contract exercised by the direct MCP tool call tests.
let meta = build_mcp_tool_call_request_meta(
&turn_context,
"custom_server",
"call-custom",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I know this is a test, but isn't a more representative call_id something like "call_abc123xyz789"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed, thanks for the callout

@rreichel3-oai rreichel3-oai merged commit 219c65d into main Apr 24, 2026
25 checks passed
@rreichel3-oai rreichel3-oai deleted the rreichel3/codex-apps-call-id-meta branch April 24, 2026 22:49
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 24, 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.

3 participants