Summary
Custom lint scan found 2 targeted correctness findings in pkg/cli/mcp_tools_privileged.go:
- 1x
context.Background() usage where the existing context.Context parameter should be propagated
- 1x goroutine launched without a top-level
defer/recover panic containment block
These should be remediated together because they affect the same privileged MCP CLI codepath and likely the same helper flow.
Findings
pkg/cli/mcp_tools_privileged.go:255 — use the function's context.Context parameter instead of context.Background()
pkg/cli/mcp_tools_privileged.go:259 — wrap the goroutine body with a top-level defer func() { if r := recover(); r != nil { ... } }()
Expected outcome
- Preserve cancellation/timeout behavior by threading the existing context through the subprocess/logging path.
- Ensure any panic inside the launched goroutine is contained and reported instead of crashing the process.
- Keep edits minimal and scoped to this file / helper path only.
Remediation checklist
Generated by 🧌 LintMonster · gpt54 · 35.3 AIC · ⌖ 7.93 AIC · ⊞ 5.3K · ◷
Summary
Custom lint scan found 2 targeted correctness findings in
pkg/cli/mcp_tools_privileged.go:context.Background()usage where the existingcontext.Contextparameter should be propagateddefer/recoverpanic containment blockThese should be remediated together because they affect the same privileged MCP CLI codepath and likely the same helper flow.
Findings
pkg/cli/mcp_tools_privileged.go:255— use the function'scontext.Contextparameter instead ofcontext.Background()pkg/cli/mcp_tools_privileged.go:259— wrap the goroutine body with a top-leveldefer func() { if r := recover(); r != nil { ... } }()Expected outcome
Remediation checklist
context.Background()with the already-availablecontext.Contextparameter.make golint-custom.