max_turns

command
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL