Skip to content

v1.41.0

Choose a tag to compare

@myzie myzie released this 22 Oct 15:34
· 15 commits to main since this release
7bb36bf

Highlights

A Stop hook can now continue a turn with input that did not come from the
user. Before this release, every continuation added a stop-continuation
reminder that tells the model "the following input arrived from the user".
That is wrong when the hook delivers something else, such as the result of a
background subagent that finished after the model ended its response.

To continue with your own content, append a Recorded reminder with
hctx.AppendReminder and return StopDecision{Continue: true} with an empty
Reason. That reminder is the only new input to the next model call, and the
turn saves it once. A ModelOnly reminder is not enough on its own, because
it is not saved and the saved turn would hold two answers with no input
between them. Continuing with no reason and no Recorded reminder fails the
turn with ErrStopContinueWithoutInput.

Existing Stop hooks always set Reason, so they need no changes.

Pull requests

  • feat(hooks): let a Stop hook continue with its own reminder (#343)

Changelog

Added

  • Stop hooks can continue without a reason. With an empty Reason, the
    hook's Recorded reminders are the only new input and no stop-continuation
    message is added; with none, the turn fails with ErrStopContinueWithoutInput.