Repository navigation
fix(openai): normalize Codex Desktop page context before tool validation - #8622
Merged
Merged
Conversation
Contributor
|
All contributors have signed the CLA. ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
2 tasks done
linshisancc
pushed a commit
to linshisancc/sub2api
that referenced
this pull request
Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Codex Desktop can inject
agent.codex_apps_open_pageandagent.codex_apps_selected_page_part_N_of_Minto the first HTTP Responses request asfunction_call_outputitems withoutcall_id. These carry page context rather than the result of a model-issued tool call. The existing validator rejects the request withfunction_call_output requires call_id, even when the snapshot contains only a nullpage_id.Normalize these recognized page-context items to user-role
input_textbefore bootstrap normalization and HTTP tool validation. Preserve the original context, ordering, multipart fragments, history and numeric precision. Matching requires the expected namespace, name and snapshot shape; actual tool outputs and unrelated malformed items retain the existing validation behavior. Duplicate JSON keys and invalid payloads are left unchanged.Regression tests cover the original 400 response, successful validation after normalization, idempotence, real tool history, mixed automation/delegation context, multipart snapshots and malformed inputs.
Validation:
go test -tags=unit ./internal/handler -count=1 -timeout=180sgolangci-lint run --timeout=10m ./...(v2.14.0)Refs #8609.