Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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 did not change repository code.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove nightly bookkeeping files from the repo

This commit adds run-specific bookkeeping artifacts (.codex-nightly-retry-1.md, NIGHTLY_CODEX_FINAL_ATTEMPT_1.md, and NIGHTLY_CODEX_FINAL_ATTEMPT_2.md) that are not part of the SDK or user-facing docs and contain ephemeral CI details (including absolute runner paths and point-in-time issue status). Keeping these tracked will create ongoing maintenance noise and confuse contributors about project documentation, so they should be excluded from the change.

Useful? React with 👍 / 👎.


I stopped because the issue already has two active upstream PRs covering the maintainable SDK-side fixes: `#3013` for helper/validation behavior and `#3016` for documentation. A new code/doc PR from this checkout would likely duplicate ongoing review work.

Tests were not run because no code changed. Current untracked files are `.codex-nightly-prompt.md`, `uv.lock`, and `NIGHTLY_REPORT.md`; I only added the report.
11 changes: 11 additions & 0 deletions NIGHTLY_CODEX_FINAL_ATTEMPT_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Implemented a small, defensible docs/example patch for `openai-python#3009`.

Changed:
- [README.md](/home/runner/work/oss-nightly-control/oss-nightly-control/target/README.md:47): added a `Conversation state` section showing `previous_response_id` and warning not to filter manual histories down to only messages.
- [examples/responses/conversation_state.py](/home/runner/work/oss-nightly-control/oss-nightly-control/target/examples/responses/conversation_state.py:1): added a minimal two-turn Responses example.
- [NIGHTLY_REPORT.md](/home/runner/work/oss-nightly-control/oss-nightly-control/target/NIGHTLY_REPORT.md:1): updated with rationale, tests, and risks.

Verified:
- `python -m py_compile examples/responses/conversation_state.py`

I also checked the current upstream context: issue [#3009](https://github.com/openai/openai-python/issues/3009) is still open, with active related PRs [#3013](https://github.com/openai/openai-python/pull/3013) and [#3016](https://github.com/openai/openai-python/pull/3016), so this patch avoids duplicating their helper/docstring surfaces.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,35 @@ response = client.responses.create(
print(response.output_text)
```

### Conversation state

For multi-turn conversations with the Responses API, use `previous_response_id`
to have the API retain context between turns.

```python
from openai import OpenAI

client = OpenAI()

response = client.responses.create(
model="gpt-5.2",
input="Write a haiku about recursion in programming.",
)
print(response.output_text)

response = client.responses.create(
model="gpt-5.2",
input="Now explain it in plain English.",
previous_response_id=response.id,
)
print(response.output_text)
```

If you manually manage conversation history instead, preserve all items from
`response.output` in their original order. Reasoning models may return reasoning
items together with assistant messages, and filtering those items down to only
messages can break subsequent requests.

The previous standard (supported indefinitely) for generating text is the [Chat Completions API](https://platform.openai.com/docs/api-reference/chat). You can use that API to generate text from the model with the code below.

```python
Expand Down
22 changes: 22 additions & 0 deletions examples/responses/conversation_state.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from openai import OpenAI


client = OpenAI()

response = client.responses.create(
model="gpt-5.2",
input="Write a haiku about recursion in programming.",
)
print(response.output_text)

response = client.responses.create(
model="gpt-5.2",
input="Now explain it in plain English.",
previous_response_id=response.id,
)
print(response.output_text)

# If you manually manage conversation history instead of using
# previous_response_id, append response.output items in order. Reasoning models
# may return reasoning items together with assistant messages, and filtering
# those items down to only messages can break the next request.