Add read-only agent observe skill - #173
Conversation
| [project] | ||
| name = "agent-observe" | ||
| version = "0.1.0" | ||
| description = "Read-only Prime Agent session observation skill" |
There was a problem hiding this comment.
🟠 High agent-observe/pyproject.toml:1
The pyproject.toml is missing the [build-system] section required for editable installation. When uv pip install --editable falls back to setuptools (which happens without an explicit build-system), the src/agent_observe/ layout may not be discovered correctly, causing the skill to fail to install and be silently unavailable at runtime.
+[build-system]
+requires = ["hatchling"]
+build-backend = "hatchling.build"
+
+[tool.hatch.build.targets.wheel]
+packages = ["src/agent_observe"]
+
[project]
name = "agent-observe"
version = "0.1.0"
description = "Read-only Prime Agent session observation skill"
requires-python = ">=3.10"
[tool.prime_agent.skill]
import = "agent_observe"🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @packages/coding-agent/skills/agent-observe/pyproject.toml around lines 1-4:
The `pyproject.toml` is missing the `[build-system]` section required for editable installation. When `uv pip install --editable` falls back to setuptools (which happens without an explicit build-system), the `src/agent_observe/` layout may not be discovered correctly, causing the skill to fail to install and be silently unavailable at runtime.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e7bba05. Configure here.
| return this.addRuntime(runtime, command.name); | ||
| const state = await this.addRuntime(runtime, command.name); | ||
| stateRef = state; | ||
| return state; |
There was a problem hiding this comment.
Observe stateRef set too late
Medium Severity
The daemon passes an agentObserveController into session creation before the corresponding ActiveSessionState exists, and only assigns stateRef after addRuntime finishes. Any agent_observe host call during that window (including background IPython prewarm or bindExtensions) hits requireCurrentState and errors with “Agent observe state is not ready for this session yet”.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit e7bba05. Configure here.
|
Superseded by #207, which combines read-only agent observation with safe daemon-backed agent messaging into one user orchestrator PR. |
|
Closing in favor of #207, which combines this read-only observe work with daemon-backed messaging and orchestration heartbeat support. |
…ormat in AGENTS.md


Summary
agent-observePython skill for read-only observation of active daemon sessionslist_agents,get_agent, and boundedrecent_messagesSafety
Validation
npx vitest --run packages/coding-agent/test/agent-observe.test.ts packages/coding-agent/test/suite/agent-session-observe.test.ts packages/coding-agent/test/kernel-agent-observe-skill.test.ts packages/coding-agent/test/builtin-skills.test.ts packages/coding-agent/test/daemon-mode.test.tsnpx tsgo --noEmit --pretty falsenpm run checknpm run test -- --runNote
Add read-only agent-observe skill for inspecting active daemon sessions
agent_observe) exposinglist_agents,get_agent, andrecent_messagesfunctions that route through the host bridge to query active daemon sessions.agent-observe.ts, including input validation, limit/maxChars clamping (1–50 and 80–2000), and message preview construction that exposes tool call names but not arguments.AgentObserveControllerintoAgentSessionandAgentDaemonso both top-level sessions and RLM subagents can serve observe requests; the skill is hidden from the model when no controller is present.Macroscope summarized e7bba05.
Note
Medium Risk
Opens a new read-only channel for agents to read truncated content from other daemon sessions in the same process; mitigated by no mutation APIs and bounded previews, but still a cross-session information leak surface for orchestration.
Overview
Introduces a read-only cross-session observation path for agents running under the local daemon. A new bundled
agent-observePython skill (agent_observe.list_agents,get_agent,recent_messages) forwards to TypeScript host handlers; the daemon implementsAgentObserveControllerover all live runtimes (top-level and RLM subagents).AgentSessionaccepts an optionalagentObserveController, wiresagent_observe.*kernel host requests, and hides the skill from the system prompt when no controller is configured (local-only sessions). Message previews are bounded (limit1–50,max_chars80–2000) and assistant tool previews expose names only, not arguments.Tests cover preview helpers, session routing, kernel bridge, bundled skill discovery, and controller forwarding through session services.
Reviewed by Cursor Bugbot for commit e7bba05. Bugbot is set up for automated code reviews on this repo. Configure here.