Repository navigation
feat(api): add Agents API - #3847
Conversation
Castiron-Internal-PR: openai/openai-python-internal#75 Castiron-Source-SHA: 97896898c58d6c11eddfe60dc2671ef0501c4bf8 Castiron-Public-Base-SHA: 603b81f
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. |
Castiron custom codeMixed files: 41 → 43 2 newly customized · 0 customizations removed · 1 existing customizations changed · 2 generated baselines changed Compared
38 existing customizations unchanged
A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload the exact patch produced by this run (requires repository access): gh run download 34520344275 --repo openai/openai-python \
--name castiron-custom-code-34520344275-1 --dir /tmp/castiron-custom-code-34520344275-1
git apply --stat /tmp/castiron-custom-code-34520344275-1/custom-code.patch
cat /tmp/castiron-custom-code-34520344275-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 603b81f9e228d95032059169cb3a0e7dc12ba93f d5370ba5ea38fff1d5786bc5b3bc526b4ccffed4
python3 scripts/castiron/custom_code_report.py report \
--base 603b81f9e228d95032059169cb3a0e7dc12ba93f \
--head d5370ba5ea38fff1d5786bc5b3bc526b4ccffed4 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-d5370ba5ea38
cat /tmp/castiron-custom-code-d5370ba5ea38/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
| """Whether to stream session events as server-sent events. Defaults to `false`.""" | ||
|
|
||
|
|
||
| SessionCreateParams = Union[SessionCreateParamsNonStreaming, SessionCreateParamsStreaming] |
|
|
||
| timeout: Override the client-level default timeout for this request, in seconds | ||
| """ | ||
| ... |
|
|
||
| timeout: Override the client-level default timeout for this request, in seconds | ||
| """ | ||
| ... |
|
|
||
| timeout: Override the client-level default timeout for this request, in seconds | ||
| """ | ||
| ... |
|
|
||
| timeout: Override the client-level default timeout for this request, in seconds | ||
| """ | ||
| ... |
|
|
||
| timeout: Override the client-level default timeout for this request, in seconds | ||
| """ | ||
| ... |
|
|
||
| timeout: Override the client-level default timeout for this request, in seconds | ||
| """ | ||
| ... |
|
|
||
| timeout: Override the client-level default timeout for this request, in seconds | ||
| """ | ||
| ... |
|
|
||
| timeout: Override the client-level default timeout for this request, in seconds | ||
| """ | ||
| ... |
|
|
||
| timeout: Override the client-level default timeout for this request, in seconds | ||
| """ | ||
| ... |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5370ba5ea
ℹ️ 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".
| if len(self.recent_events) == _RECENT_EVENT_LIMIT: | ||
| self.event_ids.remove(self.recent_events.popleft()) |
There was a problem hiding this comment.
Retain event IDs for the whole turn
When a long turn emits more than 1,024 distinct events and the server later redelivers an earlier event, this eviction removes the original ID, so accept() yields that event a second time. For an agent.session.turn.output_text.delta consumer that concatenates deltas, this silently duplicates output; deduplication should not expire based on an arbitrary event count during a single turn.
AGENTS.md reference: AGENTS.md:L112-L120
Useful? React with 👍 / 👎.
| if has_more is not None and has_more is False: | ||
| return False | ||
|
|
||
| return super().has_next_page() |
There was a problem hiding this comment.
Follow opaque cursors after empty pages
When the environment-files API returns a valid empty page with has_more=true and a nonempty next token, delegating to BasePage.has_next_page() returns False solely because data is empty, so automatic iteration silently stops without requesting the indicated next page. Since this pagination scheme has an independent opaque cursor rather than deriving it from the last item, both the synchronous and asynchronous token-page implementations should decide continuation from has_more and next even when the current page contains no files.
Useful? React with 👍 / 👎.
Add the
beta.agentsAPI.OpenAI-Beta: agents=v1header.beta.agents.sessions.stream(...): Stream one turn on an idle session; supports sync and async clients.AgentSessionMessage.output_text: Join a message’s output-text blocks into one string.