fix(types): allow missing find-in-page URLs - #3797
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ 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. |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8ff8a593d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| @@ -60845,7 +60845,6 @@ components: | |||
| The pattern or text to search for within the page. | |||
| required: | |||
| - type | |||
There was a problem hiding this comment.
Regenerate the transformed spec metadata with this schema change
When either CI test job runs (.github/workflows/ci.yml:184 and :219), ./scripts/test invokes ./scripts/mock --daemon, whose hash guard in scripts/mock:10-17 now exits before pytest: this edit changes the transformed spec's MD5 to bb4a7276..., while .castiron.stats.yml still declares c534613f.... Land the schema correction through the generator so the spec and its provenance metadata are emitted consistently rather than leaving every standard test run unable to start.
AGENTS.md reference: AGENTS.md:L78-L80
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Thanks for catching this. I have now removed the hand-edited transformed YAML/hash workaround in 827e7a6, so the branch keeps the main generation metadata and scripts/mock hash guard passes without accepting an ungenerated artifact. The SDK generated type changes remain the same narrow fix as the maintainer PR #3792; a canonical source-schema regeneration would need to happen from openai/openai-openapi and then be promoted by the project generator.
|
Synced this branch with the latest upstream Validation after the sync:
@codex review |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41514ec7c0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| ids=["responses", "beta"], | ||
| ) | ||
| def test_find_in_page_action_allows_missing_url(response_model: type[BaseModel]) -> None: | ||
| response = response_model.model_validate( |
There was a problem hiding this comment.
Parse with the Pydantic compatibility helper
When ./scripts/test reaches its Pydantic-v1 lane, this test fails before exercising the new behavior because Pydantic 1.10's BaseModel has no model_validate method (the SDK uses openai._compat.parse_obj to bridge that API difference). Use that helper or normal model construction so the standard CI test workflow passes under both supported Pydantic versions.
AGENTS.md reference: AGENTS.md:L78-L80
Useful? React with 👍 / 👎.
|
The maintainer PR #3792 overlaps this PR on the same issue ( |
|
Addressed the review feedback in 573e80c:
Validation:
|
|
@codex review |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 573e80ca93
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| generation_id: 08cffa97-63b1-4ab3-b3e4-9d438f45458f | ||
| openapi_spec_hash: fcdb9c99a509f5ea8b90d7abbf1dab2f | ||
| openapi_transformed_spec_hash: dd244f7dd3ab9d18dc2c34970a39505f | ||
| openapi_transformed_spec_hash: b89149adbcfe03e6539e15400d412b14 |
There was a problem hiding this comment.
Regenerate instead of rewriting the spec hash
Fresh evidence after the earlier hash-guard comment is that this revision changes only openapi_transformed_spec_hash to match the hand-edited transformed YAML while leaving generation_id, openapi_spec_hash, and codegen_sha unchanged. This makes scripts/mock accept an artifact that was not produced by the recorded generation, defeating the provenance/custom-code controls rather than fixing them; regenerate from the corrected source schema so the transformed spec, generated code, checkpoint, and metadata update together.
AGENTS.md reference: AGENTS.md:L12-L18
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. 827e7a6 removes the manual transformed-spec and provenance changes rather than rewriting only openapi_transformed_spec_hash. The branch now leaves generation_id, openapi_spec_hash, codegen_sha, and the transformed-spec hash unchanged from main; the local hash guard passes. I have left the generated SDK type fix and regression coverage for maintainer review, while #3792 provides the overlapping canonical implementation.
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ 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". |
|
The repository-standard entrypoint now also passes on the cleaned branch: |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Summary
find_in_pageaction URLs optional in the Responses and Beta response models.action.url.Fixes #3788
Bug
A completed hosted web search item can contain a
find_in_pageaction withpatternbut nourl. The generated Responses and Beta models currently require that field, so validating the payload raises aValidationErrorforaction.ActionFind.url.Expected behavior: the SDK accepts the payload and represents the missing URL as
None, matching the existingopen_page.urlbehavior.Root cause
The generated action types do not reflect the live response shape. This PR keeps the change limited to the generated model/parameter types and regression test; it intentionally does not hand-edit
api_reference/openapi.transformed.ymlor.castiron.stats.yml, because those provenance files must be regenerated from the authoritative OpenAPI source before being changed.The overlapping maintainer PR #3792 addresses the same generated types. This PR is left open for the maintainer to choose the canonical implementation; it does not claim an ungenerated schema artifact.
Validation
PYTHONPATH=src ./scripts/test tests/lib/responses/test_responses.py— 11 passed in the standard mock/metadata path and 11 passed in the Pydantic v1 laneuv run --locked ruff check tests/lib/responses/test_responses.pyuv run --locked ruff format --check tests/lib/responses/test_responses.pygit diff --check