Documentation
¶
Overview ¶
Demonstrates WithMaxTurns: a client-side cap on the number of assistant messages observed per session. opencode has no protocol-level turn limit, so the SDK counts distinct assistant message ids and calls Session.Cancel once the cap is crossed — useful as a backstop against runaway agent loops.
go run ./examples/max_turns
Click to show internal directories.
Click to hide internal directories.