Repository navigation
feat(daemon): choose agui or a2a per workspace and show it in the tui - #1690
Conversation
|
@infer can you finalise this PR and make it ready for a review? |
|
Model: Todos
Pull Request✅ Infer Result: SuccessPR #1690 is finalized and marked ready for review. The tree is clean and everything is pushed. What was finishedThe PR's remaining-in-progress list is now done:
Validation
One thing I did not verify: the session-teleport example's actual k3d cluster run with Model: Tokens: 21,097,349 in · 74,254 out · 21,171,603 total (115 requests) Tool calls: 145 total · 100% success rate TracesStatsTriggered by edenreich · Infer Action · OSS |
The daemon chat TUI resolves each workspace's peer protocol from the config the local daemon shares, the workspaces picker tags every row with its protocol, the status bar indicator appends it where the session runs and to its teleport target, and the teleport progress line names the protocol it heads out over.
…icks The Daemon Binding Protocol reference gains the /a2a peer endpoint (card, message/send, message/stream), docs/daemon.md documents the protocol workspace option and the protocol in the workspaces listing, status bar and picker, and the session-teleport example shows how to run its workspaces over a2a.
…a2a context The peer client and the daemon's /a2a route hand-rolled their own A2A envelopes in the agent context, mixing 1.0 roles with 0.3 message, part, task and card shapes. The wire helpers now live in the a2a context and are built from the ADK types, with SendMessage and SendStreamingMessage as the methods, the ack echoing the exchange's contextId and a 1.0 agent card. A retry of a teleport whose saga was still unwinding was refused as already running, which made the e2e round trips fail back to back. The retry now waits for the earlier run and no-ops through the precondition. Also: a WorkspaceProtocol domain type instead of bare strings, placement labels for the protocol suffix the TUI shows, the daemon thread reading protocols off its config, one SSE framer and one frame bound.
|
🎉 This PR is included in version 0.243.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Resolves #1668
Summary
A workspace entry in daemon.yaml now chooses the machine-to-machine protocol its daemon talks to its peers over:
protocol: agui(the default, the AG-UI WebSocket binding) orprotocol: a2a(A2A JSON-RPC). The teleport saga, the remote-session relay and the teleport home all speak the same daemon-to-daemon frame vocabulary over whichever of the two a workspace picks, and a workspace that cannot serve its chosen protocol fails during the teleport's provisioning stage, before anything is created.Changes
WorkspaceProtocol(agui, a2a),WorkspaceEntry.Protocol,EffectiveProtocol()(empty is agui) and validation alongside the existing kind and mode checks, with table-driven tests.Endpoint.ProtocolandWorkspaceStatus.Protocol, so every workspace implementation reports what it picked in its endpoint and its probe.PeerConn, the connection contract the teleports and relays speak over (a superset of the AG-UI WebSocket conn's peer-facing methods), andPeerDialer.Dialdispatching on the endpoint's protocol: AG-UI WebSocket as before, A2A JSON-RPC for a2a workspaces.message/sendPOST that routes by the exchange'scontextId. A daemon that serves nothing over a2a fails the dial, so a workspace that cannot serve its protocol fails before anything is created./a2apeer endpoint, mounted as a binding route in cmd/daemon/daemon.go next to/artifacts/, so every daemon that serves the binding answers it with no extra wiring: an agent card on GET,message/streamexchanges answered as server-sent events that announce the host first and carry one frame per event, andmessage/sendputting one frame on the exchange thecontextIdnames. The binding's token or client certificates authenticate it exactly as the WebSocket route does.PeerConninstead of the concrete AG-UI conn, so the same stages, checks and errors ride both protocols.PROTOCOLcolumn ininfer daemon workspaces./workspacespicker tags every row with its protocol, the status bar indicator shows it next to the workspace name and its teleport target, and the teleport progress line names the protocol the session heads out over.protocoloption and what the workspaces listing, the status bar and the picker show, the Daemon Binding Protocol reference gains an "A2A peer endpoint" section, and examples/session-teleport shows how to run its workspaces over a2a.Testing
go test ./...passes, with two runner notes:config TestCredentialsPreferTheEnvironmentOverTheAuthFileis the known unrelated failure of this runner (it reads a real auth file present here, it passes where no such auth file exists and it is untouched by this change), andinternal/tools TestHeadlessSubagentJob_KeepAliveTurnsfailed once under full-suite load and passes in isolation.go test -tags e2e ./tests/e2ecovers the teleport suite: the saga, relayed turn and direct resume over agui and over a2a, failures leaving the session at home, and the workspaces reachability listing.task precommit:rungates pass on every commit (go mod tidy, mocks, gofmt, golangci-lint, markdownlint).Docs ticket: inference-gateway/docs#1083