Add web agent creation controls#249
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR adds an agent creation panel to the dashboard, threads ChangesAgent controls and creation
Sequence Diagram(s)Fork action flow sequenceDiagram
participant User
participant AgentActions
participant forkAgent
User->>AgentActions: press Fork
AgentActions->>forkAgent: forkAgent({ sourceSessionId, tool, worktreePath, open: false }, { token })
forkAgent-->>AgentActions: fork result
Review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Independent review findings fixed in ad8c783:
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Second independent review findings fixed in b49265a:
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
app/components/agent-create-panel.tsx (1)
35-41: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRedundant path filtering.
worktreeChoicesalready excludes entries without apath(Line 38), so the second.filter((choice) => choice.path)at Line 104 is dead. You can drop it to simplify the render.♻️ Proposed simplification
- {worktreeChoices - .filter((choice) => choice.path) - .map((choice) => ( + {worktreeChoices.map((choice) => ( <WorktreeChip key={choice.key} label={choice.label} active={worktreePath === choice.path} onPress={() => setWorktreePath(choice.path)} /> ))}Also applies to: 103-113
🤖 Prompt for 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. In `@app/components/agent-create-panel.tsx` around lines 35 - 41, The render logic still applies a redundant path check to worktreeChoices even though the useMemo in agent-create-panel already filters out entries without a path. Remove the unnecessary .filter((choice) => choice.path) from the worktree rendering path and rely on the existing filtering in worktreeChoices, keeping the mapping/selection logic in sync with the worktreeChoices memo.app/components/ProjectSidebar.tsx (1)
355-355: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider passing the canonical main-checkout path instead of the session's own path.
Here
mainCheckoutPathis set tosession.worktreePath, butAgentActionsonly uses this prop to decide whether to omit the worktree path on fork (session.worktreePath !== mainCheckoutPath). Feeding the session's own path works solely by self-comparison, which is indirect and diverges fromAgentChatScreen.tsx(line 497) where the realdesktopState.mainCheckoutPathis passed. Usingbucket.pathwould be equivalent in behavior but clearer and consistent across callers.♻️ Suggested change
- mainCheckoutPath={bucket.isMainCheckout ? session.worktreePath : undefined} + mainCheckoutPath={bucket.isMainCheckout ? bucket.path : undefined}🤖 Prompt for 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. In `@app/components/ProjectSidebar.tsx` at line 355, The main-checkout path passed into AgentActions is using the session’s own worktree path instead of the canonical main checkout path, which is indirect and inconsistent with other callers. Update the mainCheckoutPath prop in ProjectSidebar’s AgentActions usage to pass the bucket’s canonical path (matching the behavior used by AgentChatScreen with desktopState.mainCheckoutPath), so the fork comparison remains clear and consistent.
🤖 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.
Nitpick comments:
In `@app/components/agent-create-panel.tsx`:
- Around line 35-41: The render logic still applies a redundant path check to
worktreeChoices even though the useMemo in agent-create-panel already filters
out entries without a path. Remove the unnecessary .filter((choice) =>
choice.path) from the worktree rendering path and rely on the existing filtering
in worktreeChoices, keeping the mapping/selection logic in sync with the
worktreeChoices memo.
In `@app/components/ProjectSidebar.tsx`:
- Line 355: The main-checkout path passed into AgentActions is using the
session’s own worktree path instead of the canonical main checkout path, which
is indirect and inconsistent with other callers. Update the mainCheckoutPath
prop in ProjectSidebar’s AgentActions usage to pass the bucket’s canonical path
(matching the behavior used by AgentChatScreen with
desktopState.mainCheckoutPath), so the fork comparison remains clear and
consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 152c27e6-c290-4882-b295-f2ca0cdff59a
📒 Files selected for processing (5)
app/components/ProjectSidebar.tsxapp/components/WorktreeDashboard.tsxapp/components/agent-actions.tsxapp/components/agent-create-panel.tsxapp/components/screens/AgentChatScreen.tsx
Summary
Verification
Summary by CodeRabbit
New Features
Bug Fixes