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
Click to show internal directories.
Click to hide internal directories.