Skip to content

Commit 156560f

Browse files
committed
fix lint issues
Signed-off-by: Grant Linville <[email protected]>
1 parent d3eb4c3 commit 156560f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pkg/builtin/builtin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ func SysDownload(ctx context.Context, env []string, input string) (_ string, err
648648
}
649649

650650
func SysPrompt(ctx context.Context, _ []string, input string) (_ string, err error) {
651-
monitor := ctx.Value("monitor")
651+
monitor := ctx.Value(runner.MonitorKey{})
652652
if monitor == nil {
653653
return "", errors.New("no monitor in context")
654654
}

pkg/runner/runner.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ type Monitor interface {
2626
Stop(output string, err error)
2727
}
2828

29+
type MonitorKey struct{}
30+
2931
type Options struct {
3032
MonitorFactory MonitorFactory `usage:"-"`
3133
RuntimeManager engine.RuntimeManager `usage:"-"`
@@ -150,7 +152,7 @@ func (r *Runner) call(callCtx engine.Context, monitor Monitor, env []string, inp
150152

151153
// The sys.prompt tool is a special case where we need to pass the monitor to the builtin function.
152154
if callCtx.Tool.BuiltinFunc != nil && callCtx.Tool.ID == "sys.prompt" {
153-
callCtx.Ctx = context.WithValue(callCtx.Ctx, "monitor", monitor)
155+
callCtx.Ctx = context.WithValue(callCtx.Ctx, MonitorKey{}, monitor)
154156
}
155157

156158
result, err := e.Start(callCtx, input)

0 commit comments

Comments
 (0)