fix(typecheck): add wizard agent creation types - #1566
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📜 Recent review details⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🧰 Additional context used📓 Path-based instructions (5)**/*.{ts,tsx,js,jsx,py}📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
**/*⚙️ CodeRabbit configuration file
Files:
**⚙️ CodeRabbit configuration file
Files:
**/*.{test,spec}.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (4)
📝 WalkthroughWalkthroughThe wizard system is made generic and strongly typed. New wizard types and agent-specific wizard state are added. WizardProvider becomes generic; CreateAgentWizard and all agent wizard steps adopt typed hooks, explicit return types, and guards. Tests exercise step behavior under the typed provider. ChangesWizard System Type Safety
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 6 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/agents/new-agent-creation/wizard-steps/ColorStep.tsx`:
- Around line 37-47: Add a guard at the start of the handleConfirm function in
ColorStep to validate required wizardData fields (wizardData.agentType,
wizardData.whenToUse, wizardData.systemPrompt, wizardData.location) and handle
the error or navigate back (early return) if any are missing; then remove the
non-null assertions when building the finalAgent/CustomAgentDefinition so
getSystemPrompt can safely return a valid string and the object conforms to the
CustomAgentDefinition contract.
In `@src/components/agents/new-agent-creation/wizard-steps/ConfirmStep.tsx`:
- Around line 72-74: The silent return in ConfirmStep when `agent` or
`wizardData.location` is missing can leave the wizard blank; update ConfirmStep
to handle this case explicitly by either navigating the wizard back to a safe
step or rendering a clear fallback error UI. Modify the block that currently
does `if (!agent || !wizardData.location) { return null; }` to call your wizard
navigation callback (e.g., a provided `onBack`/`goToStep` function) or render a
small error message/button that lets the user resume the flow, ensuring the
fallback integrates with the existing ConfirmStepWrapper guard.
In `@src/components/agents/new-agent-creation/wizard-steps/MemoryStep.tsx`:
- Line 80: The getSystemPrompt arrow uses a non-null assertion on
wizardData.systemPrompt!, which defers validation; change getSystemPrompt in
MemoryStep.tsx to defensively handle a possibly undefined systemPrompt (e.g.,
use optional chaining or a safe default like "" instead of "!") so both branches
read something like (wizardData.systemPrompt ?? "") and then append
loadAgentMemoryPrompt(agentType, memory) only when needed; reference the
getSystemPrompt binding, wizardData.systemPrompt, loadAgentMemoryPrompt, and
PromptStep to ensure PromptStep still validates the field while preventing
runtime crashes during save.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 725298c2-0d46-4ea0-b705-bc0df9568f79
📒 Files selected for processing (14)
src/components/agents/new-agent-creation/CreateAgentWizard.tsxsrc/components/agents/new-agent-creation/types.tssrc/components/agents/new-agent-creation/wizard-steps/ColorStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/ConfirmStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/DescriptionStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/LocationStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/MemoryStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/MethodStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/ModelStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/PromptStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/ToolsStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/TypeStep.tsxsrc/components/wizard/WizardProvider.tsxsrc/components/wizard/types.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: smoke-and-tests
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx,py}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.{ts,tsx,js,jsx,py}: Follow the existing code style in the touched files
Keep comments useful and concise
Files:
src/components/agents/new-agent-creation/wizard-steps/MethodStep.tsxsrc/components/wizard/types.tssrc/components/agents/new-agent-creation/CreateAgentWizard.tsxsrc/components/agents/new-agent-creation/wizard-steps/TypeStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/ToolsStep.tsxsrc/components/agents/new-agent-creation/types.tssrc/components/agents/new-agent-creation/wizard-steps/LocationStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/DescriptionStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/ModelStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/MemoryStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/PromptStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/ColorStep.tsxsrc/components/wizard/WizardProvider.tsxsrc/components/agents/new-agent-creation/wizard-steps/ConfirmStep.tsx
**/*
⚙️ CodeRabbit configuration file
**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.
Files:
src/components/agents/new-agent-creation/wizard-steps/MethodStep.tsxsrc/components/wizard/types.tssrc/components/agents/new-agent-creation/CreateAgentWizard.tsxsrc/components/agents/new-agent-creation/wizard-steps/TypeStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/ToolsStep.tsxsrc/components/agents/new-agent-creation/types.tssrc/components/agents/new-agent-creation/wizard-steps/LocationStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/DescriptionStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/ModelStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/MemoryStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/PromptStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/ColorStep.tsxsrc/components/wizard/WizardProvider.tsxsrc/components/agents/new-agent-creation/wizard-steps/ConfirmStep.tsx
**
⚙️ CodeRabbit configuration file
**: # Contributing to OpenClaudeThanks for contributing.
OpenClaude is a fast-moving open-source coding-agent CLI with support for multiple providers, local backends, MCP, and a terminal-first workflow. The best contributions here are focused, well-tested, and easy to review.
Before You Start
- Search existing issues and discussions before opening a new thread.
- Check open pull requests for work that overlaps with your contribution. If a PR already exists that addresses the same change, open an issue or discussion first to align on direction — duplicate PRs may be closed without review.
- Use issues for confirmed bugs and actionable feature work.
- Use discussions for setup help, ideas, and general community conversation.
- For larger changes, open an issue first so the scope is clear before implementation.
- For security reports, follow SECURITY.md.
Pull Requests
Every PR needs a reason. Your PR description must include:
- what changed and why
- the user or developer impact
- the exact checks you ran
- a linked issue when one exists, using
Fixes#123, `Closes `#123, or another clear link- screenshots when the PR touches UI, terminal presentation, or the VS Code extension
- which provider path was tested when the PR changes provider behavior
The PR author is responsible for ensuring their PR is merge-ready. PRs with merge conflicts will not be reviewed or approved until the conflicts are resolved.
Issues are the recommended starting point for anything non-trivial — opening one first helps avoid wasted effort if the change is out of scope or already being worked on. Small fixes, doc corrections, and obvious improvements can stand on their own without a linked issue, as long as the PR description explains the intent.
What Gets Closed Without Review
PRs may be closed without review...
Files:
src/components/agents/new-agent-creation/wizard-steps/MethodStep.tsxsrc/components/wizard/types.tssrc/components/agents/new-agent-creation/CreateAgentWizard.tsxsrc/components/agents/new-agent-creation/wizard-steps/TypeStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/ToolsStep.tsxsrc/components/agents/new-agent-creation/types.tssrc/components/agents/new-agent-creation/wizard-steps/LocationStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/DescriptionStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/ModelStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/MemoryStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/PromptStep.tsxsrc/components/agents/new-agent-creation/wizard-steps/ColorStep.tsxsrc/components/wizard/WizardProvider.tsxsrc/components/agents/new-agent-creation/wizard-steps/ConfirmStep.tsx
🔇 Additional comments (24)
src/components/wizard/types.ts (1)
1-32: LGTM!src/components/wizard/WizardProvider.tsx (4)
9-9: LGTM!
40-40: LGTM!
111-111: LGTM!
140-140: LGTM!src/components/agents/new-agent-creation/CreateAgentWizard.tsx (3)
26-26: LGTM!
80-80: LGTM!
87-87: LGTM!src/components/agents/new-agent-creation/wizard-steps/MethodStep.tsx (1)
19-19: LGTM!src/components/agents/new-agent-creation/wizard-steps/ModelStep.tsx (1)
17-17: LGTM!src/components/agents/new-agent-creation/wizard-steps/ToolsStep.tsx (2)
14-14: LGTM!
24-24: LGTM!src/components/agents/new-agent-creation/wizard-steps/TypeStep.tsx (3)
17-17: LGTM!
24-24: LGTM!
26-26: LGTM!src/components/agents/new-agent-creation/types.ts (1)
12-27: LGTM!src/components/agents/new-agent-creation/wizard-steps/ConfirmStep.tsx (2)
28-28: LGTM!
40-40: LGTM!src/components/agents/new-agent-creation/wizard-steps/DescriptionStep.tsx (2)
21-21: LGTM!
24-24: LGTM!src/components/agents/new-agent-creation/wizard-steps/LocationStep.tsx (1)
20-20: LGTM!src/components/agents/new-agent-creation/wizard-steps/MemoryStep.tsx (1)
25-25: LGTM!src/components/agents/new-agent-creation/wizard-steps/PromptStep.tsx (2)
20-20: LGTM!
23-23: LGTM!
jatmn
left a comment
There was a problem hiding this comment.
Thanks for the contribution. I do not see any actionable issues from my review.
@kevincodex1 LGTM
* fix(typecheck): add wizard agent creation types * fix(typecheck): guard agent wizard state
* fix(typecheck): add wizard agent creation types * fix(typecheck): guard agent wizard state
Refs #1486
Summary
useWizardcarries the correct data shapeValidation
bun run typecheckstill fails on unrelated baseline errors from fix: (All-call) TypeScript cleanup PRs needed #1486src/*diagnostics reduced from 1043 to 1022 versus the captured baselineDuplicate check
Summary by CodeRabbit
Refactor
Bug Fixes / UX
Tests