Skip to content

feat: add visual A2A delegation host tools#9

Merged
Beckers26 merged 6 commits into
mainfrom
feat/issue-5-delegation-subagents
Jul 8, 2026
Merged

feat: add visual A2A delegation host tools#9
Beckers26 merged 6 commits into
mainfrom
feat/issue-5-delegation-subagents

Conversation

@Beckers26

@Beckers26 Beckers26 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add host-owned A2A delegation primitives, MCP delegate_to_agent server, and run-scoped delegation event bus
  • overlay subagent delegation events into AG-UI/SSE through a new subagentstream bridge and SubagentBus option
  • support runtime-backed MCP server injection from RuntimeServiceRef metadata and include it in profile fingerprinting
  • harden delegation policies, artifact constraints, event bus fanout, mux cancellation, and update docs/examples

Verification

  • go test ./pkg/hosttools/a2adelegation ./pkg/bridges/subagentstream ./pkg/bridges/sse ./pkg/clients/a2a ./pkg/bridges/a2a
  • go test -race ./pkg/hosttools/a2adelegation ./pkg/bridges/subagentstream
  • go test ./...
  • git diff --check

🤖 Generated with Claude Code

Closes #5

cbuthim-art and others added 6 commits July 7, 2026 12:28
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Issue #5 requires a narrow product contract: the parent agent receives only the final MCP tool result while the host UI observes remote subagent progress on the same SSE/AG-UI stream. This hardens the run-scoped MCP sidecar, closes dangling subagent lifecycles, and adds a subprocess-only runtime secret channel so bearer tokens can be injected without entering public runtime refs or profile materialization.

Constraint: agent-adaptor remains a pure SDK; delegation stays in hosttools/bridges/runtime plumbing, not concrete adapters or a second execution path

Constraint: Runtime-backed MCP auth must work for local Codex and Claude parent agents without putting token values in Metadata, RuntimeServices, profile payloads, or runtime JSON

Rejected: Put bearer token values in RuntimeServiceRef.Metadata | leaks through runtime events, run results, and PAPERCLIP_RUNTIME_SERVICES_JSON

Rejected: Leave dangling subagent terminal handling to UI cleanup | parent terminal/cancel paths need a deterministic protocol event

Confidence: high

Scope-risk: moderate

Directive: Keep RuntimeServiceRef.SecretEnv subprocess-only; do not copy it into public refs/reports/profile payloads or fingerprints

Tested: go test -count=1 ./...

Tested: go test -race -count=1 ./pkg/hosttools/a2adelegation ./pkg/bridges/subagentstream ./pkg/bridges/sse ./internal/adapterutil

Tested: go vet ./...

Tested: git diff --check

Tested: go run ./.omx/tmp/delegation_sse_e2e --agent claude --timeout 180s

Tested: go run ./.omx/tmp/delegation_sse_e2e --agent codex --timeout 180s

Not-tested: SSE reconnect/replay and high-concurrency multi-delegation soak
@Beckers26 Beckers26 merged commit 7299972 into main Jul 8, 2026
1 check passed
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.

Workstream: A2A/AGUI Delegation Tools as Visual Subagents

2 participants