Repository navigation
Description
Summary
Review the Activity feature (the Subagents and Background tasks surfaces, the dock, and targeted Stop) for structured chats and provider terminals across Claude, Codex, OpenCode and Cursor. Compare each provider adapter with that provider's current official docs, fix what drifted, and file follow-ups for improvements.
A first pass on 2026-10-19 is recorded below. It checked the official docs and the locally installed CLIs: Claude Code 2.1.303, Codex 0.163.0 (app-server schema generated locally), OpenCode 2.0.32, and Cursor Agent 2026.10.16. Line numbers are at 0b98d0a4 (v0.10.1).
Scope
- Server:
apps/server/src/activity/,apps/server/src/provider/{claude,codex,opencode,cursor}/, andapps/server/src/provider_terminal/. - Client:
packages/client-runtime/src/state/activity*.tsandapps/web/src/components/activity/. - Docs:
docs/architecture/activity-observation.md(the provider matrix at:441-444),docs/providers/*.md, anddocs/user/workspace-ui.md("Activity and targeted Stop"). - UI follow-up already filed: Activity dock: always visible, opens the Activity panel on click #143 (dock always visible, opens the panel on click).
Findings from the first pass
Claude Code
-
The activity probe trusts
--help. Hook activity is enabled only when--helplists--include-hook-eventsand--forward-subagent-text(docs/providers/claude.md, "Activity observation"). The CLI reference now warns that "claude --helpdoes not list every flag, so a flag's absence from--helpdoes not mean it is unavailable." Version 2.1.303 still lists both, but a help-text change would silently turn Activity off.- Consider documented minimum versions instead:
--forward-subagent-textneeds v2.1.211, and forwarding at every nesting depth needs v2.1.219. system/initcapabilities(v2.1.205+) is the documented feature-detection channel, but it lists no capability for these flags today.
- Consider documented minimum versions instead:
-
Claude background work is not shown. Claude Code now reports:
- background Bash commands and Monitor watches as tasks with
task_type: "local_bash"; - background subagents with
is_backgrounded; - the full live set in
system/background_tasks_changed(v2.1.203+); task_updatedwithpending,running,completed,failedorkilled;task_notificationwithcompleted,failedorstopped.
BiBCode reads these only to track turn follow-ups (
apps/server/src/provider/claude/runtime.rs:1477-1510). Activity declares "No background-work capability" for Claude, and the controller fails closed on anytask_typeother thanlocal_agentorremote_agent. Candidate: a Claude Background tasks section, with Stop through the existingstop_taskpath. - background Bash commands and Monitor watches as tasks with
-
Lineage and repeated runs.
parent_task_idnames the subagent that launched a task, andspawn_depthgives the nesting level (Agent SDK v0.3.292+ and v0.3.238+).run_idseparates runs of one task. A resumed subagent keeps itstask_id, gets a newrun_idand a newtool_use_id, and its messages keep the originalparent_tool_use_id. The docs say to match messages to task events byagent_id, not by tool-use IDs.- BiBCode reads none of
run_id,parent_task_idorspawn_depth. It correlates on thetool_use_idchain plus hooks. - Check how a resumed subagent appears and whether it stays controllable. Consider replacing the nested-reparenting fallback with the documented
parent_task_id.
-
Ambient tasks. Tasks with
ambient: true"aren't part of the session's work" and should be left out of activity indicators. Only the follow-up tracker filters them today. Confirm the Activity projection never shows them. -
Forked skills run like subagents. A skill started with the Skill tool reports
parent_tool_use_idset to the Skill call. A/skillpassed as the prompt uses aforked-command-prefix and arrives after it finishes. Correlation recognises only Agent and legacy Task invocations. Decide whether forked skills should appear, and how. -
Agent teams. Hook
agent_idalso identifies in-process teammates. Tasks launched by a teammate have noparent_task_id. New hook events includeTeammateIdle,TaskCreated,TaskCompletedandPostToolBatch. Make sure teammates are not misreported as subagents, and decide whether to show them.
Codex (app-server 0.163.0)
- Every method BiBCode calls exists in the 0.163 schema. However,
thread/backgroundTerminals/listand thesubAgentActivityitem appear only in the experimental schema (generate-json-schema --experimental). Confirm BiBCode always negotiates the experimental API, and that Activity degrades truthfully if a release drops them. - New in 0.163 (experimental):
thread/backgroundTerminals/terminateandthread/backgroundTerminals/clean. Activity offers no Stop for Codex background terminals today, so this is a candidate for targeted Stop. Also reviewthread/items/list,thread/items/readandthread/loaded/listfor recovery. docs/providers/codex.mdnotes that 0.146 omitted spawned children fromthread/list. Recheck with 0.163, sincethread/listnow filters by source and cwd.
OpenCode (2.0.32)
-
The endpoints BiBCode uses are documented on the server page:
GET /session/:id/children;GET /session/status;GETandPOST /session/:id/message;POST /session/:id/abort;GET /event.
The page doesn't describe OpenCode 2 changes, so verify them against the OpenAPI spec (
/doc) of the installed 2.0.x. The matrix also says the terminal path skips later child, status and message failures without downgrading itsfullclaim. Confirm that is intended.
Cursor (Agent 2026.10.16)
-
Activity is "Unsupported in v2" for Cursor (
activity-observation.md:444). Cursor has since added two things:- The ACP server sends a
cursor/tasknotification on subagent task completion, withdescription,prompt,subagentType, an optionalagentIdanddurationMs. - CLI subagents can run in the background (
is_background), writing their state under~/.cursor/subagents/.
BiBCode handles
cursor/ask_question,cursor/create_planandcursor/update_todos, but notcursor/task(apps/server/src/provider/cursor/runtime.rs). Candidate: Cursor subagents in structured chat, with completion-only records to start. Provider terminals stay unsupported until Cursor documents a live signal. - The ACP server sends a
Cross-cutting (from activity-observation.md)
- Terminal-state monotonicity differs between the Codex tracker, the repository and the client reducer. The client can keep showing a terminal summary until a later snapshot replaces it. Decide whether to align them.
- Teardown differs: the Claude terminal observer marks active records
interrupted, while Codex and OpenCode observers rely on cancellation and startup cleanup. Check that the UI shows the same thing for each.
Deliverables
- A provider × {chat, terminal} table of the signals used, the doc each relies on, the minimum version, and the status (current, drifted or unused). Store it in
docs/architecture/activity-observation.md, replacing the version-free matrix. - Each finding above confirmed or rejected with evidence: a test, a captured fixture, or a doc quote.
- One follow-up issue per confirmed change, each with focused tests, ranked by user impact.
- Any probe or contract fix that is small and safe (finding 1) done here, with tests.
-
docs/providers/*.mdanddocs/user/workspace-ui.mdupdated, and thedocs/testing/runbooks reviewed.
Validation
- Capture real stream-json, App Server and ACP fixtures from the versions above, and replay them in the adapters' tests: background Bash and Monitor, a resumed subagent, a forked skill, a Codex background terminal, and a Cursor subagent.
- Run
cargo fmt --all --check, Clippy with warnings denied, the affected Rust tests,vp checkandvp run typecheck. - Profiler coverage: any new provider request is registered and, if it waits on the provider, added to
is_long_running. Activity payloads stay out of profiler records.
References
- Claude Code: CLI reference, hooks, headless / Follow subagent messages, Agent SDK TypeScript reference (
SDKTaskStartedMessage,SDKTaskUpdatedMessage,SDKTaskNotificationMessage,SDKBackgroundTasksChangedMessage) - Codex: app-server README;
codex app-server generate-json-schema --experimental(0.163.0) - OpenCode: server API
- Cursor: CLI ACP, subagents
Activity
mubeda commentedon Oct 22, 2026
Version refresh and one more Cursor drift, from a provider-docs pass on 2026-10-22 (outside Activity, so not ticking any finding above):
@opencode/cli); 2.1.2 still serves every/api/*endpoint the adapter callsWhat is new:
cursor/generate_imageis now documented in CLI ACP as a fire-and-forget notification besidecursor/task(toolCallId,description,filePath?,referenceImagePaths?; outcomegeneratedwithfilePathand optionalimageData,rejected, orcancelled).apps/server/src/provider/cursor/handlescursor/ask_question,cursor/create_planandcursor/update_todosonly, so a generated image never appears in the chat. Same treatment as finding 11: a completion-only record to start.merge: v0.12.0 issue batch, Pipelines and sidebar (#181)