From 7832f86c5805e95f6059bbea505c0f9e6bdf816b Mon Sep 17 00:00:00 2001 From: Amolith Date: Sat, 3 Jan 2026 18:17:56 -0700 Subject: [PATCH] fix(acp): use background context for sink lifetime The request context passed to NewSession may be short-lived. The sink needs to outlive the request to stream updates for the session. Assisted-by: Claude Opus 4.5 via Crush --- internal/acp/agent.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/acp/agent.go b/internal/acp/agent.go index f47d5c3776e786b0ceb915f0197f34a756d5fc50..809a574e45788ca5fd38fdcd48570379f0195c69 100644 --- a/internal/acp/agent.go +++ b/internal/acp/agent.go @@ -71,7 +71,9 @@ func (a *Agent) NewSession(ctx context.Context, params acp.NewSessionRequest) (a } // Create and start the event sink to stream updates to this session. - sink := NewSink(ctx, a.conn, sess.ID) + // Use a background context since the sink needs to outlive the NewSession + // request. + sink := NewSink(context.Background(), a.conn, sess.ID) sink.Start(a.app.Messages, a.app.Permissions) a.sinks.Set(sess.ID, sink)