Skip to content

fix(openai): normalize Codex Desktop browser tab context - #9015

Open
devilsen wants to merge 1 commit into
Wei-Shaw:mainfrom
devilsen:fix/codex-browser-tabs-http
Open

devilsen wants to merge 1 commit into
Wei-Shaw:mainfrom
devilsen:fix/codex-browser-tabs-http

Conversation

@devilsen

Copy link
Copy Markdown

Codex Desktop can send browser tab context as an agent.browser_tabs item with no call_id. The HTTP Responses handler currently rejects this input with 400 invalid_request_error before forwarding the request.

This change extends the existing Codex context normalizer to recognize the Desktop ambient browser context wrapper and preserve its text in place. Real tool outputs still go through the existing validation.

A synthetic regression reproduces the 400 on main at 328db26 and passes with the fix. It covers mixed tool history, ordinary user messages, repeated normalization, and malformed context. The full internal/handler unit suite passed with one skip.

go test -tags unit ./internal/handler -count=1

Fixes #8999

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

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

@devilsen

Copy link
Copy Markdown
Author

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

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.

[Bug] Codex Desktop agent.browser_tabs without call_id triggers HTTP Responses 400

1 participant