3.3 KiB
3.3 KiB
CONTINUITY.md — Exec Events E2E Fix
Goal
Make exec events (Codex, Claude, etc.) visible in Crabwalk UI as distinct "EXEC" nodes — not "agent" or "chat".
Success Criteria
- When Codex runs, Crabwalk shows an "EXEC" labeled node (not "AGENT")
- Exec events flow: Gateway emits → WebSocket broadcasts → Crabwalk receives → UI renders
- All changes have test coverage
- Clean git history with meaningful commits
Constraints/Assumptions
- Gateway code:
/home/clawdbot/dev/clawdbot-exec-events/ - Crabwalk code:
/home/clawdbot/apps/crabwalk/ - Config already has
hooks.exec.emitEvents: trueand whitelist - Must use test-driven approach
Key Decisions
- Rolled back cowboy changes (2026-01-27)
- Starting fresh with proper beads model
State
Done
- Rolled back uncommitted changes
- Created CONTINUITY.md
- Bead 1: Audit — Full E2E flow audit complete (see AUDIT_REPORT.md)
- Bead 2: Add top-level runId — Commit
e49b41503(2026-01-27)- Added
runId?: stringto ExecEventBase type - Updated all 3 emitExecEvent calls to include
runId: execEventsState.context?.runId - Build passes
- Added
Now
- Test & deploy Crabwalk graph layout fixes
Next
- Push to GitHub (failed earlier due to token permissions)
- Add test coverage for top-level runId
Crabwalk Graph Layout Fixes (Bead 3) — 2026-01-28
Problems Fixed:
- Subagents spawned from top "lobster" node → Now connect to parent session
- Exec nodes appeared unattached → Connect to their session via sessionKey
- Subagents missing timestamps → Now display relative time ("2m ago")
- Session identification → Subagent sessions now styled distinctly with cyan glow
Changes Made:
Gateway (/home/clawdbot/dev/clawdbot-exec-events):
src/gateway/session-utils.types.ts: AddedspawnedBy?: stringandcreatedAt?: numbertoGatewaySessionRowsrc/gateway/session-utils.ts: IncludespawnedByin session list response
Crabwalk (/home/clawdbot/apps/crabwalk):
src/integrations/clawdbot/protocol.ts: AddedspawnedBy?: stringtoSessionInfoandMonitorSessionsrc/integrations/clawdbot/parser.ts: Pass throughspawnedByinsessionInfoToMonitorsrc/components/monitor/ActionGraph.tsx: UsespawnedByto connect subagent sessions to parent (not crab origin)src/components/monitor/SessionNode.tsx: Added timestamp display, subagent visual styling with cyan glow
Builds Verified: Both Gateway and Crabwalk compile successfully
Open Questions (RESOLVED)
- ✅ CONFIRMED: Exec events ARE being emitted (Line 406-408, server.impl.ts)
- ✅ CONFIRMED: Crabwalk HAS distinct ExecNode.tsx component (not reusing AgentNode)
- ✅ CONFIRMED: runId IS required for session linking but optional in Gateway
- ✅ ROOT CAUSE: Gateway sends
context.runId(nested, optional), Crabwalk expectsexec.runId(top-level, required)
Working Set
- Gateway exec emission:
src/agents/bash-tools.exec.ts - Gateway broadcast:
src/gateway/server.impl.ts - Exec event types:
src/infra/exec-events.ts - Crabwalk parser:
/home/clawdbot/apps/crabwalk/src/integrations/clawdbot/parser.ts - Crabwalk UI:
/home/clawdbot/apps/crabwalk/src/components/monitor/ExecNode.tsx - Crabwalk graph:
/home/clawdbot/apps/crabwalk/src/components/monitor/ActionGraph.tsx