[PF-24] Configurable stream timeout and config merge from template JSON - #42
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Purpose
Make plan/implement streaming timeout configurable via
planforge.json(with effort-based defaults) and unify config merge so that runtime defaults come only from template JSON (default-*.json) based on installed providers, instead of hardcoded constants.Description
1. Stream timeout (plan/implement)
planner.streamTimeoutSecandimplementer.streamTimeoutSecinplanforge.json.0= no timeout.timeout.ts/config.py), passstreamTimeoutMsin PlanOpts/ImplementOpts to Claude and Codex providers. Providers apply timeout only when > 0; otherwise no timeout (nosetTimeout/proc.wait()without timeout).packages/cli-js/src/config/types.ts— addedstreamTimeoutSec?to planner/implementer.packages/cli-js/src/config/timeout.ts— new;resolvePlannerStreamTimeoutSec,resolveImplementerStreamTimeoutSec(replaces formerresolve-timeout.ts).packages/cli-js/src/providers/registry.ts—PlanOpts.streamTimeoutMs?,ImplementOpts.streamTimeoutMs?.packages/cli-js/src/commands/plan.ts,implement.ts— resolve timeout, passstreamTimeoutMsto runner.packages/cli-js/src/providers/claude.ts,codex.ts— acceptstreamTimeoutMs; 0/undefined = no timeout.packages/cli-py:planforge/utils/config.py(resolve helpers),commands/plan.py,commands/implement.py,providers/claude.py,providers/codex.py— same behavior; Codex implement path switched to_run_codex_exec_streamingwith timeout.2. Config merge from template JSON
load_config/loadConfigmerged planforge.json with hardcoded_MERGE_DEFAULTS/MERGE_DEFAULTS(provider, model).getDefaultConfig(checkClaude(), checkCodex())(default-both.json, default-claude-only.json, or default-codex-only.json). Planforge.json overrides on top.packages/cli-js/src/config/load.ts— removedMERGE_DEFAULTS;loadConfig()uses template as merge base.packages/cli-py/planforge/utils/config.py— removed_MERGE_DEFAULTS;load_config()uses template (lazy import of check_claude/check_codex).3. Rename
resolve-timeout.ts→timeout.ts; plan/implement imports updated to../config/timeout.js.How to test
planner.streamTimeoutSec: 0in planforge.json and runplanforge plan "short goal"— should not time out at 120s. Setplanner.streamTimeoutSec: 30and run a long plan — should fail with "timed out after 30s".providerfromplannerin planforge.json and runplanforge plan "goal"— should still use planner from default-both.json.cd packages/cli-js && npm run build— succeeds.Review Requirement
streamTimeoutMs/streamTimeoutSecthe same way; 0/None = no timeout.checkClaude()/checkCodex().load_config()lazy-imports provider checks; confirm plan/implement/doctor still load config correctly.Additional Info
docs/planforge-stream-timeout-and-config-notion.md