Skip to content

Comments

fix: pass command config to agent in create-prd and doctor commands#191

Merged
subsy merged 4 commits intosubsy:mainfrom
Unravl:fix/command-config-in-create-prd-and-doctor
Jan 22, 2026
Merged

fix: pass command config to agent in create-prd and doctor commands#191
subsy merged 4 commits intosubsy:mainfrom
Unravl:fix/command-config-in-create-prd-and-doctor

Conversation

@Unravl
Copy link
Contributor

@Unravl Unravl commented Jan 22, 2026

Summary

  • Fixed create-prd command to pass storedConfig.command to agent config
  • Fixed doctor command to pass storedConfig.command to agent config

The command field from config was not being passed to the agent plugin configuration in these commands. This caused them to ignore the user's configured custom command (e.g., command = "zai" in config.toml) and always use the default command (e.g., claude).

The main run command already handled this correctly via buildConfig() and getDefaultAgentConfig(), but these two commands built their agent configs manually without including the command field.

Test plan

  • Set command = "custom-agent" in ~/.config/ralph-tui/config.toml
  • Run ralph-tui create-prd and verify it uses the custom command
  • Run ralph-tui doctor and verify it checks the custom command
  • Verify ralph-tui run still works (no changes needed there)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor

    • Agent configuration now accepts optional command and environment‑exclusion settings so agent instances receive explicit command context and controlled environment variables.
  • Tests

    • New tests added to validate CLI argument parsing and help output, and to ensure command and environment‑exclusion settings are correctly propagated during agent initialisation.

✏️ Tip: You can customize this high-level summary in your review settings.

The `command` field from storedConfig was not being passed to the agent
plugin configuration in the create-prd and doctor commands. This caused
these commands to ignore the user's configured custom command (e.g.,
`command = "zai"` in config.toml) and always use the default command.

The main `run` command already handled this correctly via `buildConfig()`
and `getDefaultAgentConfig()`, but these two commands built their agent
configs manually without including the command field.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@vercel
Copy link

vercel bot commented Jan 22, 2026

@Unravl is attempting to deploy a commit to the plgeek Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 22, 2026

Walkthrough

Propagates stored configuration into agent initialization: adds optional command to AgentPluginConfig and passes command and envExclude from storedConfig into registry.getInstance() in CLI commands; adds tests covering parsing and config propagation.

Changes

Cohort / File(s) Summary
Type definition
src/plugins/agents/types.ts
Added optional command?: string to AgentPluginConfig.
Command initialisation
src/commands/create-prd.tsx, src/commands/doctor.ts
registry.getInstance(...) calls now include command: storedConfig.command and envExclude: storedConfig.envExclude.
Tests — create-prd
src/commands/create-prd.test.tsx
New comprehensive tests for create-prd: argument parsing, help text, CLI exposure checks, temp-dir filesystem interactions, and mocked agent registry.
Tests — doctor
src/commands/doctor.test.ts
New tests to capture getInstance config, write TOML configs, and assert propagation of envExclude and command from config files.

Sequence Diagram(s)

(omitted — changes are parameter propagation, not a new multi-component control flow)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I hopped through config, nose to the byte,
I carried a command and hid some vars from sight.
From stored to agent my little path ran,
Two fields in tow — a tidy bit of plan. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarises the main change: passing command config to agent in create-prd and doctor commands, which is the core fix described in the PR objectives.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel
Copy link

vercel bot commented Jan 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
ralph-tui Ignored Ignored Preview Jan 22, 2026 3:22pm

Request Review

@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.91%. Comparing base (1a0f4e3) to head (b86c74e).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #191   +/-   ##
=======================================
  Coverage   44.90%   44.91%           
=======================================
  Files          76       76           
  Lines       22075    22077    +2     
=======================================
+ Hits         9913     9915    +2     
  Misses      12162    12162           
Files with missing lines Coverage Δ
src/commands/doctor.ts 80.35% <100.00%> (+0.23%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

AI Agent added 2 commits January 22, 2026 15:12
Similar to the existing command config propagation, this ensures that
envExclude patterns from the stored config are passed to the agent
when initialized in create-prd and doctor commands.
- Add tests verifying envExclude is passed to getInstance in doctor command
- Add tests verifying command is passed to getInstance in doctor command
- Add create-prd.test.tsx with argument parsing tests
@subsy
Copy link
Owner

subsy commented Jan 22, 2026

@Unravl thanks for the fix - i also added some tests. Merging and will be in the 0.4.0 release today

@subsy subsy merged commit 9821bcf into subsy:main Jan 22, 2026
7 checks passed
sakaman pushed a commit to sakaman/ralph-tui that referenced this pull request Feb 15, 2026
…-prd-and-doctor

fix: pass command config to agent in create-prd and doctor commands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants