Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a82a3f8
[skip ci] apcha/agents-reattach-handlers
apcha-oai Oct 1, 2026
81fc2cc
feat(agents): reattach handlers to hosted session work
apcha-oai Oct 1, 2026
3646d2c
fix(agents): bound attachment to the identified turn
apcha-oai Oct 1, 2026
f8728a3
fix(agents): reconcile interrupted attachment observation
apcha-oai Oct 1, 2026
014e12a
fix(agents): preserve attachment errors and complete output recovery
apcha-oai Oct 1, 2026
f76e1c4
fix(agents): defer manual diagnostics until result collection
apcha-oai Oct 1, 2026
14b3b86
fix(agents): validate recovered candidates against the current root
apcha-oai Oct 1, 2026
140e658
fix(agents): retain partial pages and seed early collection
apcha-oai Oct 1, 2026
c5cfb57
fix(agents): refresh state before settling buffered idle events
apcha-oai Oct 1, 2026
a70d54a
fix(agents): report environment actions before the first turn
apcha-oai Oct 1, 2026
e423ec3
fix(agents): inspect manual actions after root discovery
apcha-oai Oct 1, 2026
1e971e1
fix(agents): retain partial output across diagnostic failures
apcha-oai Oct 1, 2026
23e7a20
fix(agents): retain terminal evidence and retry turn discovery
apcha-oai Oct 1, 2026
25443e5
docs(agents): clarify at-least-once tool-call delivery
apcha-oai Oct 1, 2026
5ae4d5f
docs(agents): explain application-owned recovery
apcha-oai Oct 1, 2026
25a26b5
fix(agents): refresh selected turns at attachment boundaries
apcha-oai Oct 1, 2026
6580c0d
fix(agents): preserve observed output and diagnostic arguments
apcha-oai Oct 1, 2026
dfc1fed
fix(agents): retain distinct unhandled stream actions
apcha-oai Oct 1, 2026
1b3f9c8
fix(agents): retain observed error output and select diagnostic roots
apcha-oai Oct 1, 2026
4a16613
fix(agents): close cancelled attachment streams reliably
apcha-oai Oct 1, 2026
f16973a
fix(agents): preserve stream cleanup during cancellation
apcha-oai Oct 1, 2026
c1212a2
fix(agents): preserve attachment output and stop at successor turns
apcha-oai Oct 1, 2026
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
21 changes: 21 additions & 0 deletions helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -633,3 +633,24 @@ This only selects the local parser; it does not change the session's schema.
`result.parse(Report)` parses an existing raw result. `AgentOutputParseError.result`
retains the completed raw answer if validation fails. With `AsyncOpenAI`, await
creation and the result getter, and use `async with`.

### Reattach tool handlers

Omit `input` to reconnect to an existing session without submitting another prompt.

```python
with client.beta.agents.sessions.stream(
saved_session_id, tool_handlers={"lookup_order": lookup_order},
) as stream:
result = stream.get_final_result()
print(result.output_text)
```

Pending function calls use the same handlers as a new turn. Result collection
recovers the selected turn's completed output, including messages missed while
disconnected. An already-idle session with no selected turn drains successfully
with `until_done()` but has no final result. Reattachment uses at-least-once
tool-call delivery with application-owned recovery: after process death, restart
the worker, recover its saved session ID, and reattach handlers. An unacknowledged
call may be delivered again; applications own idempotency for handler mutations.
With `AsyncOpenAI`, use `async with` and await the getter.
Loading
Loading