Skip to content

feat: SpawnTracker + UI polish + orchestration panel resize#24

Merged
Youhai020616 merged 1 commit intodevelopfrom
feat/spawn-tracker-ui-polish
Mar 24, 2026
Merged

feat: SpawnTracker + UI polish + orchestration panel resize#24
Youhai020616 merged 1 commit intodevelopfrom
feat/spawn-tracker-ui-polish

Conversation

@Youhai020616
Copy link
Copy Markdown
Owner

Summary

This PR introduces the SpawnTracker engine module and a batch of UI polish improvements.

🆕 SpawnTracker Engine Module

  • Bridges Gateway-native sessions_spawn tool calls → TaskQueue (auto-creates Project + Task)
  • Eager initialization after Gateway starts for real-time event forwarding
  • Event forwarding moved from ipc/supervisor.ts to main/index.ts (eliminates lazy-init race)

🤖 Supervisor & Delegation

  • Remove employee status from team roster (prevents LLM from skipping offline employees)
  • Strengthen delegation rules in SKILL.md: MUST delegate when specialist exists
  • Add deerapi provider

🎨 UI Polish

  • Avatar images: Support employeeAvatarImage across conversation system, sidebar, welcome screen, supervisor page
  • Conversation list: Replace custom context menu → Radix DropdownMenu (Portal-based, no overflow clipping)
  • Orchestration panel: Resizable right panel (drag handle, 240-480px range, persisted width, auto-open on spawn)
  • Chat scroll: Instant jump on session switch, smooth for new messages
  • ChatToolbar: Remove thinking toggle, fix tooltip positioning

📊 Real-time Updates

  • activity.ts: Track project lifecycle events
  • tasks.ts: Listen for project:changed for real-time project state

🧹 Cleanup

  • Delete CLAUDE.md (consolidated into AGENTS.md)

CI checks: ✅ typecheck | ✅ 500/500 tests | ⚠️ lint warnings only in submodules (pre-existing)

## 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)
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 505228c1-2ab9-4e2b-88db-234c62328945

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/spawn-tracker-ui-polish

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.

@Youhai020616 Youhai020616 merged commit 84ad407 into develop Mar 24, 2026
3 checks passed
@Youhai020616 Youhai020616 deleted the feat/spawn-tracker-ui-polish branch March 24, 2026 07:28
@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 24, 2026

🤖 Augment PR Summary

Summary: This PR adds a new engine component (SpawnTracker) to bridge Supervisor sessions_spawn tool calls into the TaskQueue system, plus multiple UI polish improvements and better real-time orchestration updates.

Changes:

  • Introduced electron/engine/spawn-tracker.ts and wired it into engine bootstrap for tracking spawns → auto-create Project + Task and complete them on sub-agent lifecycle end.
  • Moved task/project/message event forwarding to an eager init step in electron/main/index.ts (after Gateway start) to avoid lazy-init races.
  • Adjusted Supervisor roster compilation to omit employee status to improve delegation reliability.
  • Added DeerAPI as a provider backend option in electron/utils/provider-registry.ts.
  • Expanded conversation/Chat UI to support an employeeAvatarImage across conversation list, welcome screen, and supervisor/employee chat.
  • Replaced the conversation item context menu with a Radix DropdownMenu to avoid overflow clipping.
  • Made the Supervisor orchestration right panel resizable and persisted its width in settings.
  • Improved chat scrolling behavior: instant on session switch, smooth for new messages; simplified ChatToolbar by removing the thinking toggle.
  • Added real-time project lifecycle handling in the activity and tasks stores via project:changed IPC events.
  • Removed CLAUDE.md (documentation consolidation into AGENTS.md).

Technical Notes: SpawnTracker listens to Gateway notification events (tool.call_started/tool.call_completed and lifecycle stream events), and TaskQueue emits task-changed/project-changed which are forwarded to the renderer as task:changed/project:changed.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 5 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

const args = resolveToolArgs(p);
if (!args) return;

const task = (args.task ?? args.message ?? '') as string;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:242
  • electron/engine/spawn-tracker.ts:409

Fix This in Augment

🤖 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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix This in Augment

🤖 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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix This in Augment

🤖 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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix This in Augment

🤖 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,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scrollTo({ behavior: 'instant' }) isn’t a standard ScrollBehavior value; depending on the runtime it may be ignored, which would break the intended “jump to bottom on session switch” behavior.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

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.

1 participant