cancellation

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 cancelling an in-flight opencode turn via [Session.Cancel]. The SDK sends session/cancel to opencode, which stops the running turn promptly; the pending Prompt call then returns an error that wraps opencodesdk.ErrCancelled.

See also [Client.CancelAll] for fanning cancel notifications across every live session on a Client — useful for coordinated shutdown when the caller no longer tracks individual Session handles.

go run ./examples/cancellation

Jump to

Keyboard shortcuts

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