codex/sdk/python/tests
Ahmed Ibrahim ddea03ad04 Start Python SDK turn subscriptions at their attachment point (#44400)
## What changed

Make turn event delivery depend on when each consumer attaches:

- Handles returned by `thread.turn(...)` receive events from when the request is sent, including events received before the response arrives.
- Other handles and explicit low-level registrations receive only events from when they join. Remove replay of completed items, token usage, and terminal events; use `thread.read(include_turns=True)` for earlier history.
- Retain unread events for active subscribers and pending starts, release unused turn state, and close the returned subscription when an async start is cancelled.

Preserve the existing low-level subscription when repeated `turn_start(...)` calls return the same turn.

## Testing

Update coverage for late joins, request-time buffering, completion or transport failure before a start returns, async cancellation cleanup, and repeated low-level starts. Adjust external-message integration tests to allow handles to collect different items while receiving the same final response.

GitOrigin-RevId: 3b7f1268df1193dee88385006ae9510101086c24
History 2026-09-10 03:40:55 +00:00
..
app_server_harness.py Test Python SDK against the built CLI and installed runtime (#44053) 2026-09-09 04:40:22 +00:00
app_server_helpers.py Remove the unused legacy remote compaction implementation (#44273) 2026-09-09 18:40:53 +00:00
conftest.py [5/8] Rename Python SDK package to openai-codex (#21905) 2026-05-12 00:59:25 +03:00
installed_sdk_smoke.py Expose Python SDK history selection and per-turn options (#44084) 2026-09-09 06:40:56 +00:00
test_app_server_approvals.py [8/8] Add Python SDK Ruff formatting (#22021) 2026-05-12 01:10:29 +03:00
test_app_server_goal_operations.py [2/4] Add private Python goal operations (#27111) 2026-06-09 15:32:15 -07:00
test_app_server_inputs.py Start Python SDK turn subscriptions at their attachment point (#44400) 2026-09-10 03:40:55 +00:00
test_app_server_lifecycle.py [codex] Return TurnResult from Python turn handles (#23151) 2026-05-17 06:17:22 -07:00
test_app_server_login.py [codex] Rename Python SDK AppServerConfig to CodexConfig (#24800) 2026-05-27 16:10:15 -07:00
test_app_server_run.py Expose Python SDK history selection and per-turn options (#44084) 2026-09-09 06:40:56 +00:00
test_app_server_streaming.py [codex] Rename Python SDK AppServerConfig to CodexConfig (#24800) 2026-05-27 16:10:15 -07:00
test_app_server_turn_controls.py [codex] Accept string input for Python turns (#23162) 2026-05-17 09:05:44 -07:00
test_artifact_workflow_and_binaries.py Expose Python SDK history selection and per-turn options (#44084) 2026-09-09 06:40:56 +00:00
test_async_client_behavior.py [codex] Rename Python SDK AppServerConfig to CodexConfig (#24800) 2026-05-27 16:10:15 -07:00
test_client_rpc_methods.py Start Python SDK turn subscriptions at their attachment point (#44400) 2026-09-10 03:40:55 +00:00
test_contract_generation.py Generate Python SDK types from repository app-server schemas (#44032) 2026-09-09 03:27:31 +00:00
test_mcp_conformance_fixtures.py Add MCP client conformance regression gates (#36810) 2026-08-03 23:20:41 +00:00
test_public_api_runtime_behavior.py Start Python SDK turn subscriptions at their attachment point (#44400) 2026-09-10 03:40:55 +00:00
test_public_api_signatures.py Add untrusted external messages to the Python SDK (#44086) 2026-09-09 06:54:18 +00:00
test_real_app_server_integration.py [codex] Accept string input for Python turns (#23162) 2026-05-17 09:05:44 -07:00
test_turn_subscriptions.py Start Python SDK turn subscriptions at their attachment point (#44400) 2026-09-10 03:40:55 +00:00