feat(executor): allow MXCLI_EXEC_TIMEOUT to override the per-statement timeout#315
Open
hjotha wants to merge 1 commit intomendixlabs:mainfrom
Open
feat(executor): allow MXCLI_EXEC_TIMEOUT to override the per-statement timeout#315hjotha wants to merge 1 commit intomendixlabs:mainfrom
hjotha wants to merge 1 commit intomendixlabs:mainfrom
Conversation
…t timeout Long-running audit runs against large projects (1k+ microflows) can hit the hard-coded 5-minute per-statement ceiling on commands like `describe project`, `describe module`, or bulk `show callers`. Currently the only options are to skip those commands or to fork mxcli. Add an MXCLI_EXEC_TIMEOUT env var that overrides the default. Accepts: - Go duration strings: "12m", "2h30m", "45s". - Bare seconds: "900" → 15 minutes. When unset, empty, or unparseable, falls back to the existing 5-minute default. Read on every Execute() call so an operator can adjust mid-run without restarting. Refactor: - Replace the `executeTimeout = 5 * time.Minute` const with `defaultExecuteTimeout` and a `configuredExecuteTimeout()` helper. - `Execute()` reads the timeout via the helper instead of the const. - Update the existing comment on `Execute()` to reference "the configured timeout" rather than the const name. Tests: - `TestConfiguredExecuteTimeoutUsesDurationEnv` — "12m" → 12*time.Minute. - `TestConfiguredExecuteTimeoutUsesSecondEnv` — "900" → 15*time.Minute. - `TestConfiguredExecuteTimeoutFallsBackForInvalidEnv` — "invalid" → defaultExecuteTimeout. Tests use `t.Setenv` so they cannot leak across runs and are parallel-safe with the rest of the executor test suite.
AI Code ReviewCritical IssuesNone Moderate IssuesNone Minor IssuesNone What Looks Good
RecommendationApprove. The PR is minimal, well-tested, and addresses the stated need without violating any project conventions. Since it doesn't introduce MDL syntax, the full-stack consistency and syntax design checklist items are not applicable and are correctly not flagged as issues. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
29 tasks
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.
Part of #332.
Closes #314.
Summary
Adds
MXCLI_EXEC_TIMEOUTso long-running executor operations can use a larger per-statement timeout without rebuilding mxcli.Configuration
Accepted values:
12m,2h30m, or45s.900.Unset, empty, or invalid values fall back to the existing default.
Root cause
The executor used a hard-coded timeout constant, which is too rigid for large-project audit and describe workflows.
Fix
Replace direct use of the constant with a
configuredExecuteTimeout()helper read on eachExecute()call.Tests
Added helper tests for Go duration values, bare-second values, and invalid-value fallback.
Validation
make buildmake testmake lint-gomake test-integrationAgentic Code Testing
Test plan