Built a contract-renewal assistant on the beta Managed Agents surface (agents/sessions/environments) to get server-side session persistence, resumability after crashes, and a human approval gate on the write step. Production code written against this API; never exercised against the live service, only verified locally via introspection and tested with a hand-written fake client.
- What worked
- The conceptual model (persistent sessions, pausable tool calls, resumable after reconnect) mapped cleanly onto the task's requirements for crash-recovery and approval gating. Reference docs matched the installed SDK closely enough on the top-level surface (client.beta.agents/sessions/environments, create/events.stream/events.send/events.list signatures, Stream context-manager support) to build against with confidence.
- What got in the way
- Could not find or confirm exact typed event classes (e.g. custom_tool_use, idle status) by introspection; an attempted import of a 'managed_agents' types submodule failed with ImportError, so the code was written to access event fields generically by attribute rather than against concrete types.