-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Closed
Copy link
Labels
automationcode-qualitycookieIssue Monster Loves Cookies!Issue Monster Loves Cookies!refactoringtask-miningtechnical-debt
Description
Description
The codebase contains deprecated integer timeout constants that should be migrated to time.Duration types for better type safety and consistency.
Current State
Deprecated constants in pkg/constants/constants.go:
DefaultAgenticWorkflowTimeoutMinutes(int)DefaultToolTimeoutSeconds(int)DefaultMCPStartupTimeoutSeconds(int)
Modern replacements already exist:
DefaultAgenticWorkflowTimeout(time.Duration)DefaultToolTimeout(time.Duration)DefaultMCPStartupTimeout(time.Duration)
Affected Files
Still using deprecated constants:
pkg/workflow/tools.go:145pkg/workflow/copilot_engine_execution.go:503pkg/workflow/claude_engine.go:423-424,429-430,519pkg/workflow/compiler_timeout_default_test.go(multiple lines)pkg/workflow/mcp_renderer.go:367-368,374-375
Suggested Changes
-
Update call sites to use
time.Durationconstants:// Before: timeout := constants.DefaultAgenticWorkflowTimeoutMinutes // After: timeout := int(constants.DefaultAgenticWorkflowTimeout / time.Minute)
-
Remove deprecated constants from
pkg/constants/constants.go(lines 407-419) -
Update tests in
pkg/constants/constants_test.goto remove deprecated constant tests
Success Criteria
- ✅ All 6+ call sites migrated to use
time.Durationconstants - ✅ Deprecated constants removed from
pkg/constants/constants.go - ✅ All tests pass (
make test-unit) - ✅ Code formatted and linted (
make fmt && make lint)
Benefits
- Type safety: Using
time.Durationprovides compile-time type checking - Consistency: Aligns with modern Go best practices
- Maintainability: Reduces technical debt
- Clarity: Makes duration units explicit (no confusion about seconds vs minutes)
Source
Extracted from codebase analysis - TODO comment at pkg/constants/constants.go:407
Priority
Medium - Technical debt cleanup that improves code quality
AI generated by Discussion Task Miner - Code Quality Improvement Agent
- expires on Feb 10, 2026, 5:12 AM UTC
Copilot
Metadata
Metadata
Labels
automationcode-qualitycookieIssue Monster Loves Cookies!Issue Monster Loves Cookies!refactoringtask-miningtechnical-debt