Repository navigation
[AI-1762] §2.7 A2 cli mirror: report runtime_transport on AgentRegistered - #631
Conversation
…ered The daemon half of the validated runtime_transport fact (server side merged in kcap-server#1567). The daemon now reports the transport each hosted agent launched on so the server can validate its own launch decision. - AgentRegistered (Cli.Core Models) gains a trailing nullable RuntimeTransport — additive, wire-safe both skew directions, source-gen serialized. - AgentInstance.RuntimeTransport: "app-server" iff the runtime is the codex app-server runtime, else "pty" (PTY codex, PTY claude, all ACP vendors). Derived from the runtime instance so initial + reconnect re-registration agree. - ServerConnection.AgentRegisteredAsync + both AgentOrchestrator call sites (initial RegisterAgentAsync and reconnect ReRegisterAgentsAsync) thread agent.RuntimeTransport. Server-first and safe now; dormant until B6 enables v2 advertisement (all launches report "pty" until then). Wire values "pty"/"app-server" are the cross-repo contract. Tests: app-server runtime -> "app-server"; a PTY codex runtime -> "pty" end-to-end. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR Summary by QodoReport runtime transport on AgentRegistered from CLI daemon
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
1.
|
Replace the type-switch on CodexAppServerHostedAgentRuntime in the shared AgentOrchestrator with a polymorphic IHostedAgentRuntime.RuntimeTransport member: "pty" is the universal default on the interface, and only the Codex app-server runtime overrides it to app-server. Keeps vendor-specific logic under Harness/Codex/ and out of Services/. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Addressed the vendor-isolation finding in |
What & why
AI-1762 §2.7 A2 cli mirror — the daemon half of the validated
runtime_transportfact. The server side merged in kcap-server#1567: the server derives the transport it expects a launch to run on and validates the daemon's reported value onAgentRegistered. This PR makes the daemon actually report that value.How
AgentRegistered(Cli.CoreModels.cs) gains a trailingstring? RuntimeTransport = null— additive name-bound field, wire-safe both skew directions, picked up automatically by the source-genCapacitorJsonContext.AgentInstancegains a computedRuntimeTransportproperty:Runtime is CodexAppServerHostedAgentRuntime ? "app-server" : "pty"(reusingCodexTransportDecision.AppServer/.Pty). The codex app-server runtime is the only app-server transport; every other runtime — PTY codex, PTY claude, and all ACP vendors — ispty. Deriving from the runtime instance means initial registration and every reconnect re-registration report the same value (the same instance survives a reconnect).ServerConnection.AgentRegisteredAsyncgains a trailingruntimeTransportarg, threaded from both call sites inAgentOrchestrator(initialRegisterAgentAsyncand reconnectReRegisterAgentsAsync) asagent.RuntimeTransport.Scope
Server-first: kcap-server#1567 is merged, so this is safe to land now. It's dormant in practice until B6 turns on the v2 advertisement (no app-server launches happen before that — v1 app-server is retired and v2 isn't advertised yet), so every launch reports
ptytoday;app-serverstarts flowing when B6 lands. The wire values"pty"/"app-server"are the cross-repo literal contract with the server'sRuntimeTransports.Tests
CodexAppServerHostedAgentRuntimeTests.AgentInstance_reports_app_server_transport_for_the_app_server_runtime— the app-server runtime →app-server.AgentOrchestratorVendorTests.ReRegister_reports_pty_transport_for_a_pty_codex_runtime— a PTY codex runtime →ptyend-to-end throughAgentRegisteredAsync(proves the transport rides the runtime type, not the vendor).🤖 Generated with Claude Code