@odradekk/vera-subagents
Subagent orchestration for Vera agent (explorer, librarian, thinker, worker)
Package details
Install @odradekk/vera-subagents from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@odradekk/vera-subagents- Package
@odradekk/vera-subagents- Version
0.2.0- Published
- May 5, 2026
- Downloads
- 65/mo · 8/wk
- Author
- odradekk
- License
- MIT
- Types
- extension
- Size
- 157.9 KB
- Dependencies
- 0 dependencies · 4 peers
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
vera-subagents
Purpose
Provide an in-process SDK-based subagent tool for Vera. The current version runs delegated work in an isolated in-memory Pi AgentSession, returns the final answer to the parent agent, and exposes execution details in the tool's expandable TUI view.
Registered tools
subagent— run one delegated task in an isolated SDK subagent session; supports foreground and background execution with expandable TUI detailssubagent_status— inspect queued, running, and recently completed background subagent jobssubagent_cancel— cancel one background subagent job or all active background jobs
Registered commands / UI
/subagents— show a Vera-style detailed status report for the subagent system, including registry discovery, runtime surface, and background jobs/subagents cancel <jobId|all>— cancel one background job or all active jobs, then show the updated detailed report- TUI session status entry
subagents— compact live indicator for queued/running/finished background jobs
YAML-defined subagents
Subagent definitions are loaded from:
~/.pi/agent/subagents/*.yaml- nearest
.pi/subagents/*.yamlwalking up from the current cwd
Supported YAML fields:
name— unique subagent name; duplicates are rejectedmodel— child model inprovider/modelformat; empty means inherit the current parent modeleffort— child thinking strength (off,minimal,low,medium,high,xhigh); empty means inherit the current parent thinking leveldescription— shown to the parent LLM so it knows when this subagent is appropriatesystem— fully replaces the subagent base system prompt when presentPromptorprompt— prepended before the delegated task texttools— built-in tool allowlist; empty means all built-in tools (read,bash,edit,write,grep,find,ls)skills— skill allowlist; empty means all discovered skills from the child session loadervisable— optional boolean; defaults totrue. Whenfalse, Vera does not see the definition in its subagent catalog and cannot call it through thesubagenttool, but Chimera discovery and execution still can
Example:
name: scout
model: anthropic/claude-sonnet-4-5
effort: medium
description: Fast repository reconnaissance for code lookup and evidence gathering
system: |
You are a focused reconnaissance subagent.
Gather evidence and answer concisely.
prompt: |
Prefer quick inspection over broad rewrites.
tools:
- read
- grep
- find
- ls
skills: []
visable: true
Current scope
- single subagent execution per tool call
- in-process SDK session, not subprocess execution
- named YAML-defined subagents or generic ad-hoc delegation
background: trueon the tool call to let a child keep running asynchronously- completion notification injected back into the main session when a background job finishes
- cancellation for queued/running background jobs
/subagentscommand and TUI status indicator for quick inspection- custom expandable TUI renderer for execution details
Non-goals
- parallel or chained subagents
- session focus switching into a fully separate child TUI
- project/user agent markdown discovery
- memory writeback from child sessions
Design notes
- Child sessions use no extension, prompt-template, or theme discovery.
- YAML definitions specialize the child via model selection, thinking effort, system prompt replacement, prompt prefixing, built-in tool allowlists, skill allowlists, and optional Vera-side visibility control through
visable. - The child session uses
SessionManager.inMemory()and does not persist its own conversation. - The parent tool stores a compact execution timeline in
detailsso the current TUI can render it in collapsed and expanded states.
Smoke
npm run smoke- from project root:
node agent/scripts/smoke-all.mjs
Debugging
- Verify the tool is registered from
./packages/vera-subagents. - Place a simple YAML file in
~/.pi/agent/subagents/and reload. - Run
subagentwithagent: "name"and a bounded task. - Use
background: truewhen the child should continue asynchronously while the main agent proceeds. - Run
subagent_statusfor a compact tool response, or/subagentsfor a fuller Vera-style system status report. - Run
subagent_cancelor/subagents cancel <jobId|all>to stop background work that is no longer wanted. - Watch the
subagentsTUI status entry for a compact live job indicator. - Expand the tool result or background notification in the TUI to inspect task, cwd, selected tools, selected skills, timeline, and final output.
- If execution fails, inspect
details.errorand YAML parse/duplicate warnings first.
Loaded through agent/settings.json as ./packages/vera-subagents.