Skip to content

Commit 5132fc2

Browse files
committed
Use the context
Don't use context.Background(), the client should be able to cancel the request Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
1 parent 989f18c commit 5132fc2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pkg/acp/agent.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func (a *Agent) Cancel(_ context.Context, params acp.CancelNotification) error {
138138
}
139139

140140
// Prompt implements [acp.Agent]
141-
func (a *Agent) Prompt(_ context.Context, params acp.PromptRequest) (acp.PromptResponse, error) {
141+
func (a *Agent) Prompt(ctx context.Context, params acp.PromptRequest) (acp.PromptResponse, error) {
142142
sid := string(params.SessionId)
143143
slog.Debug("ACP Prompt called", "session_id", sid)
144144

@@ -161,7 +161,7 @@ func (a *Agent) Prompt(_ context.Context, params acp.PromptRequest) (acp.PromptR
161161
}
162162

163163
// Create a new context for this turn
164-
turnCtx, cancel := context.WithCancel(context.Background())
164+
turnCtx, cancel := context.WithCancel(ctx)
165165
a.mu.Lock()
166166
acpSess.cancel = cancel
167167
a.mu.Unlock()

0 commit comments

Comments
 (0)