Skip to content

[PF-15] Doctor first screen simplified; doctor ai uses planforge.json and planforge model flow - #45

Merged
chucoding merged 6 commits into
developfrom
feature/PF-15_model
Mar 18, 2026
Merged

[PF-15] Doctor first screen simplified; doctor ai uses planforge.json and planforge model flow#45
chucoding merged 6 commits into
developfrom
feature/PF-15_model

Conversation

@chucoding

Copy link
Copy Markdown
Owner

Purpose

  • When running planforge doctor, show only mode selection (static / ai) on the first screen; remove the initial Doctor AI config (model list) block.
  • Make doctor ai use planforge.json only, and use the same model selection flow and catalog (models.json) as planforge model when changing models.

Description

Related Notion: doctor

1. Doctor entry (first screen)

Before After
Show Doctor AI config (default), then mode selection Show mode selection (static / ai) only
  • cli-js: In runDoctorModeSelect(), remove the block that calls getDefaultDoctorAiConfig and printCurrentAiConfig.
  • cli-py: In run_doctor_mode_select(), remove the same block.

2. Doctor ai config source

Before After
templates/doctor default-*.json (getDefaultDoctorAiConfig) planforge.json (loadConfig)
  • Initial planner/implementer and the config shown in the UI come from planforge.json.
  • UI title: "Doctor AI config (planforge.json)".
  • cli-js and cli-py: doctor ai no longer call getDefaultDoctorAiConfig / get_default_doctor_ai_config.

3. Doctor ai model selection = planforge model flow

  • Catalog (models.json) required: If loadModelsCatalog() fails, doctor ai exits with an error message.
  • Change models: After choosing "Role to change" (planner or implementer), call runModelTui (cli-js) / _run_model_tui (cli-py) twice with preselectedMode / preselected_mode. Provider → Model → Effort/Reasoning selection is the same as planforge model.
  • Non-interactive: --provider / --model are only accepted if the pair exists in the catalog.

Files changed

Area File Summary
cli-js src/commands/doctor.ts First-screen config removed; planforge.json used; runModelTui used for Change models; catalog required; removed buildOptionsFromCatalog, selectProviderAndModel, etc.
cli-js src/commands/model.ts Added options?: { preselectedMode?: string } to runModelTui
cli-js src/config/load.ts Removed getDefaultDoctorAiConfig import from doctor (function kept for other use)
cli-py planforge/commands/doctor.py First-screen config removed; planforge.json only; _run_model_tui for Change models; catalog required; Run immediately / Change models loop
cli-py planforge/commands/model.py Added preselected_mode to _run_model_tui

How to test

  1. First screen: Run planforge doctor in a TTY. Confirm that only the mode list (static / ai / Quit) is shown, with no Doctor AI config block at the top.
  2. Doctor ai config: Run planforge doctor → choose ai (or planforge doctor ai). Confirm "Doctor AI config (planforge.json)" and that planner/implementer match planforge.json.
  3. Change models: Choose "Change models" → choose planner or implementer for "Role to change" → confirm the same Provider → Model → Effort/Reasoning flow as planforge model runs twice, then the Action menu appears again.
  4. Catalog required: Temporarily move or rename packages/core/models.json, then run planforge doctor ai. Confirm it exits with a message like "doctor ai uses the same model catalog as planforge model...".
  5. Non-interactive: Run planforge doctor ai --provider claude --model claude-haiku-4-5 and confirm tests run. Run with a provider/model not in the catalog and confirm it fails with a "Check models.json catalog" (or similar) message.
  6. cli-py: Repeat the above with the Python CLI where applicable and confirm behavior matches.

Review Requirement

  • Confirm doctor ai only uses planforge.json and that getDefaultDoctorAiConfig / get_default_doctor_ai_config are not used on the doctor/doctor ai code paths.
  • For runModelTui / _run_model_tui with preselectedMode(preselected_mode), confirm planner and implementer are each selected once and the result is applied correctly.
  • Spot-check that Node and Python behavior match (first screen, config source, Change models flow, catalog requirement, non-interactive validation).

Additional Info

  • Related Notion: doctor — updated via MCP to reflect this change (first screen, planforge.json, model flow integration).
  • Aligned with .cursor/rules/node-python-symmetry.mdc: both cli-js and cli-py updated.

@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.

@chucoding chucoding self-assigned this Mar 18, 2026
@chucoding
chucoding merged commit a0f78b9 into develop Mar 18, 2026
2 checks passed
@chucoding
chucoding deleted the feature/PF-15_model branch March 18, 2026 05:16
chucoding added a commit that referenced this pull request Mar 18, 2026
* [PF-24] Configurable stream timeout and config merge from template JSON

[PF-24] Configurable stream timeout and config merge from template JSON

* [PF-24] Advisory messages, plan loading spinner, and spinner module (#43)

* fix : high effort plan mode timeout (300 => 360)

* refactor : print information message before run cursor sandbox

* feat : add spinner in plan mode

* refactor : spinner moduleration

* [PF-26] Fixing planforge doctor errors on Mac (#44)

* fix : planforge run in mac os

* chore : Change the Planforge Doctor TC1 question to one that a real user would be likely to ask.

* chore : improve CI Build error

* fix : python error

* chore : improve CI GuardRail

* chore : CRLF => LF

* fix : add codex error process (Authentication/Usage/Execution Failure)

* fix : add codex error process (Authentication/Usage/Execution Failure)(python)

* [PF-15] Doctor first screen simplified; doctor ai uses planforge.json and planforge model flow (#45)

* feat : sync doctor ai config model

* fix : improve plan mode rule

* refactor : integration model selector and doctor ai

* refactor : remove no use file

* chore : PR writing rule change lang(ko=>en)

* fix : build error

* release : v0.1.8 (#46)
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