fix(workflow-executor): single source of truth for CLI defaults#1596
Merged
nbouliol merged 1 commit intoMay 26, 2026
Merged
Conversation
fixes PRD-394 Move all CLI-visible defaults to src/defaults.ts. cli-core.ts now imports constants instead of hardcoding values in readEnvConfig, printHelp, and logStartup. logStartup also resolves defaults so logged values match actual runtime behavior. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (4)
🛟 Help
|
Scra3
approved these changes
May 26, 2026
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
src/defaults.tsexporting all 6 CLI-visible defaults (DEFAULT_HTTP_PORT,DEFAULT_FOREST_SERVER_URL,DEFAULT_POLLING_INTERVAL_MS,DEFAULT_STEP_TIMEOUT_MS,DEFAULT_STOP_TIMEOUT_MS,DEFAULT_MAX_CHAIN_DEPTH).build-workflow-executor.ts,runner.ts, andcli-core.tsnow import fromdefaults.tsinstead of duplicating constants.logStartupnow resolvesforestServerUrl/pollingIntervalMsagainst the defaults so logged values match runtime behavior (previously loggedundefinedwhen env vars were unset).fixes PRD-394
Test plan
yarn workspace @forestadmin/workflow-executor test(774 passing)yarn workspace @forestadmin/workflow-executor lint(no new warnings)yarn workspace @forestadmin/workflow-executor buildprintHelpoutput contains every default valuelogStartuplogs resolved defaults when env-derived options are undefined🤖 Generated with Claude Code
Note
Centralize CLI default constants in workflow-executor into a single
defaultsmoduleDEFAULT_HTTP_PORT,DEFAULT_FOREST_SERVER_URL,DEFAULT_POLLING_INTERVAL_MS,DEFAULT_STEP_TIMEOUT_MS,DEFAULT_STOP_TIMEOUT_MS, andDEFAULT_MAX_CHAIN_DEPTH../defaultsinstead of defining constants locally.logStartupnow logs the defaultpollingIntervalMsvalue when none is provided, closing a gap in startup output.DEFAULT_POLLING_INTERVAL_MSis no longer exported frombuild-workflow-executor; consumers must import it from./defaults.Macroscope summarized 729eacb.