Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .codex-nightly-retry-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
The previous attempt produced no source, test, docs, or example changes.

Continue working. A successful nightly slot must produce a small, honest,
maintainer-reviewable PR unless the repository is technically impossible
to patch for this target.

Requirements for this retry:
- Search the local repository for a directly related patch surface.
- Prefer a focused test, docs/example correction, typing/schema fix, CLI behavior fix, or small error-handling improvement.
- If the exact upstream symptom is server-side, produce a repository-local improvement that prevents user confusion or locks existing behavior without falsely claiming to fix the server.
- Do not stop with only NIGHTLY_REPORT.md.
- Modify at least one tracked source, test, docs, or example file if a defensible PR exists.
- Keep the diff small and explain the rationale in NIGHTLY_REPORT.md.
5 changes: 5 additions & 0 deletions NIGHTLY_CODEX_FINAL_ATTEMPT_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Wrote [NIGHTLY_REPORT.md](/home/runner/work/oss-nightly-control/oss-nightly-control/target/NIGHTLY_REPORT.md) and made no code changes.

Reason: upstream already has an active duplicate PR, `openai/openai-python#2742`, that directly fixes `openai/openai-python#2736` with the same intended `ActionSearchSource` type updates. Opening another PR for the same two generated files would be misleading.

Tests were not run because no code was changed. Existing untracked files `.codex-nightly-prompt.md` and `uv.lock` were left untouched.
14 changes: 14 additions & 0 deletions NIGHTLY_CODEX_FINAL_ATTEMPT_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Implemented a small PR-ready patch for the `ActionSearchSource` typing gap.

Changed:
- [response_function_web_search.py](/home/runner/work/oss-nightly-control/oss-nightly-control/target/src/openai/types/responses/response_function_web_search.py): allows `type="api"`, adds optional `name`, makes `url` optional.
- [response_function_web_search_param.py](/home/runner/work/oss-nightly-control/oss-nightly-control/target/src/openai/types/responses/response_function_web_search_param.py): mirrors the param `TypedDict` shape.
- [test_response_function_web_search.py](/home/runner/work/oss-nightly-control/oss-nightly-control/target/tests/api_resources/responses/test_response_function_web_search.py): regression test for API search sources.
- [NIGHTLY_REPORT.md](/home/runner/work/oss-nightly-control/oss-nightly-control/target/NIGHTLY_REPORT.md): updated rationale, tests, risks.

Verification:
- `uv run --with pytest --with pytest-asyncio --with pytest-xdist pytest tests/api_resources/responses/test_response_function_web_search.py -q` passed.
- `uv run --with pyright pyright ...` on touched files passed.
- `uv run --with ruff ruff check ...` on touched files passed.

Note: there are unrelated/untracked nightly artifacts already present in the worktree, plus `uv.lock` is untracked. I left them untouched.
9 changes: 6 additions & 3 deletions src/openai/types/responses/response_function_web_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
class ActionSearchSource(BaseModel):
"""A source used in the search."""

type: Literal["url"]
"""The type of source. Always `url`."""
type: Literal["url", "api"]
"""The type of source. One of `url` or `api`."""

url: str
name: Optional[str] = None
"""The name of the source."""

url: Optional[str] = None
"""The URL of the source."""


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
class ActionSearchSource(TypedDict, total=False):
"""A source used in the search."""

type: Required[Literal["url"]]
"""The type of source. Always `url`."""
type: Required[Literal["url", "api"]]
"""The type of source. One of `url` or `api`."""

url: Required[str]
name: str
"""The name of the source."""

url: str
"""The URL of the source."""


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from typing import cast

from openai._models import construct_type
from openai.types.responses.response_function_web_search import ActionSearch, ResponseFunctionWebSearch


def test_action_search_source_allows_api_sources() -> None:
response = cast(
ResponseFunctionWebSearch,
construct_type(
type_=ResponseFunctionWebSearch,
value={
"id": "ws_123",
"type": "web_search_call",
"status": "completed",
"action": {
"type": "search",
"query": "openai docs",
"queries": ["openai docs"],
"sources": [
{
"type": "api",
"name": "OpenAI Docs",
}
],
},
},
),
)

action = cast(ActionSearch, response.action)
assert action.type == "search"
assert action.sources is not None
assert action.sources[0].type == "api"
assert action.sources[0].name == "OpenAI Docs"
assert action.sources[0].url is None