Skip to content

feat(a2a): configurable agent launchers — process and versioned Pi RPC transports - #82503

Open
kidclone3 wants to merge 1 commit into
NousResearch:mainfrom
kidclone3:feat/a2a-configurable-agent-launchers
Open

feat(a2a): configurable agent launchers — process and versioned Pi RPC transports#82503
kidclone3 wants to merge 1 commit into
NousResearch:mainfrom
kidclone3:feat/a2a-configurable-agent-launchers

Conversation

@kidclone3

Copy link
Copy Markdown

Summary

Adds configurable external agent launchers to the A2A inbound server. A non-root served A2A route can now run a configured subprocess or a versioned Pi-compatible RPC worker — safely, with bounded output, process-tree reaping, cancellation, and exactly-once finalization — without changing A2A semantics or breaking existing Hermes routes.

Builds on the A2A platform plugin landed in #77109. Addresses gaps surfaced in #56435 (completion visibility), #78007 (timeout alignment), and #77526 (multi-turn continuity) by providing a first-class external execution path.

What it does

  • Process launcher (transport: process): executes one owned subprocess per turn with shell=False, minimal environment, explicit cwd, positive timeout, bounded stdout/stderr (4 MiB), and reply capped at 1 MiB. Supports text and JSON output, optional session-ID extraction, and three continuity modes (stateless, deterministic-key, opaque-session).
  • Versioned RPC launcher (transport: pi_rpc): maintains persistent workers per (agent_slug, context_id) using strict UTF-8 LF-delimited JSON frames. Two code-owned profiles — omp (requires ready, settles on agent_end) and feynman (no ready, settles on agent_settled). Blocking extension UI receives correlated cancellation; workers serialize turns, retain early frames, and evict on rejection/crash/timeout/malformed input.
  • Common exactly-once finalization: every launcher outcome — whether success, timeout, cancellation, crash, or idle expiry — returns through the existing A2A finalizer for persistence, audit, metrics, push delivery, and task-store writes.
  • Backward compatible: root/default requests remain the live Hermes gateway session; profile-only routes without a launcher preserve legacy behavior. Invalid external routes are omitted from cards/health without blocking root or other valid routes.

Changes

File Purpose
plugins/platforms/a2a/launchers.py Process launcher: spec parsing, argv expansion, subprocess dispatch, output parsing, session persistence
plugins/platforms/a2a/pi_rpc.py Versioned RPC transport: worker lifecycle, frame demux, profile dispatch, termination
plugins/platforms/a2a/adapter.py Route launcher extraction, LauncherManager integration, common finalization boundary
tests/plugins/test_a2a_launchers.py 29 tests: deterministic helper-process coverage for argv isolation, streams, parsing, failures, cancellation, environment policy, session persistence
tests/plugins/test_a2a_plugin.py Extended with launcher integration tests (108 total, 11 deselected)
website/docs/user-guide/messaging/a2a.md Operator docs: precedence, schemas, placeholders, environment, continuity, failure mapping
cli-config.yaml.example Annotated YAML examples for process and RPC launchers

Safety invariants

  • External prompts, peers, route slugs, task IDs, and context IDs remain data — never interpreted by a shell
  • External children receive a minimal explicit environment, not the gateway credentials
  • Timeout, cancellation, failure, and adapter disconnect terminate and reap the owned process tree
  • Every operation retains immutable agent, tenant, peer, task, context, and captured profile-home ownership
  • Completion, timeout, cancellation, crash, idle expiry, and disconnect races yield at most one visible terminal result

Related

… RPC transports

- add safe process launcher transport: shell=False, minimal env, bounded output, process-tree reaping
- add versioned Pi RPC transport: omp_17_2 (requires ready, agent_end) and feynman_0_3_11 (agent_settled)
- connect launcher cancellation, opaque session continuity, and exactly-once A2A finalization
- add deterministic JSONL worker tests (no real Pi/OMP/Feynman binaries required)
- document configuration precedence, schemas, placeholders, and failure mapping
@kidclone3
kidclone3 force-pushed the feat/a2a-configurable-agent-launchers branch from 6cef620 to 76f107b Compare August 9, 2026 13:46
@alt-glitch alt-glitch added type/feature New feature or request comp/plugins Plugin system and bundled plugins sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades P3 Low — cosmetic, nice to have labels Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants