From aa890502cde9af3d737b02869957df42f3ed2b93 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sat, 25 Apr 2026 23:53:00 +0200 Subject: [PATCH] agent: inject postTurn context into session history Non-blocked postTurn hook output is now appended to session history so the model sees it at the start of the next turn without triggering autonomous continuation. Co-Authored-By: Claude Sonnet 4.6 --- pkg/agent/core.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/agent/core.go b/pkg/agent/core.go index 8d822be..66bc8e5 100644 --- a/pkg/agent/core.go +++ b/pkg/agent/core.go @@ -825,6 +825,9 @@ func (s *agent) executeTurn(ctx context.Context, input string, handler EventHand if stopResult.Warning != "" { handler(infoEvent(stopResult.Warning)) } + if !stopResult.Blocked && stopResult.Context != "" && s.session != nil { + s.session.appendUserMessage(stopResult.Context) + } s.saveSession()