Skip to content

Propagate turn metadata to standalone web search#31911

Open
XMLIU-oai wants to merge 3 commits into
mainfrom
fix-standalone-search-turn-metadata
Open

Propagate turn metadata to standalone web search#31911
XMLIU-oai wants to merge 3 commits into
mainfrom
fix-standalone-search-turn-metadata

Conversation

@XMLIU-oai

@XMLIU-oai XMLIU-oai commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • attach per-turn Responses API metadata to extension tool calls
  • forward that metadata as x-codex-turn-metadata on standalone web search requests
  • cover the turn/start to Alpha Search HTTP boundary with an end-to-end regression test

Impact

Currently x-codex-turn-metadata is not passed to standalone web search, which is a metadata-propagation regression.

The header contains Search context, including search_user_metadata, and telemetry attributes such as model_id. Search uses plan, residency, and compliance context when applying provider policy.

Testing

  • just test -p codex-app-server standalone_web_search_round_trips_output
  • just clippy -p codex-tools -p codex-core -p codex-web-search-extension -p codex-app-server
  • just fmt
  • git diff --check
  • Local Tilt end-to-end validation:
    • started codex-backend and Responses API locally
    • sent an authenticated POST /api/codex/alpha/search request with originator: codex_flora
    • captured the downstream POST /v1/alpha/search request and verified it included x-codex-turn-metadata
    • verified mcp_request_meta -> openai/search_context -> telemetry_attributes.model_id contained the unique test marker
    • ran the production Responses API _model_id_from_headers(...) parser against the captured header and verified it returned the same model ID
    • received HTTP 200 with non-empty encrypted output
    • local Sonic schema DNS was unavailable, so final Sonic metric emission was not validated locally

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@XMLIU-oai XMLIU-oai force-pushed the fix-standalone-search-turn-metadata branch from 47243dd to 1518eb8 Compare July 9, 2026 21:41
@XMLIU-oai

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jul 9, 2026
@XMLIU-oai XMLIU-oai marked this pull request as ready for review July 10, 2026 05:15
@XMLIU-oai XMLIU-oai requested a review from a team as a code owner July 10, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants