Skip to content

feat: add debug-agent skill for admin observability#165

Merged
baudbot-agent merged 4 commits intomainfrom
feat/debug-agent
Feb 24, 2026
Merged

feat: add debug-agent skill for admin observability#165
baudbot-agent merged 4 commits intomainfrom
feat/debug-agent

Conversation

@baudbot-agent
Copy link
Collaborator

Summary

Moves the dashboard extension from pi/extensions/ (auto-loaded by all sessions) into a dedicated debug-agent skill that's only loaded when an admin attaches to the system.

This gives baudbot three distinct agent types:

Agent Role Lifecycle
control-agent Slack routing, task delegation Always-on (systemd)
sentry-agent Incident triage Always-on (tmux)
debug-agent Admin observability On-demand (SSH attach)

What the debug-agent provides

  • Dashboard widget above the editor showing system health at a glance
  • Activity feed tailing the control-agent's session JSONL in real-time
  • Quick reference for logs, sockets, tmux sessions, deploy paths
  • SKILL.md with guidance on what the debug agent can/should do

Launch

pi --skill ~/.pi/agent/skills/debug-agent \
   -e ~/.pi/agent/skills/debug-agent/debug-dashboard.ts \
   "/skill:debug-agent"

Changes

  • pi/extensions/dashboard.tspi/skills/debug-agent/debug-dashboard.ts (moved out of auto-discovery)
  • Added pi/skills/debug-agent/SKILL.md
  • Dashboard now includes activity feed (tails control-agent JSONL via fs.watch)

Baudbot added 3 commits February 24, 2026 10:56
Renders a persistent widget above the editor showing:
- Pi version (with update indicator if behind latest npm)
- Slack bridge status (live HTTP probe)
- Session health (control-agent, sentry-agent, dev-agents)
- Todo stats (active/done/total)
- Worktree count
- Current model and uptime

Refreshes every 30s with zero LLM token cost. Admin can attach
to the running baudbot tmux session and see health without
sending any messages.

Also adds /dashboard command for immediate refresh.
message_start only fires for user/assistant/toolResult messages, not
custom messages from pi.sendMessage(). Slack messages arrive as
session-message custom type and were being missed.

before_agent_start fires for ALL inbound messages that trigger an
agent turn, including custom messages from the bridge/heartbeat.

Also improved the event summary to show the actual message body
excerpt alongside the sender.
Moves the dashboard extension from pi/extensions/ (auto-loaded by all
sessions) into a dedicated debug-agent skill that's only loaded when
an admin attaches to the system.

The debug-agent provides:
- Live dashboard widget showing system health at a glance
- Activity feed tailing the control-agent's session JSONL
- Quick reference for logs, sockets, tmux sessions, deploy paths

Launch via:
  pi --skill ~/.pi/agent/skills/debug-agent \
     -e ~/.pi/agent/skills/debug-agent/debug-dashboard.ts \
     "/skill:debug-agent"

This gives baudbot three agent types:
- control-agent: always-on, handles Slack/routing/delegation
- sentry-agent: incident triage from Sentry alerts
- debug-agent: admin observability when attached via SSH
@greptile-apps
Copy link

greptile-apps bot commented Feb 24, 2026

Greptile Summary

Moves the dashboard extension from pi/extensions/ (auto-loaded by all sessions) into a dedicated debug-agent skill that's only loaded when an admin attaches to the system. This provides clear separation of concerns between the three agent types: control-agent (Slack routing), sentry-agent (incident triage), and debug-agent (admin observability).

Key changes:

  • Dashboard extension relocated from auto-discovery path to pi/skills/debug-agent/debug-dashboard.ts
  • Added comprehensive SKILL.md defining debug-agent persona and capabilities
  • Enhanced dashboard with activity feed that tails control-agent's JSONL session file
  • Dashboard shows: system health, versions, bridge status, sessions, todos, worktrees, heartbeat, and live control-agent activity

The implementation is solid with proper error handling, file watching with polling fallback, and efficient ring buffer management for the activity feed.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-structured and follow the project's architectural patterns. The code is defensive with proper error handling, uses appropriate abstractions, and maintains clean separation of concerns. The move from auto-loaded extension to skill-based loading improves the system's modularity without breaking existing functionality.
  • No files require special attention

Important Files Changed

Filename Overview
pi/skills/debug-agent/SKILL.md Documentation file defining debug-agent persona and usage instructions; clear and well-structured
pi/skills/debug-agent/debug-dashboard.ts Dashboard extension moved from auto-load location to skill-specific; includes activity feed and system health monitoring

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Admin SSH] -->|baudbot session attach| B[debug-agent]
    B --> C[debug-dashboard.ts]
    C -->|displays| D[System Health Widget]
    C -->|tails| E[control-agent JSONL]
    
    F[Slack] --> G[slack-bridge]
    G --> H[control-agent]
    H -->|delegates| I[dev-agent]
    H -->|manages| J[sentry-agent]
    
    D -->|shows| K[Versions, Bridge Status]
    D -->|shows| L[Sessions, Todos, Worktrees]
    D -->|shows| M[Heartbeat, Activity Feed]
    
    E -->|parses| N[Tool Calls]
    E -->|parses| O[Messages]
    E -->|parses| P[Incoming Events]
    
    style B fill:#e1f5ff
    style H fill:#fff4e1
    style I fill:#f0f0f0
    style J fill:#f0f0f0
    style D fill:#e8f5e9
Loading

Last reviewed commit: a7f97c4

The broker bridge integration test could fail with ENOTEMPTY when
rmSync raced with child processes still writing to temp dirs. Add a
small delay after SIGTERM and use maxRetries/retryDelay on rmSync.
@baudbot-agent baudbot-agent merged commit 29539b1 into main Feb 24, 2026
9 checks passed
@baudbot-agent baudbot-agent deleted the feat/debug-agent branch February 24, 2026 19:00
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