Skip to content

[PF-22] Add planforge model command for interactive mode/provider/model/effort-or-reasoning selection - #24

Merged
chucoding merged 2 commits into
developfrom
feature/PF-22
Mar 13, 2026
Merged

[PF-22] Add planforge model command for interactive mode/provider/model/effort-or-reasoning selection#24
chucoding merged 2 commits into
developfrom
feature/PF-22

Conversation

@chucoding

Copy link
Copy Markdown
Owner

Purpose

Add a planforge model subcommand that interactively selects mode (planner/implementer), provider, model, and effort (Claude) or reasoning (Codex), then updates planforge.json. Model and option lists are loaded from packages/core/models.json.

Description

  • New command: planforge model — TUI flow: Mode → Provider (skipped when only one) → Model → Effort (Claude) or Reasoning (Codex). All steps use Up/Down + Enter; no left/right keys.
  • Data: packages/core/models.json defines modes, modeProviders, and per-provider models, effort, reasoning. Shipped via core package (Node files, Python wheel force-include).
  • Paths: Node getModelsJsonPath() (cli-js), Python get_models_json_path() (cli-py). Fallback to packages/core/models.json when the package path is missing (e.g. monorepo dev).
  • Config write: For Claude only effort is written (no reasoning); for Codex only reasoning (no effort). Role block is replaced entirely so the other field is removed.
  • Exit: After the final choice, config is saved, a one-line summary is printed (including effort/reasoning), and the process exits with process.exit(0) / sys.exit(0).
  • workflow.mdc: /i (implement) is documented to run in the foreground so output streams in the agent terminal; completion is summarized or errors are returned (no “start in background and end turn”).

Files changed / added

Area Files
Core packages/core/models.json (new), package.json (files), pyproject.toml (force-include)
cli-js src/commands/model.ts (new), src/utils/paths.ts (getModelsJsonPath), src/index.ts (model command)
cli-py planforge/commands/model.py (new), planforge/utils/paths.py (get_models_json_path), planforge/cli.py (model command), pyproject.toml (readchar)
Rules templates/cursor/rules/workflow.mdc, .cursor/rules/workflow.mdc (implement foreground wording)

How to test

  1. From repo root, run planforge model (Node CLI: pnpm run build in packages/cli-js first if needed).
  2. Choose planner or implementer (Up/Down, Enter).
  3. If both providers are available, choose Claude or Codex (Up/Down, Enter).
  4. Choose a model (Up/Down, Enter), then Effort (Claude) or Reasoning (Codex) (Up/Down, Enter).
  5. Confirm planforge.json is updated for the selected mode with provider, model, and either effort or reasoning (not both).
  6. Confirm the process exits after the summary line (e.g. Updated planforge.json: planner -> claude / claude-opus-4-6 (effort: high)).
  7. Run planforge init and check that .cursor/rules/workflow.mdc still describes /i as running in the foreground.

Review Requirement

  • TUI line redraw (cursor up + clear) and exit behavior on Windows (PowerShell).
  • Correctness of getModelsJsonPath / get_models_json_path and fallback to packages/core/models.json when used from monorepo.
  • Type safety and config shape when writing planner/implementer (only effort or reasoning per provider).

Additional Info

  • Notion: model (design and implementation summary).
  • Node/Python behavior is aligned per project symmetry rules (same flow and config semantics).

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chucoding chucoding self-assigned this Mar 13, 2026
@chucoding
chucoding merged commit dce61d7 into develop Mar 13, 2026
1 check passed
@chucoding
chucoding deleted the feature/PF-22 branch March 13, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant