Skip to content

Commit b07221f

Browse files
authored
Copilot engine applies request timeout (#130)
1 parent e1179b8 commit b07221f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/execution/copilot.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ func (e *CopilotEngine) Execute(ctx context.Context, req *ExecutionRequest) (*Ex
133133
}
134134
}
135135

136+
if _, hasDeadline := ctx.Deadline(); !hasDeadline {
137+
var cancel context.CancelFunc
138+
ctx, cancel = context.WithTimeout(ctx, req.Timeout)
139+
defer cancel()
140+
}
141+
136142
var session CopilotSession
137143

138144
permRequestCallback := allowAllTools

0 commit comments

Comments
 (0)