Skip to content

feat(orchestrator): finalize system agent system prompt and tool policy#1149

Merged
geoffjay merged 12 commits intoissue-1139from
issue-1142
Apr 17, 2026
Merged

feat(orchestrator): finalize system agent system prompt and tool policy#1149
geoffjay merged 12 commits intoissue-1139from
issue-1142

Conversation

@geoffjay
Copy link
Copy Markdown
Owner

Author the comprehensive system prompt and tool policy for the agentd-system built-in agent.

Changes

  • System prompt covers all required content:
    • Service inventory table (orchestrator, core, communicate, memory, index, notify, wrap) with dev/prod ports
    • Agent lifecycle (create → spawn → connect → message → terminate) with status/activity state definitions
    • Built-in agent concept explained
    • Common CLI operations (agent, agent communicate, agent memory)
    • Communicate room system (REST endpoints, broadcast semantics)
    • Memory service overview
    • Diagnostics guide for common issues (agent stuck, spawn failure, WebSocket not connecting, workflow not firing)
    • Metrics and observability (Prometheus endpoints, key metrics)
    • Tool policy self-documentation (what is allowed/denied and why)
  • Version/build info prepended dynamically via env!("CARGO_PKG_VERSION") — agent can report it
  • Tool policy AllowList entries documented with rationale; aligned with prompt documentation
  • Prompt targets < 6 000 tokens

Closes #1142

- system_agent_prompt covers: service inventory with ports, agent lifecycle,
  status/activity states, built-in agent concept, CLI operations, communicate
  rooms, memory service, diagnostics guide, metrics/observability, tool policy
- version prepended dynamically via env!(CARGO_PKG_VERSION) at build time
- tool policy documented with rationale for each allowed category
- AllowList entries align with prompt documentation (update both in tandem)
- prompt targets <6000 tokens
@geoffjay geoffjay linked an issue Apr 17, 2026 that may be closed by this pull request
7 tasks
geoffjay and others added 5 commits April 16, 2026 21:21
- Add 'agent system-agents list' — fetch from GET /system-agents
- Add 'agent system-agents get <id|name>' — resolve by UUID or name
- Add 'agent system-agents message <id> <text>' — send prompt to system agent
- Add 'agent system-agents status' — compact table of name/status/model/activity
- All subcommands support --json output mode
- Add --include-builtin flag to 'agent list' (passes ?include_builtin=true)
- OrchestratorClient::list_agents_filtered() added for include_builtin support
- system_agents command registered in Commands enum and dispatched via orchestrator URL
- AgentsPage renders SystemAgentList above AgentList
- SystemAgentList fetches from GET /system-agents with 10s auto-refresh
- Shows name (with 'system' badge), status, model, rooms columns
- Collapsible panel with refresh button; distinguishes loading/error/empty states
- Clicking a row navigates to /agents/{id} detail page (same as user agents)
- No create/delete actions exposed (built-in agents are not user-managed)
- useSystemAgents hook follows same pattern as useAgents
- OrchestratorClient.listSystemAgents() added (GET /system-agents)
- AgentConfig TS interface gains rooms?: string[]
Adds 10 HTTP integration tests covering the full system-agent feature
surface via tower::ServiceExt::oneshot (no real TCP). Includes a
NullBackend to avoid external dependencies.

Also fixes terminate_agent handler to return 403 Forbidden (not 500)
when attempting to delete a built-in system agent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
test(orchestrator): integration tests for system agent lifecycle
feat(ui): add system agents section to agents page
feat(cli): add system-agents subcommand
@geoffjay geoffjay merged commit b59a00b into issue-1139 Apr 17, 2026
@geoffjay geoffjay deleted the issue-1142 branch April 17, 2026 19:53
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.

Write system prompt and tool policy for the agentd-system agent

1 participant