feat(chat): spawn types + completion reporting + spawned-chat navigation#820
Conversation
Add a spawner-declared spawn type (subagent | peer | none) that is cosmetic to capabilities — a typed agent is a full ADE agent — and only sets a completion- report policy: a subagent wakes its spawner when it finishes, a peer drops a quiet notice, none (the default for an untyped spawn) stays silent. Delivery is the existing provider-agnostic messageSession(kind:"wake") path plus a subagent self-report guidance line; best-effort, non-durable. Spawned ADE chats are now navigable from their inline card, actions-pane row, and sidebar through one navigateToSpawnedChat helper, with a SUBAGENT/PEER type pill, a live-children badge, and a two-way lineage breadcrumb. spawnKind + orchestrationParentSessionId are projected onto TerminalSessionSummary. The orchestrator's spawnAgent sets the type too. Also adds CLI child-lane guidance: `ade lanes create` / `ade new chat --auto-create-lane` warn when the current lane has unmerged commits (suggesting `ade lanes child` to carry them) and when the resolved base is stale, with an ade-lanes-git decision table. New `ade new chat --type` flag. Docs, skills, and tests updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@copilot review but do not make fixes |
|
Warning Review limit reached
Next review available in: 15 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughChangesSpawn lineage and lane workflows
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@apps/desktop/src/renderer/components/chat/AgentChatPane.tsx`:
- Around line 4824-4833: Update the spawnLineage logic in AgentChatPane to
resolve a missing parent title through the existing parent-session
summary/loading mechanism when the parentId is not found in the local sessions
list. Preserve the local title lookup and breadcrumb link, and use the fetched
summary title before falling back to the generic label.
In `@apps/desktop/src/renderer/components/terminals/SessionListPane.tsx`:
- Around line 482-491: Update the liveChildrenByParentId useMemo to iterate over
the unfiltered loaded sessions rather than allSessions, while preserving the
existing parent/self and running-status checks so sidebar filters do not reduce
parent child-count badges.
🪄 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: CHILL
Plan: Pro
Run ID: 91054936-490c-4a58-9dd0-4f22f1d2f92c
⛔ Files ignored due to path filters (3)
docs/features/agents/README.mdis excluded by!docs/**docs/features/chat/README.mdis excluded by!docs/**docs/features/lanes/stacking.mdis excluded by!docs/**
📒 Files selected for processing (30)
apps/ade-cli/README.mdapps/ade-cli/src/adeRpcServer.test.tsapps/ade-cli/src/adeRpcServer.tsapps/ade-cli/src/cli.test.tsapps/ade-cli/src/cli.tsapps/ade-cli/src/services/laneCreateRemoteBase.tsapps/desktop/resources/agent-skills/ade-cli-control-plane/SKILL.mdapps/desktop/resources/agent-skills/ade-lanes-git/SKILL.mdapps/desktop/src/main/services/ai/tools/orchestrationTools.test.tsapps/desktop/src/main/services/ai/tools/orchestrationTools.tsapps/desktop/src/main/services/chat/agentChatService.test.tsapps/desktop/src/main/services/chat/agentChatService.tsapps/desktop/src/main/services/ipc/registerIpc.tsapps/desktop/src/main/services/orchestration/orchestrationDomain.test.tsapps/desktop/src/main/services/orchestration/orchestrationDomain.tsapps/desktop/src/renderer/components/chat/AgentChatMessageList.test.tsxapps/desktop/src/renderer/components/chat/AgentChatMessageList.tsxapps/desktop/src/renderer/components/chat/AgentChatPane.tsxapps/desktop/src/renderer/components/chat/ChatSubagentsPanel.tsxapps/desktop/src/renderer/components/chat/SubagentActivityCards.test.tsxapps/desktop/src/renderer/components/chat/SubagentActivityCards.tsxapps/desktop/src/renderer/components/chat/chatTranscriptRows.test.tsapps/desktop/src/renderer/components/chat/chatTranscriptRows.tsapps/desktop/src/renderer/components/chat/spawnNavigation.test.tsapps/desktop/src/renderer/components/chat/spawnNavigation.tsapps/desktop/src/renderer/components/terminals/SessionCard.test.tsxapps/desktop/src/renderer/components/terminals/SessionCard.tsxapps/desktop/src/renderer/components/terminals/SessionListPane.tsxapps/desktop/src/shared/types/chat.tsapps/desktop/src/shared/types/sessions.ts
| // Two-way lineage: a spawned child chat shows a "↳ from <spawner>" breadcrumb | ||
| // in its header that navigates back to the parent. Parent title resolves from | ||
| // the loaded session list; falls back to a generic label with the link intact. | ||
| const spawnLineage = useMemo(() => { | ||
| const parentId = selectedSession?.orchestrationParentSessionId?.trim(); | ||
| if (!parentId || parentId === selectedSession?.sessionId) return null; | ||
| const parentTitle = sessions.find((s) => s.sessionId === parentId)?.title?.trim() || null; | ||
| return { parentId, parentTitle, spawnKind: selectedSession?.spawnKind ?? null }; | ||
| }, [selectedSession?.orchestrationParentSessionId, selectedSession?.sessionId, selectedSession?.spawnKind, sessions]); | ||
|
|
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- locate relevant symbols ---'
rg -n "spawnLineage|navigateToSpawnedChat|getSummary|refreshSessions|listAgentChatSessionsCached|spawned\?\.laneId|orchestrationParentSessionId" \
apps/desktop/src/renderer/components/chat/AgentChatPane.tsx \
apps/desktop/src/renderer/components/chat/AgentChatMessageList.tsx \
apps/desktop/src -g '*.ts' -g '*.tsx'
echo
echo '--- outline AgentChatPane ---'
ast-grep outline apps/desktop/src/renderer/components/chat/AgentChatPane.tsx --view expanded | sed -n '1,220p'
echo
echo '--- relevant slice AgentChatPane ---'
sed -n '4800,4875p' apps/desktop/src/renderer/components/chat/AgentChatPane.tsx
echo
echo '--- relevant slice AgentChatMessageList ---'
sed -n '1,260p' apps/desktop/src/renderer/components/chat/AgentChatMessageList.tsxRepository: arul28/ADE
Length of output: 50366
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show the exact implementation around the cited call site and the navigation helper.
sed -n '4824,4878p' apps/desktop/src/renderer/components/chat/AgentChatPane.tsx
echo
echo '--- navigateToSpawnedChat references ---'
rg -n "navigateToSpawnedChat" apps/desktop/src -g '*.ts' -g '*.tsx' -A 6 -B 6
echo
echo '--- getSummary references ---'
rg -n "getSummary\\(" apps/desktop/src -g '*.ts' -g '*.tsx' -A 4 -B 4
echo
echo '--- listAgentChatSessionsCached references ---'
rg -n "listAgentChatSessionsCached|refreshSessions" apps/desktop/src -g '*.ts' -g '*.tsx' -A 4 -B 4Repository: arul28/ADE
Length of output: 50367
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- spawnNavigation helper ---'
sed -n '1,120p' apps/desktop/src/renderer/components/chat/spawnNavigation.ts
echo
echo '--- select-session event listeners ---'
rg -n "ade:work:select-session|select-session" apps/desktop/src -g '*.ts' -g '*.tsx' -A 8 -B 8
echo
echo '--- any session selection by laneId in renderer ---'
rg -n "laneId.*sessionId|sessionId.*laneId|selectSession|selectedSessionId" apps/desktop/src/renderer -g '*.ts' -g '*.tsx' -A 4 -B 4Repository: arul28/ADE
Length of output: 50367
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- event listener in TerminalsPage ---'
sed -n '248,268p' apps/desktop/src/renderer/components/terminals/TerminalsPage.tsx
echo
echo '--- focusSession implementation / usage ---'
rg -n "focusSession\\(" apps/desktop/src/renderer -g '*.ts' -g '*.tsx' -A 4 -B 4
echo
echo '--- work store session selection methods ---'
rg -n "selectLane\\(|setSelectedSessionId|selectedSessionId|focusSession" apps/desktop/src/renderer/components/terminals apps/desktop/src/renderer/state -g '*.ts' -g '*.tsx' -A 4 -B 4Repository: arul28/ADE
Length of output: 50366
Resolve missing parent summaries for spawned chats
spawnLineage only looks at the current lane’s sessions list, so a parent from another lane falls back to the generic “spawner” label. Fetch the parent summary when it isn’t loaded locally so the breadcrumb can show the real title.
🤖 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 `@apps/desktop/src/renderer/components/chat/AgentChatPane.tsx` around lines
4824 - 4833, Update the spawnLineage logic in AgentChatPane to resolve a missing
parent title through the existing parent-session summary/loading mechanism when
the parentId is not found in the local sessions list. Preserve the local title
lookup and breadcrumb link, and use the fetched summary title before falling
back to the generic label.
Address CodeRabbit review: the sidebar live-children badge derived its count from the already search/lane-filtered session list, so a filter/search could hide a running child and undercount its visible parent's badge. Thread the unfiltered session list into SessionListPane and count from it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@codex review |
|
Addressed the CodeRabbit review:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50b8993c57
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ...(!createArgs.parentLaneId && typeof createArgs.name === "string" && createArgs.name.trim() | ||
| ? { laneCreationNudge: { newLaneName: createArgs.name.trim() } } |
There was a problem hiding this comment.
Gate lane-creation nudges on an implicit base
When ade lanes create --base release --name x is run from a lane with commits ahead of origin/main, this condition still enables laneCreationNudge because it only excludes parent lanes. The warning then says the new lane is continuing off remote main and suggests ade lanes child, even though the explicit baseBranch is what will be used; the analogous ade new chat --auto-create-lane --base ... guard has the same gap. Please suppress the nudge whenever the create args include an explicit base/start point.
Useful? React with 👍 / 👎.
Address Codex review (P3): the unmerged-work child-lane nudge fired even when `ade lanes create --base <ref>` / `ade new chat --auto-create-lane --base <ref>` passed an explicit base, wrongly claiming the new lane continues off remote main. Gate the nudge on the absence of an explicit baseBranch at both sites. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Fixed in f7f21c5 — the lane-creation nudge (both |
| orchestrationRunId: arg.runId, | ||
| orchestrationRole: arg.role, | ||
| orchestrationParentSessionId: arg.leadSessionId, | ||
| spawnKind: "subagent", |
There was a problem hiding this comment.
Preserve requested spawn kind
spawnAgent now accepts spawnKind through the tool schema, but this shared domain path still hard-codes every worker as subagent. Any orchestration spawn routed through OrchestrationSpawnAgentRequest loses a requested peer or none, so it will wake the parent and render the wrong relationship despite the caller selecting a quieter policy. Add spawnKind to the request type and pass arg.spawnKind ?? "subagent" here.
Artifacts
Repro: focused Vitest test source invoking spawnAgent with spawnKind peer
- Contains supporting evidence from the run (text/typescript; charset=utf-8).
Repro: verbose Vitest output showing requested peer became createSession subagent
- Keeps the command output available without making the summary code-heavy.
Ran code and verified through T-Rex
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/main/services/orchestration/orchestrationDomain.ts
Line: 146
Comment:
**Preserve requested spawn kind**
`spawnAgent` now accepts `spawnKind` through the tool schema, but this shared domain path still hard-codes every worker as `subagent`. Any orchestration spawn routed through `OrchestrationSpawnAgentRequest` loses a requested `peer` or `none`, so it will wake the parent and render the wrong relationship despite the caller selecting a quieter policy. Add `spawnKind` to the request type and pass `arg.spawnKind ?? "subagent"` here.
How can I resolve this? If you propose a fix, please make it concise.
Summary by CodeRabbit
New Features
ade new chat --typeoptions for subagent, peer, or untyped chats.Bug Fixes
Documentation
Greptile Summary
This PR adds typed spawned chats and clearer child-lane guidance. The main changes are:
ade new chat --typeforsubagent,peer, andnonespawn relationships.Confidence Score: 4/5
Mostly safe to merge after fixing the spawn-kind contract bug.
The CLI, service, and renderer changes are well covered, but one orchestration path ignores requested
spawnKindand can send the wrong completion behavior.apps/desktop/src/main/services/orchestration/orchestrationDomain.tsWhat T-Rex did
Important Files Changed
subagentand drops requested quieter spawn kinds.spawnKindinput to the orchestration spawn tool and defaults to subagent.--typeparsing for chat spawns and stderr nudges for base-less lane creation with unmerged work.Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant Parent as Parent chat participant CLI as ade new chat / spawnAgent participant Service as AgentChatService participant Child as Spawned chat participant UI as Renderer UI Parent->>CLI: request child with spawnKind CLI->>Service: createSession(orchestrationParentSessionId, spawnKind) Service-->>Parent: subagent_started / spawn notice Service-->>UI: session summary includes lineage + spawnKind Child->>Service: turn completes alt "spawnKind = subagent" Service->>Parent: wake message with spawnCompletion metadata UI-->>Parent: spawn wake divider + open child action else "spawnKind = peer" Service-->>Parent: quiet spawn_completed notice else "spawnKind = none" Service-->>Parent: no completion report end%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant Parent as Parent chat participant CLI as ade new chat / spawnAgent participant Service as AgentChatService participant Child as Spawned chat participant UI as Renderer UI Parent->>CLI: request child with spawnKind CLI->>Service: createSession(orchestrationParentSessionId, spawnKind) Service-->>Parent: subagent_started / spawn notice Service-->>UI: session summary includes lineage + spawnKind Child->>Service: turn completes alt "spawnKind = subagent" Service->>Parent: wake message with spawnCompletion metadata UI-->>Parent: spawn wake divider + open child action else "spawnKind = peer" Service-->>Parent: quiet spawn_completed notice else "spawnKind = none" Service-->>Parent: no completion report endPrompt To Fix All With AI
Reviews (2): Last reviewed commit: "fix(cli): suppress lane-creation nudge w..." | Re-trigger Greptile