MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / subagentRunContext

Method subagentRunContext

agent/subagent.go:329–338  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

327
328func (s *SubAgent) subagentRunContext(ctx context.Context) (context.Context, context.CancelFunc) {
329 if ctx == nil {
330 ctx = context.Background()
331 }
332 softDeadline := time.Now().Add(time.Duration(s.timeoutSeconds()) * time.Second)
333 if parentDeadline, ok := ctx.Deadline(); ok && parentDeadline.Before(softDeadline) {
334 return context.WithDeadline(ctx, parentDeadline)
335 }
336 return context.WithDeadline(ctx, softDeadline)
337}
338
339func (s *SubAgent) timeoutSeconds() int {
340 if s.TimeoutSeconds > 0 {
341 return s.TimeoutSeconds

Callers 1

RunMethod · 0.95

Calls 2

timeoutSecondsMethod · 0.95
AddMethod · 0.80

Tested by

no test coverage detected