Closed
Conversation
Greptile OverviewGreptile SummaryExtracted hardcoded timeout constants from multiple modules into a centralized Key Changes:
The refactoring is clean, maintains backward compatibility through re-exports, and includes test coverage to validate timeout value relationships. Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| src/cortex-common/src/timeout.rs | New module with well-documented timeout constants and validation tests |
| src/cortex-exec/src/runner.rs | Replaced local timeout constants with centralized imports from cortex-common |
| src/cortex-engine/src/tools/handlers/batch.rs | Removed local constant and imported from cortex-common |
Sequence Diagram
sequenceDiagram
participant Common as cortex-common/timeout
participant Runner as cortex-exec/runner
participant Batch as cortex-engine/batch
participant ModExport as cortex-engine/handlers/mod
Note over Common: Defines centralized timeout constants
Common->>Common: DEFAULT_EXEC_TIMEOUT_SECS = 600
Common->>Common: DEFAULT_REQUEST_TIMEOUT_SECS = 120
Common->>Common: DEFAULT_BATCH_TIMEOUT_SECS = 300
Note over Runner: Uses exec & request timeouts
Runner->>Common: Import DEFAULT_EXEC_TIMEOUT_SECS
Runner->>Common: Import DEFAULT_REQUEST_TIMEOUT_SECS
Runner->>Runner: Set ExecOptions defaults
Runner->>Runner: Apply timeout in run()
Note over Batch: Uses batch timeout
Batch->>Common: Import DEFAULT_BATCH_TIMEOUT_SECS
Batch->>Batch: Apply timeout for parallel tool execution
Note over ModExport: Re-exports for public API
ModExport->>Common: Re-export DEFAULT_BATCH_TIMEOUT_SECS
ModExport->>ModExport: Expose to external consumers
echobt
added a commit
that referenced
this pull request
Feb 4, 2026
…it, and documentation This PR consolidates the following refactoring changes: - #27: Centralize timeout constants - #43: Replace magic numbers with documented named constants - #67: Use LazyLock for static regex initialization - #68: Extract subagent timeout values as named constants Key changes: - Created centralized timeout module with documented constants - Replaced scattered magic numbers with well-documented constants - Improved static initialization using LazyLock for regexes - Added comprehensive documentation for timeout hierarchy
Contributor
Author
|
Consolidated into #77 - refactor: consolidated code quality improvements - constants, lazy init, and documentation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extracts hardcoded timeout values scattered across multiple modules into a centralized TimeoutConfig module in cortex-common. This improves maintainability and consistency across the codebase.
Changes
src/cortex-common/src/timeout.rswith documented timeout constantscortex-exec/src/runner.rsto use centralized constantscortex-engine/src/tools/handlers/batch.rsto use centralized constantscortex-commonVerification