Skip to main content

15. Hands-on runs: verify mechanisms first, then connect a real model

All companion files live in this tutorial’s sibling demos/ directory. Local teaching demos only use the Python standard library and Node’s built-in modules. Python 3.11+ is required; this run actually used 3.14.7.

15.1 What this session actually verified

The App Server probe exited early inside a restricted sandbox on the first try. After being allowed to retry outside the sandbox, it initialized successfully. The probe process has ended and did not leave a background agent task behind.

15.2 Real App Server probe

It does not send thread/start or turn/start. If you want to write your own client, generate the current protocol version first:
Schema files only capture interface constraints. You still have to wire approvals, errors, notifications, and lifecycle end to end.

15.3 Real model API examples

Configure OPENAI_API_KEY in a private local environment variable. Do not put it in a tutorial or Git. This article does not read or use your API key. Once you have confirmed model and account support, you can run:
The WebSocket steering example needs ws:
The API examples pin the Astra model ID gpt-6-astra from the screenshots, without silently downgrading to another model. Run each mode separately to avoid violating combination constraints such as async/PTC or steering/auto compaction. The online examples were not actually run this session. Quota, network, and API evolution can affect execution. If an unsupported field appears, check the official docs and model permissions first, and do not guess field names.

15.4 Gap between the demos and a production system

The local runtime’s job table is in memory. The event log can be persisted, but there is no implementation for crash recovery of running tasks or cross-process idempotency. Event persistence and task dispatch are also not a single atomic transaction. A production design can add an outbox, a durable job ledger, leases, and execution-state reconciliation on recovery. Cancellation only works on the demo’s asyncio coroutines. Python functions running in a ThreadPool and real OS child processes need their own termination design. The API examples show the call protocol only. They do not cover full streaming reconnection, token budget management, distributed retry, or production observability.

15.5 A learning path suitable for interview prep