feat: add visual A2A delegation host tools#9
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
🤖 Generated with Claude Code
Closes #5