feat: SpawnTracker + UI polish + orchestration panel resize#24
feat: SpawnTracker + UI polish + orchestration panel resize#24Youhai020616 merged 1 commit intodevelopfrom
Conversation
## New Feature: SpawnTracker - Add SpawnTracker engine module that bridges Gateway-native sessions_spawn tool calls to the TaskQueue system (auto-creates Project + Task entries) - Register SpawnTracker in bootstrap.ts alongside other engine components - Move event forwarding (task:changed, project:changed, message:new) from ipc/supervisor.ts to electron/main/index.ts for eager initialization after Gateway starts — ensures SpawnTracker events reach renderer immediately ## Supervisor & Delegation Improvements - Remove employee status from team roster in compiler.ts (sessions_spawn auto-activates offline employees — showing status=offline caused LLM to incorrectly skip delegation) - Strengthen Supervisor SKILL.md delegation rules: MUST delegate when specialist exists, NEVER do specialist work yourself - Add deerapi provider to provider-registry.ts ## UI Polish: Avatar Images - Support employeeAvatarImage throughout the conversation system: - conversation.ts types, conversations store, IPC conversation handler - WelcomeScreen, Chat page, EmployeeChat, Supervisor page - ConversationList: show avatar images in sidebar items and mini tab bar - Supervisor page: show actual avatar images in header instead of emoji ## UI Polish: Conversation List - Replace custom context menu with Radix DropdownMenu (Portal-based, avoids overflow clipping in scrollable containers) ## UI Polish: Supervisor Orchestration Panel - Add resizable right panel with drag handle (min 240px, max 480px) - Persist panel width in settings store (orchestrationPanelWidth) - Auto-open panel when project:changed event detected (sessions_spawn) - Double-click handle to reset to default width (320px) - Collapse panel when dragged below threshold (180px) ## UI Polish: Chat Experience - Improve auto-scroll: instant jump after session switch, smooth for new messages - Increase ChatInput bottom padding for better spacing - Remove thinking toggle button from ChatToolbar (simplify toolbar) - Fix tooltip positioning (side=bottom) ## Activity & Task Stores - activity.ts: track project lifecycle events (created/started/completed/reviewing) - tasks.ts: listen for project:changed events for real-time project updates ## Cleanup - Delete CLAUDE.md (consolidated into AGENTS.md)
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ 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:
✨ 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 |
🤖 Augment PR SummarySummary: This PR adds a new engine component (SpawnTracker) to bridge Supervisor Changes:
Technical Notes: SpawnTracker listens to Gateway 🤖 Was this summary useful? React with 👍 or 👎 |
| const args = resolveToolArgs(p); | ||
| if (!args) return; | ||
|
|
||
| const task = (args.task ?? args.message ?? '') as string; |
There was a problem hiding this comment.
task is being cast to string, but if sessions_spawn args ever provide a non-string (e.g., structured payload), later uses like task.slice(...) / firstTaskDesc.length will throw and the spawn won’t be tracked.
Severity: medium
Other Locations
electron/engine/spawn-tracker.ts:242electron/engine/spawn-tracker.ts:409
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| const toolName = resolveToolName(p); | ||
| if (toolName !== 'sessions_spawn') return; | ||
|
|
||
| const toolCallId = resolveToolCallId(p); |
There was a problem hiding this comment.
processToolCallCompleted returns early when toolCallId is missing, so if Gateway tool notifications don’t include an id (as some existing tool event shapes do), childSessionKey will never be captured and spawned tasks may never auto-complete.
Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| } else { | ||
| // No childSessionKey — fall back to agentId-based matching. | ||
| // Keep in activeSpawns by agentId for lifecycle event matching. | ||
| this.activeSpawns.set(tracked.agentId, tracked); |
There was a problem hiding this comment.
The agentId fallback (activeSpawns.set(tracked.agentId, tracked)) can overwrite earlier entries if multiple sessions_spawn calls happen for the same agent without a childSessionKey, which risks completing/matching the wrong task.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| if (existing) { | ||
| // Verify project still exists | ||
| const project = this.taskQueue.getProject(existing); | ||
| if (project) return existing; |
There was a problem hiding this comment.
getOrCreateProject() reuses an existing project for the session without considering project status; if a project was already marked completed, subsequent spawns in the same conversation will add tasks under a completed project unless something else reopens it.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| // Session just switched — jump to bottom instantly (no animation) | ||
| messagesContainerRef.current?.scrollTo({ | ||
| top: messagesContainerRef.current.scrollHeight, | ||
| behavior: 'instant' as ScrollBehavior, |
There was a problem hiding this comment.
Summary
This PR introduces the SpawnTracker engine module and a batch of UI polish improvements.
🆕 SpawnTracker Engine Module
sessions_spawntool calls → TaskQueue (auto-creates Project + Task)ipc/supervisor.tstomain/index.ts(eliminates lazy-init race)🤖 Supervisor & Delegation
🎨 UI Polish
employeeAvatarImageacross conversation system, sidebar, welcome screen, supervisor page📊 Real-time Updates
activity.ts: Track project lifecycle eventstasks.ts: Listen forproject:changedfor real-time project state🧹 Cleanup
CLAUDE.md(consolidated intoAGENTS.md)CI checks: ✅ typecheck | ✅ 500/500 tests |⚠️ lint warnings only in submodules (pre-existing)