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 <noreply@anthropic.com>
This commit is contained in:
parent
51922b78fc
commit
aa890502cd
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Reference in New Issue