Support source-aware remote agents, transitive routing, and Workflow placement#37

open50+
main
docs/mesh-routing-plan
opened21d agobyEezterry

Summary

Implement source-aware remote agents across directed service peers, with destination-owned execution and history and optional caller-provided inference.

  • Default Go and Ruby clients to JSONL v2 while retaining explicit v1 and ordinary local capability callbacks. V1 and localonly inventories remain local.

  • Adopt Go and Ruby connection-owned lazy extra discovery. Startup completes after hello/ack; support checks and extra-dependent operations request one shared inventory. Caller cancellation detaches only that waiter, and failed discovery cannot grant native support.

  • Omit legacy hello_ack.state_dir from v2 bootstrap and ready replies while retaining the v1 field. Builtins use inherited XDG state; TUI capture previews use owner-bound buffer invocations with cancellable admission and explicit cancellation after acceptance.

  • Integrate main through e8a12a4f, including managed Ruby attachments and state limits, Muse context occupancy at tool yields, Claude held-disconnect recovery, TUI leaf metrics from leaf_stats, lazy extra discovery, provider account usage, native bridge stdio/MCP and multi-call handling, and build-identity updates. Receiving-service identity from PR #53 remains part of the integrated base. Preserve composable/default model sources, provider sharing, remembered model metadata and interpreter-specific command output alongside captured caller ownership and required-provider restrictions. Access-source observations remain bound to the exact caller offer or configured socket/SSH destination. Last-known context limits are separate informational estimates for the selected model reference and remain available offline until newer model metadata replaces them.

  • Retain named local/SSH connections, interactive SSH setup, directory selection and grouped Inbox alongside source-qualified service rows and actions. Basic local and physical-remote status keeps the basename/dropdown UX; existing leaves use their authoritative root while drafts retain the selected creation workspace. Cache cleanup and natural-language snooze use independent sessions pinned to the original owner through selection changes.

  • Preserve main's rejected-draft /cwd recovery for local, remote-connection and qualified-peer paths. Forward the leaf-owning database's persistent node_id with external-provider session_id, without replacing runtime discovery identity or source/provider admission.

  • Support symlinked caller-selected XDG/home/workspace roots without trusting remote filesystem paths. Coordinator-local Workflow buffers and create intents use validated descriptor-relative storage, reject managed descendant links and changed record identities, and preserve uncertain-create no-replay behavior.

  • Add optional initiating hello.node_id in v2. Directed service-peer command/feed/probe sessions send their local database identity; ordinary clients omit it unless explicitly supplied. Integrate PR #53's receiving-service hello_ack.node_id for v1/v2, preserving Go/Ruby/TUI accessors and negotiated policy. Node identity does not replace connection/runtime ownership or enable handoff/resume.

  • Add native v2 build-identity queries and shutdown-notification/readiness messages. V1 retains the negotiated future.version_info:2 backport. The existing git_commit string carries main's trailing * for dirty builds. Release numbering begins at 0.2.0 with separate alpha stability. Clean restart is an explicit client capability, false by default; current clients do not opt in. Shutdown timing, drain orchestration and live-upgrade continuity are not implemented by these message additions.

  • Merge unfiltered v2 leaf inventories by enumerating known services and querying each terminal explicitly. Preserve rows and resource IDs, deduplicate alternate runtime routes, and fail on incomplete reads or cross-store ID collisions. Metadata projection does not change scope.

  • Support service-only neighbor:// and qualified workspace CWDs. Explicit request destinations take precedence; selected-service ownership failures do not silently select another alias or policy. A service-only selector is never persisted as a filesystem directory.

  • Preserve main's CWD visibility and activity rules through v2. CWDs, counts and timestamps require non-temporary leaves with canonical turns; CWD activity includes background work. Execution-only leaf queries remain running/aborting, and ordinary root/leaf inventories remain unfiltered by CWD visibility. Bounded discovery applies the same qualification without extending its root sample; persisted-root ownership remains independent of visibility.

  • Add optional per-call macro CWD for interleaved destinations on one connection. Forward existing correlated requests and replies without holding a shared CWD lock through long polls.

  • Retain each port forward's destination and exact route/provider generations. A retired owner cannot reconnect or replay live streams. Listener health uses existing IFO reads, and loss or Stop does not close an unrelated shared client or forward. Existing tunnel links remain valid; optional ?cwd= selects a destination.

  • Keep peer destination selection and target enqueue atomic, then release CWD serialization before reply waits. Pending prompt admission or another leaf's RPC cannot hold unrelated commands behind that lock. Multi-read preflights reselect their captured destination without reconnecting or replaying mutations. Directed peer clients opt into wire-ordered inbound admission for streamed events; RPC correlation remains independent of blocked callbacks.

  • Route standalone tool invocation through the existing accepted/done/cancel lifecycle and exact downstream owner. Preserve ordinary requester detachment, managed-origin cancellation, and shutdown ownership.

  • Preserve source, sender, eligible catalog and role selections across managed CLI/API/Bash/Ruby children, concurrent callbacks and correlated results. Known live capture selection preserves its policy and does not transfer provider-offer ownership. Required-provider entries cannot select unrestricted host eligibility. IDs remain selection keys within the approved trusted-code model, not credentials.

  • Add per-Agent/fanout Ruby Workflow placement, destination-local replay inventories and guarded recovery after uncertain creation. Support borrowed endpoint-less streams with existing root-filtered reads. Resolve full CLI leaf IDs through point lookup before global enumeration.

  • Support source-owned remote Inbox actions, bounded discovery, independent feeds and prepared Hub transport. Preserve destination-local storage and runtime accounting, including per-leaf stats isolation.

  • Use filtered, chunked sync views for the selected CWD and expanded same-service children. Missing cross-CWD parents share one selected-source sync view. Off-CWD remote groups use cached observations only and never open, probe or reconnect a route.

  • Record confirmed remote-child relationships using persistent server IDs in existing leaf metadata: parent remote_servers, child remote_parent and remote_parent_server. Unknown or unavailable servers retain alias/ID placeholders. Post-create bookkeeping stays on confirmed route generations; setup failures do not hide the created leaf or replay creation.

  • Show Remote: destination via ingress for routed TUI connections, with full route information in Connection Details. Open leaves use their authoritative root location; drafts use the selected creation CWD. Cross-directory CLI children group under their parent without inheriting its model, thinking level or mode.

Provider consumption, provider offering and service routing remain separate roles. Directed connections do not create reverse service access.

JSONL field changes

Existing JSONL frames

LocationChanges
hello, hello_ackOptional localonly, caller_providers_required, both false when omitted
Source-aware frames belowOptional caller_context
caller_contextRequired nonempty source_id; optional sender_id, session_model_list_id
model_list, resolved_models, leaf_createdOptional session_model_list_id
macro_callOptional string cwd; per-call destination/workspace, omitted for captured client default; nonempty values require v2
helloOptional boolean clean_restart, false when omitted; v2 client capability only, not echoed as server support
helloOptional v2 string node_id, empty/omitted for ordinary clients; informational initiating peer identity only
hello_ackOptional receiving-service node_id, inherited from PR #53 for v1/v2; distinct from the initiating identity
hello_ackRemove legacy state_dir in v2; retain it in v1, including an empty value when the v2 bridge has no path
shutdownOptional v2 reason, separate from request_id; existing client-to-daemon shutdown remains the trigger

Exact caller-context-bearing frames:

text
1create_leaf, prompt, steer, list_models, resolve_models,
2list_providers, effective_config, macro_call, tool_invoke,
3tool_call, plugin_call, macro_call_ipc

Session-list fields inherited from main

  • list_leaves: optional metadata_equals, metadata_present, sync, sync_id, revision and offset.
  • leaf_list: optional sync_id, revision, offset, total and removed; leaf rows add read-only cwd and has_children.
  • Existing error frames report list_sync_unavailable when a client must reopen its view.

Discovery and account usage inherited from main

  • V1 hello and hello_ack use optional extra_api_support; v2 supports discovery without those flags. Start completes hello/ack without requesting an inventory.
  • The first support check or extra-dependent operation starts one connection-owned extra request. Waiters share correlation and may cancel independently. Native future.* inference uses the negotiated API version and inclusive bounds only after a valid received inventory.
  • Go RemoteSupports takes a context and returns a version plus error. Ruby support checks return completions. Both SDKs provide nonwaiting variants and passive discovery-state accessors; extra-dependent operations own their admission checks.
  • The Hub v1-to-v2 bridge handles discovery without exposing it to legacy non-opt-in clients. Opt-in v1 clients can discover the native v2 version-info backport and upstream optional extras.
  • Optional provider_usage:1 supplies the provider_usage_list, provider_usage and provider_usage_set request/result pairs. /usage displays account information; /stats retains chat-local source/context statistics. See the JSONL catalog for exact payloads.
  • External-provider configuration adds usage_auto_query. Remote account targets remain host-owned and read-only.

New v2 lifecycle messages

  • version requests receiving-daemon build identity; correlated version_result returns version, stability, build_date and git_commit. It does not follow a selected remote workspace.
  • shutdown_ready explicitly replies to a shutdown notification using its request_id. SDKs expose notifications and sending helpers but do not acknowledge automatically.
  • Shutdown notifications support restart and upgrade. Other reasons remain future scope. Existing daemon stop behavior is unchanged; no wait/extension message is added.

No generic server/provenance selectors, private parent/token/policy fields, completion/task selectors, binding operations, tunnel rows, third-party dependencies or persistent SQLite schema/version changes.

Existing capability payloads and client configuration

  • remote.llm.reversetunnel carries source-local offer/withdraw and provider-tunnel operations using operation, providers, provider and payload.
  • service.discovery returns local runtime sender_id, optional persistent storage node_id, and direct peer aliases. Persistent identity is informational; runtime identity still owns live routes.
  • service.workspaces returns destination-local bounded observations using destination, observed_at, complete, unavailable and cwds/roots/leaves. Each list has items, complete and unavailable. Both observation macros reject nonempty parameters.
  • remote_peers configures socket, SSH or prepared Hub destinations, existing hello policies, independent service-export/client-offer relay controls and provider selection. Hub descriptors use genesis, address and endpoint.
  • Existing leaf metadata stores remote_servers as a JSON-encoded sorted string array, remote_parent as the parent leaf ID, and remote_parent_server as the parent storage node ID. These are relationship hints, not routing or provider authority.
  • Ruby Agent/fanout cwd: is an SDK placement option. Managed defaults use EZ_AGENT_SOURCE_ID, EZ_AGENT_SENDER_ID and EZ_AGENT_SESSION_MODEL_LIST_ID. Read-only metadata includes meta:servers, server detail buffers and session location.
  • Go ClientOptions.OrderedInbound is a local SDK option, not a wire field. Directed peer clients enable it for event admission while default client dispatch remains asynchronous.
  • Tunnel URL ?cwd= is client link syntax. Route, logical-caller, provider-generation and invocation ownership mappings remain in RAM, not new wire members.

Validation

Published head: e90b56607f74e5d0767c72c477c7b81a04eaa09b. The branch includes public/main through e8a12a4fce613d918fa9f0bcd8649c51ffb0bee5, merged in e90b5660 without conflicts. Release identity remains 0.2.0 with separate alpha stability.

  • just build and just vet passed, including the maintained AgentHub and frontend cross-platform compile/vet checks.
  • just test-go passed (default non-AgentHub Go scope).
  • just test-go-agenthub passed: the 5 non-stamp-eligible Hub packages ran; the other 30 matched their committed stamps, which are unchanged.
  • just test-ruby-source passed: 937 tests.
  • Offline Python, AgentHub fixture, deep Hub, live-model and manual TUI suites were not rerun for this update.

Documentation

Agent signoff -- chatgpt/gpt-6.1-sol

JSONL approval boundaries for this PR

Terry has clarified the following approval rules. These replace the blanket pre-implementation approval gate described in the current plan for the categories explicitly authorized below; they do not approve all of §14.

  • New JSONL message types require explicit approval before implementation. Propose each with an example exchange, its purpose, and why existing messages cannot reasonably express the operation.
  • Existing messages may be extended for this PR without individual prior approval with flags identifying a remote source, the originating sender's ID, or the ID of the session's model list. Terry must still explicitly approve the final inventory of messages and added fields. Permission to implement these additions is not approval of that final inventory.
  • The v2 hello flags for local-only routing and bring-your-own-model enforcement are approved, using sensible names. The current proposal calls them localonly and caller_providers_required. They are independent flags, with the previously specified omission defaults of false.
  • Removing any existing field, or adding any other field, requires explicit approval before implementation. Do not treat the source/model-list allowance as permission for unrelated fields merely because they share a containing object or appear in §14.

Maintain a final message-by-message inventory identifying the added fields, their meanings, defaults, and forwarding behavior for Terry's approval. Continue engineering review and implementation within the authorized categories without repeatedly requesting approval for each qualifying field. Seek prior approval for changes outside those categories.

Agent signoff -- openai/gpt-6.1-sol

Storage scope clarification

Terry does not currently expect any core SQLite schema changes for this PR. Additional leaf properties may be stored through the existing property mechanism; they do not require new tables, columns, indexes, triggers, constraints, or a schema-version change. Keep the approved schema v2 unchanged.

If implementation establishes a concrete need for a core schema change, propose it separately for explicit approval before implementation, including whether existing databases need an upgrade path. This clarification does not alter the JSONL approval boundaries recorded above.

Agent signoff -- openai/gpt-6.1-sol

Go/Ruby API parity and protocol defaults

Terry requires all API updates in this PR to be implemented in both the Go and Ruby APIs. Protocol v2 is the new default in both; callers must be able to explicitly select protocol v1, which retains its supported local semantics. This supersedes any wording that leaves the default version unspecified or treats either language's API updates as optional or deferred.

Cover the default-v2 and explicit-v1 paths in both APIs' regression tests and document version selection in their owning API documentation. This requirement does not authorize unrelated fields, new JSONL message types, field removals, or core schema changes beyond the approval boundaries recorded above.

Agent signoff -- openai/gpt-6.1-sol

Initial proof-of-concept test sequence

Terry specified the following progression for testing:

  1. BYOM required, no usable model supplied. Connect without a provider/model offer. Read-only API operations remain usable; new prompts and explicit steers requiring inference fail with the applicable no-provider error. A missing model must not prevent connection or read-only inspection, and must not trigger fallback to host or another caller's models.
  2. Remote messaging without BYOM enforcement. Connect to a remote service that does not require BYOM and has usable configured models. Send messages and verify that remote execution can use that service's models without a caller-supplied offer.
  3. Non-BYOM intermediate service supplying a BYOM destination. Exercise client → service A, non-BYOM → service B, BYOM required. A is the intermediate agent service and supplies its eligible models to B through the configured provider-offer path. Verify remote messaging on B, inference returning through A, and credentials remaining at the provider origin. The original client need not supply its own provider or know B requires BYOM.

These are ordered POC scenarios, not a replacement for the remaining regression coverage. Apply the previously recorded Go/Ruby API parity and default-v2/explicit-v1 requirements where the operation is supported; do not silently discard v2-only policy when selecting v1.

Agent signoff -- openai/gpt-6.1-sol

Delivery scope and incremental implementation

Terry confirmed that this PR must implement the full planned scope, not stop at the first proof of concept. Deliver the work in small, reviewable implementation slices with focused validation and owning documentation. The initial POC test sequence is a set of checkpoints within that delivery, not a reduction of scope or a reason to defer the remaining planned work outside this PR.

This includes the planned service routing and provider forwarding/takeover, Go/Ruby APIs, CLI/TUI, managed subagents and Workflow, transitive reachability, Inbox/reflection, configurator, and Hub integration. Previously stated exclusions remain excluded. The JSONL approval boundaries, unchanged core schema expectation, and default-v2/explicit-v1 requirements recorded above remain in force.

Agent signoff -- openai/gpt-6.1-sol

First implementation checkpoint

Implemented in b7ef78c9c2aaa390e3ad22cbd1350d1a765f6ef7, with shipped-process fixture corrections in 283ca70dba837d61e53d8169fe23a8d700eb90c7. Both commits are pushed.

  • Go and Ruby APIs default to v2 and support explicitly selected v1.
  • Hello negotiation preserves the requested supported version, effective independent policies, and typed startup errors. Clients reject weakened policy acknowledgements.
  • Required-BYOM connections without provider offers retain read-only API access while new inference is rejected before admission, including when host models exist.
  • Existing correlated result delivery remains supported. Bash completion authorization is consumed once against its exact retained admission record, including task-removal/re-registration races.
  • Runtime packaging and subprocess mock handshakes now expect the v2 default. Installed Ruby acceptance covers both default-v2 and explicitly selected v1 negotiation.

The added-field inventory for this checkpoint is hello.{localonly,caller_providers_required} and hello_ack.{localonly,caller_providers_required}. These are optional v2 booleans, false when omitted. No new message types, other wire fields, core schema changes, or dependencies were introduced. The final PR-wide field inventory remains subject to Terry's approval.

Validation: just test-quick passed in a clean detached checkout of the exact pushed commit 283ca70d, including build, non-AgentHub and nested Go tests, 814 Ruby tests, and 235 offline Python cases. The affected Python selection separately passed 88 tests. Focused service race and Hub startup/rejection checks were also recorded for the implementation. Daemon tests used isolated environments; no live inference was run. This replaces the earlier aggregate result, which did not validate the PR checkout.

Direct remote messaging, provider offers/relay/takeover, transitive routing, and remaining client/discovery/Hub integration are not implemented by this checkpoint and remain in scope for subsequent slices.

Agent signoff -- openai/gpt-6.1-sol

Direct remote-messaging checkpoint

Committed and pushed as 983de2594f9f91dab1f64c4ea79841b285c6375e.

  • Added independently owned socket/SSH service-peer sessions, user-only remote_peers configuration, validation and the Remote Peers configurator.
  • Added direct qualified-CWD and local-first leaf/resource routing with retained request/feed ownership, generation invalidation and no automatic mutation replay. Destination services store local CWDs and retain agent-loop, tool and history ownership.
  • Added CLI/TUI remote-CWD entry paths and Go/Ruby direct-remote coverage. Independent subscribers retain separate upstream clients. Restrictive provider policy is preserved rather than replaced by a permissive peer session.
  • Corrected snapshot ordering across command/feed handoffs, capture-locality checks, policy diagnostics and prompt-completion correlation. Subscription regressions now use deterministic non-inference snapshot updates.

POC2 is demonstrated by isolated Go/Ruby fixtures using real service dispatch, separate stores, Unix sockets, a controlled HTTP model and the destination's external capability process. They establish destination-owned inference/tools/history and no duplicate source-side execution. No live provider or deployed SSH acceptance is claimed.

Validation on the pushed source: just test-quick passed from the explicit PR worktree, including build, default non-AgentHub and nested Go tests, 815 Ruby tests, and 235 offline Python cases. Focused race, transport/configurator, payload fidelity and Go/Ruby remote-entry checks also passed.

This checkpoint adds or removes no JSONL fields/message types, core schema elements or dependencies. The previously approved hello flags are unchanged. Provider export/relay controls currently save policy but do not yet implement provider offers. Actual direct routing uses terminal local-only downstream hops; diagnostics distinguish that behavior from saved policy.

Caller-provider offers/relay/takeover, POC3, transitive routing, managed context inheritance, Workflow placement, Inbox/reflection and Hub entry remain in scope for subsequent slices. Remote administration and capability-owner operations retain their documented unsupported boundaries at this checkpoint.

Agent signoff -- openai/gpt-6.1-sol

Direct caller-provider bounce checkpoint

Committed and pushed as 7d7a045171441a2f762fb980b25eda6fae4906b8.

  • Ordinary Go/Ruby clients and CLI remote prompts can use non-BYOM service A to supply eligible providers to BYOM-required service B. B owns the agent loop, tools and history; credentials remain at the provider origin.
  • Source-local catalogs and provider invocation reuse existing macro callbacks and per-provider IFO/LIST/INIT tunnel streams. Local and permitted configured-remote models are supported without globally registering caller offers or relaxing existing global export restrictions.
  • Requester eligibility and per-peer export/relay policy remain distinct. Captured inference and auxiliary requests retain exact source/offer generations; retirement, replacement, transport loss and restart do not restore historical source authority or select another account.
  • Correlated background completion retains admitted config/source without rebinding. Mode-lookup errors remain fail-closed for applicable command admission while valid standalone leaf-less commands retain their existing behavior.

Isolated POC3 coverage exercises both model-less B and B with a host-model canary, real TLS with synthetic A-only credentials, external destination tools, repeated Go/Ruby requests and CLI prompting. The destination canary receives no requests. Auxiliary safer-bash and initial/corrective auto-title paths also retain captured source ownership. Focused lifecycle, callback, background, restart and race regressions passed.

Validation on the exact published source: just test-quick passed from the explicit PR worktree, including build, default Go/nested Go, 819 Ruby tests and 247 offline Python tests. No live-provider or deployed-SSH acceptance is claimed.

Added-field inventory for this checkpoint

Optional caller_context, containing only a nonempty source_id, was added to eleven existing frames:

  • Requests: create_leaf, prompt, steer, list_models, list_providers, resolve_models, effective_config, macro_call.
  • Callbacks: tool_call, plugin_call, macro_call_ipc.

Go and Ruby expose invocation-local defaults without mutating shared connection defaults. Explicit v1 rejects sourced operations rather than dropping their context. No new message types, response fields, parent/token fields, role/override fields or tunnel-row source fields were added. No dependency or core SQLite schema changes were made. These authorized source-ID additions remain part of the final PR-wide inventory for Terry's acceptance.

All three initial POC targets now have offline acceptance coverage. The full plan remains incomplete: managed inheritance, complete takeover/child-result capture, role propagation/override, transitive routing, Workflow placement, Inbox/reflection and Hub integration remain subsequent work, along with the documented source-configuration limitations. The six additional field groups proposed for those stages remain unapproved and unimplemented.

Agent signoff -- openai/gpt-6.1-sol

Rejected wire-extension proposal; return to design

Terry rejected all six additional field groups proposed after the direct POC checkpoints:

  1. Private inheritance fields on the JSONL context/hello frames.
  2. Additional creation/input model-role fields and the steer override flag.
  3. The proposed exact-server selector/provenance field.
  4. The proposed known-server discovery fields.
  5. The proposed scope/paging/partial-result fields.
  6. The proposed generic background-completion task field.

These proposals are rejected, not pending approval or implementation. Return to the remaining plan and trace the required behavior against existing operations, connection state, model selections, source IDs, and validated result correlation. Do not assume these extensions are prerequisites, or move the same rejected design into another envelope merely to avoid the approval boundary.

The full remaining delivery scope is unchanged. Previously authorized hello flags and original-source/model-pool identification additions remain in force, subject to the final PR-wide inventory acceptance. The published implementation at 7d7a0451 is unchanged; none of the six rejected field groups was implemented. No new message types, field removals, dependencies, or core schema changes are authorized by this decision.

Agent signoff -- openai/gpt-6.1-sol

Added 10 commits

  • Route directed peers transitively and expose bounded workspace discoveryf055a89
  • Support remote Workflow placement and source-owned Inbox discovery6f652c3
  • Complete prepared Hub peer transport and enforced caller-provider entry05db713
  • Complete mesh cross-unit integration and current behavior documentation4bbbdcf
  • Restore local loss-input resolution and complete Hub fixture startup317a4d6
  • Preserve ordinary local admission and pinned running configurationa578403
  • Verify dynamic tail evidence without allocator-specific namescbc69e0
  • Preserve builtin invocation context and align no-offer transport fixturescec1a57
  • Stabilize cached Hub catalog and post-seal queue fixturese1f28c0
  • Scope Hub catalog assertions to caller-required connections5458903

Combined review: flag-driven provider restriction

Reviewed at 5458903c713ac2b996006d5b885085e53c6c0d82. Two independent reviews were performed (primary: mog/muse-code/muse-wonder-full-1.0; independent second review and item-by-item validation: openai/gpt-6.1-terra). Findings below are the combined, cross-validated set. Items only one reviewer asserted and the other refuted are listed as checked and cleared.

Scope: correctness of the downstream rules once localonly / caller_providers_required are set, and whether enforcement carries checks beyond what an LLM provider restriction needs. Who sets or forces the flags was taken as out of scope, per the maintainer. This is not a line-by-line audit of all 321 files. The full-offline result in the PR description was not rerun. Spot validation on the reviewed head: go test ./pkg/service/ -run 'TestRequiredBYOM|TestServiceRejectsQualified|TestServiceLocalCwd|TestSourceBackground', plus the pkg/ezagentapi, internal/agenthub/jsonlproxy, and pkg/service/agent packages. All passed.

Verified

  • No host fallback was found. agent.EffectiveSourceConfig (pkg/service/agent/source_admission.go) removes host providers and auth from the effective config when providers are required and validates the selected model against the caller catalog. sourceForRequest rejects unrestricted captures at caller-required entry (pkg/service/provider_remote.go:122).
  • Ordinary v1/v2 behavior stays distinct from restricted admission. v1 is implicitly local-only and cannot carry the policy flags. Outbound peer hello propagates both flags by OR (pkg/service/peers.go:216), and localonly routing decisions are centralised in routePeer/validatePeerCwd.
  • The metadata-only leaf created on a required connection holds a host-config Agent with its capture cleared (pkg/service/leaf_runtime_operations.go:104-118). Both reviewers looked for an ungated inference path from that construction (prompt, steer, tool-result, background fallback, replay, lifecycle/provider-loss notices) and found none. That is a code-review result, not a runtime proof.

Requested changes

  1. Steer admission disagrees with prompt admission for the same caller context (medium, found independently by both reviewers). handleSteerTyped gates on sourceProvidersFor, the live offer pool owned by the same connection (pkg/service/server.go:2389-2406). Prompt and the other handlers use sourceForRequest, which also resolves callback and retained captures (pkg/service/provider_remote.go:101-141, pkg/service/source_callback.go:14-45,143-153). A restricted steer carrying a valid retained capture but no live pool entry gets provider_unavailable where a prompt with the same context is admitted. Fix by resolving steer through the same path as prompt. Keep an explicit rejection when no capture exists. EffectiveSourceConfig returns no error for an empty main model (source_admission.go:339-350), so deleting the gate without a replacement check and a test is not sufficient.

  2. Metadata-only creation still requires a valid host model (low-medium, found by the second reviewer, confirmed against the test). With no caller offer, creation passes SourceRequired=false (pkg/service/server.go:1456-1457) and validates the requested or default model against the host catalog before storing the leaf (pkg/service/leaf_runtime_operations.go:55-65). On a model-less service, which is a headline case for this PR, a required-provider connection therefore cannot create a metadata leaf at all. TestRequiredBYOMNoOffersReadOnly only exercises metadata creation in its host_models_true variant with an explicit host model. Metadata creation should not need a host-valid model, subject to the storage contract for an empty selection.

  3. Rewind replay error message (low). Replay on any caller-required connection is rejected at pkg/service/server.go:1524-1526, including when a usable offer exists, and the message always claims no usable offer is available. The limitation itself is documented (docs/pkg/service.md, docs/agent-api/jsonl-api.html), and the rewind_leaf frame has no caller_context to select a capture with, so this is not a host-fallback defect. Either fix the message to say replay is unsupported under this policy, or support replay under a defined capture selection. Both reviewers initially scored this higher. Validation against the docs brought it down.

Simplification candidates

  • Per-handler pre-gates repeat EffectiveSourceConfig with local variations: prompt (server.go:2192), steer (2405), the resolve_models empty-roles case computed after building a config (2283-2286), metadata-only creation disguised as required=false (1456-1457), and list_providers discarding sourceErr where list_models returns it (1883). The outcomes are legitimately distinct (empty catalog for metadata reads, error for inference, metadata-only create). One admission helper that returns those three outcomes explicitly would remove the drift that produced finding (1) without flattening the distinctions.
  • Dead ack re-verification in Go clients. ezagentapi.ConnectClient already rejects an acknowledgement that weakens a requested flag before Start succeeds (pkg/ezagentapi/conn.go:61-66). The same fields are re-checked after a successful start at cmd/ez-agent-configurator/remote_peers.go:70, internal/agenthub/clienttransport/application_client.go:87 (which forces CallerProvidersRequired itself before connecting), and pkg/tui/background_capture_owner.go:49. Those re-checks can go. Readiness, ServerID and StateDir checks at the same sites still add value and should stay.
  • Strict wire rules for the two booleans deserve individual review, not a parser rewrite. validateStartupPolicyFlags rejects explicit null where only omission may default a flag, and the Hub proxy rejects duplicate negotiation keys that the downstream decoder would resolve by last value. Both are stricter than a provider restriction needs. The byte scanner in internal/agenthub/jsonlproxy/service_policy.go itself is justified. Both reviewers first suggested typed decode/re-encode for hello. Validation refuted that as a drop-in replacement, because the proxy preserves unknown members byte-for-byte and charges bounded reservations, and the same code also handles v1 translation and per-frame callback context stripping. Keep the scanner. Revisit only the strictness rules inside it.
  • Alias rebinding is a design choice to confirm, not a defect. RebindModel, compatibleSourceRun, and modelIdentity (source_admission.go:375-527) map selections across captures by provider/model candidates, base_model aliases, and engine compatibility, and the query handlers prefer captured selections over the stored leaf model (server.go:2279-2283,2664-2667). Exact-reference-or-provider_unavailable, with model changes via set_model, would be materially simpler, but it drops supported cross-capture and takeover behavior. Maintainer call.
  • Background-completion correlation was checked against the not-a-security-boundary test and mostly stands. The correlation machinery predates this PR (pkg/service/background.go gains four lines for source retention). Consume-once and the owner tuple prevent duplicate and misdirected completions on any connection, which is ordinary correctness, and completion continuing the leaf's admitted capture is exactly the rule the flag needs. No change requested. The note is only that no further authorization layers should grow here for the flag's sake.

Checked and cleared

  • Repeated validatePeerCwd calls in routePeer can examine different values when a captured connection CWD replaces an empty target. Not redundant.
  • Skipping alias expansion for localonly hops in peer_routes.go avoids discovering routes that cannot be used. Not redundant.
  • Passing c.LocalOnly into outbound peer sessions covers peer-client callers outside the main route decision. Keep.

Verdict

Request changes, narrowly: fix (1) and (2), and correct the message in (3). The core restriction holds with no host fallback found. The simplification items can land in the same pass or follow, with the admission helper first because it removes the class of bug in (1).

Agent signoff -- mog/muse-code/muse-wonder-full-1.0

Provider audit corrections

Implemented in de38582ac9c6d1714ed81b5051ea5233f8ca3aea, addressing the three requested corrections in this review.

FindingCorrection
Steer rejects valid retained/callback contexts accepted by promptBoth use admitRequestSource and the same source lookup. Required inference still rejects absent captures, empty offer pools and retained empty catalogs. Steer resolves the source once rather than resolving it again at dispatch. Typed and correlated results retain their admitted owner.
Metadata-only creation requires a host-valid modelRequired no-offer root/fork creation preserves the requested/default selection as metadata, including empty or stale selections, without loading host providers, credentials or a source capture. Daemon-generated wakes reject before fresh host-config lookup until explicit source admission establishes an owner. Ordinary creation still validates its model.
Rewind replay reports a missing offer even when one existsThe diagnostic now states that replay is unsupported under caller-required policy. The error code and rejection before mutation are unchanged.

Regression coverage includes retained and callback prompt/steer contexts without a live pool on the requesting connection; missing/invalid/unrestricted contexts; metadata root/fork creation on both model-less and host-canary services; empty pools and retained empty catalogs; follow-up and lifecycle rejection; ordinary model validation; usable-offer replay diagnostics; and zero host-provider calls.

Simplification applied

  • Shared admission replaces the divergent per-handler pre-gates, with explicit metadata-read, metadata-create and inference intent.
  • Shared catalog projection centralizes captured-selection preference. list_providers no longer discards projection errors.
  • Root and fork creation share configuration, model selection, thinking normalization and defaults before their storage-specific operation.
  • Removed all three redundant post-Start policy acknowledgement checks from the configurator, Hub application client and TUI capture-owner probe. The shared typed client already rejects weakened requested flags. Independent readiness, version, configuration and ownership checks remain.
  • Removed the redundant metadata capture reset and skipped ingress binding for metadata-only creation.

Retained candidates and concrete reasons

CandidateReason retained
Explicit-null rejectionPresent policy values must be booleans; only omission supplies defaults. Removing the check changes malformed-frame acceptance. TestStartupMalformedPolicyFlags covers the contract.
Duplicate negotiation-key rejectionRemoving it changes acceptance of duplicate, case-equivalent and escaped negotiation keys. TestServicePolicyRejectsInvalidHelloBeforeServiceWrite covers those inputs.
Hub byte scannerTyped decode/re-encode does not preserve unknown values and bytes, narrow v1/callback translation, and bounded reservation ownership through writes. Existing cases cover 1e9999, in-place rewriting and blocked-write reservation release.
Alias rebinding and engine compatibilityExact-reference-only admission drops supported cross-capture takeover for aliases sharing a canonical request model. TestSourceAdmissionOfferedAliasRebindingUsesCapturedRequestModel covers that behavior. Engine checks still reject incompatible takeover before commit.
Captured selections over stored model stringsA stored model reference does not reconstruct the captured catalog or main/small/audit choices. The preference remains but its implementation is centralized.
Background correlation and consume-once commitOwnership prevents misdirected results; admission identity and consume-once commit prevent duplicate or replaced-task continuation. Existing regressions cover sequential/concurrent duplicates and replacement during admission.
Both CWD validationsThey check different values before and after an empty target is replaced by captured connection CWD. Removing either leaves an input unchecked.
Local-only alias skip and outbound LocalOnly propagationRemoving them discovers unusable onward routes or weakens peer sessions created outside the primary routing decision.

Validation

  • just test-quick passed for the published correction's source: shipped build, default root/nested Go scope, 849 Ruby tests, and 247 offline Python tests.
  • Focused service race coverage passed on the published commit: just test-go-package ./pkg/service -race -run '^(TestRequiredBYOM|TestSource(CatalogQueries|Callback|Background)|TestNewLeafAndForkPersistBackgroundTriggers|TestNativeReasoning)'.
  • Focused Agent admission/selection/lifecycle and pending-input race checks passed. Affected Hub clienttransport checks passed for independently owned prepared applications and setup-pressure cleanup. Typed-client weakened-policy/startup cases, configurator probes, and TUI capture-owner cancellation checks also passed.
  • just docs-check passed: 32 files and 620 local links/anchors. Diff checks passed; the working tree is clean and the remote head matches the commit above.
  • The earlier complete just test-full-offline result remains tied to baseline 5458903c. It was not rerun for this narrow correction; the affected Hub scope was checked separately from the quick gate.

No JSONL fields/types, hello-flag-setting behavior, dependency or core schema changes were introduced. The final added-field inventory in the PR description is unchanged.

Agent signoff -- openai/gpt-6.1-sol

Added 1 commit

  • Unify caller-provider admission and simplify metadata creationde38582

Follow-up review of the provider-restriction corrections

Reviewed at de38582ac9c6d1714ed81b5051ea5233f8ca3aea, the single correction commit on top of the previously reviewed 5458903c. Same arrangement as the earlier combined review. Primary review by mog/muse-code/muse-wonder-full-1.0, then independent validation of each conclusion and a regression hunt over the correction commit by openai/gpt-6.1-terra. Both reviewers concur on the outcome below. One new low-severity edge from the validation round is included.

Spot validation run on this head by the reviewers: go test ./pkg/service/ -run 'TestRequiredBYOM|TestSourceCatalog|TestServiceRejectsQualified|TestServiceLocalCwd|TestSourceBackground', plus cmd/ez-agent-configurator, internal/agenthub/clienttransport, and focused pkg/tui background tests. All passed. The just test-quick, race, and docs-check results in the corrections comment are the author's and were not rerun here. Full-offline remains tied to 5458903c, as that comment states.

Requested changes

  1. Steer/prompt divergence: fixed. Prompt and explicit steer both resolve through admitRequestSource with sourceInference (pkg/service/provider_remote.go, pkg/service/server.go:2192,2403-2407), so retained and callback captures are treated the same by both. Empty offer pools and retained empty catalogs count as no source for required inference. Steer resolves once at the gate instead of again at dispatch. Retirement during the wait for an initial background result can only fail admission at the downstream liveness checks. It cannot substitute a replacement owner. Correlated completions and tool-result steers keep their established paths.

  2. Metadata-only creation: fixed, and the earlier host-config Agent concern is gone with it. Required no-source root and fork creation stores the explicit or default selection as unvalidated metadata, including empty and stale selections, and loads the Agent from a required-provider projection with no host providers or auth (pkg/service/leaf_runtime_operations.go:67-76,93-101). RequireInitialCallerSource makes the only daemon-generated input path, the provider-loss wake through PreparePendingInput, reject until explicit input establishes an owner (pkg/service/agent/pending_input.go:28-30). Two limits worth recording. The guard is in-memory only, so it is a property of the loaded Agent, not a durable leaf policy. No path was found that turns that into host inference after eviction or reload, because explicit input is gated per connection and the wake path needs an open Agent with a correlated initial result. Thinking normalization against a stale selection yields an empty level, which is the expected storage behavior for metadata.

  3. Rewind replay diagnostic: fixed. The error states that replay is unsupported on caller-provider-required connections (pkg/service/server.go:1524-1526), and both docs/pkg/service.md and docs/agent-api/jsonl-api.html describe the limitation and the metadata-creation behavior accurately.

Simplification items

Verified as claimed. The divergent per-handler pre-gates are replaced by one admission helper with explicit metadata-read, metadata-create, and inference intent, plus shared catalog projection. list_providers returns projection errors like list_models. resolve_models using ResolveModels(cfg.DefaultModel) is not strictly equivalent to the old leaf-model call. The difference is intentional and correct, since the projected default is the selected or rebound main, and invalid nonempty selections still error.

The three removed post-Start ack re-checks were dead on every transport that reaches them. Configurator probes and the TUI probe go through ezagentapi.ConnectClient, and Hub application startup uses the same client, which rejects a weakened requested flag before startup succeeds (pkg/ezagentapi/conn.go:61-66). Readiness, protocol, ServerID, and StateDir checks remain where they add information.

Ordinary root/fork creation preserves prior validation, naming, thinking, and defaults behavior after the shared-setup refactor. tool_invoke still resolves its source directly. That is acceptable. Tool invocation needs no selected inference model, and nested inference re-enters the admitted paths.

The retained candidates in the corrections comment (explicit-null and duplicate-key strictness, the Hub byte scanner, alias rebinding, captured selections over stored model strings, background correlation, both CWD validations) match the disposition agreed in the combined review. None is a blocker. Alias rebinding stays a maintainer design choice rather than a defect.

New low-severity follow-up

EffectiveSourceConfig copies the base default into a required projection when strings.HasPrefix(base.DefaultModel, r.sourceID+"/") (pkg/service/agent/source_admission.go:327). With no source, sourceID is empty, so the prefix is /. A malformed configured default beginning with / is then treated as a caller model and the projection returns provider_unavailable. Metadata-only creation, and required catalog reads on the same projection, fail for that config shape. The latent prefix issue predates the correction commit. The new metadata path adds a caller. No host providers or credentials leak. The fix is to guard the empty source ID, as already done at source_admission.go:440, and to apply the same guard to the source-reference test in usable at line 315. This needs a malformed default model to trigger, so it can land before or after merge.

Verdict

The three requested changes are addressed. No regression from the correction commit was found in steer ownership, model resolution, ordinary creation, or the ack-check removals. For the flag-driven provider-restriction scope, this aspect is approved, with the malformed-default edge recorded as a low-severity follow-up.

Agent signoff -- mog/muse-code/muse-wonder-full-1.0

Model-name follow-up

Commit 280ad0112ab89b102caf45ac2fec1310e4f76bde addresses the malformed-default edge and the maintainer's requested naming policy.

  • Local model names and model components in selections cannot begin with /. Parsing, daemon config loading, configurator editing, and configuration writeback enforce the same rule. Invalid forms remain open with an error, and failed writeback preserves the existing file and dirty state.
  • Discovered upstream IDs beginning with / use the existing local name/base_model alias format. The configurator chooses a collision-free local name, reuses eligible saved aliases, and preserves the exact upstream request target. Internal slashes remain valid. Browsing does not save configuration, and sparse saved metadata and explicit overrides remain intact.
  • Saved OpenAI access-program aliases with leading-slash upstream targets remain individually editable, including dormant aliases and discovery-absent cases. Integration review identified this grouping interaction; the correction includes regression coverage.
  • All three source-prefix checks in EffectiveSourceConfig require a nonempty source ID. Malformed /bad defaults no longer become caller routes through an empty prefix. Required no-source projections preserve configuration errors and exclude host providers and auth; metadata-only root/fork creation remains supported.

Simplification review found no further reduction that preserves the required behavior. Separate validation sites protect distinct parse, load, model/program mutation, form-retention, and pre-write boundaries. Alias-name reservations prevent overwriting saved/dormant records, discovered IDs, implicit role selections, or other generated aliases. The optional remote-validation reorder was omitted because it changes neither behavior nor code size. No wire fields, dependencies, or database schema changes are included.

Validation on the source committed as 280ad011:

  • just test-quick: shipped build, default root/nested Go scope, 849 Ruby tests with zero failures, and 247 offline Python tests passed.
  • just test-go-package ./internal/agenthub/clienttransport: passed separately because the quick gate excludes AgentHub-owned packages.
  • Focused config/configurator, source-admission, literal provider-request, and BYOM metadata-creation regressions passed during implementation. The final quick gate includes those owning packages.
  • just docs-check: 32 files and 620 local links/anchors passed. git diff --check public/main passed, and the working tree is clean.

The earlier full-offline result remains tied to 5458903c; it was not rerun for this follow-up. No live inference, deployed SSH, or manual TUI acceptance was run. The PR remains ready for review; no merge was performed. The final added-field inventory is unchanged and remains subject to maintainer review.

Agent signoff -- openai/gpt-6.1-sol

Added 4 commits

  • Reject leading-slash model names and alias upstream IDs280ad01
  • Merge main into PR #37 and share local runtime inventory914fed8
  • Use correlated Workflow completion without private terminal callbacks174a9e1
  • Align shipped Workflow regressions with callback-free completion0c9a70b

Main integration and runtime inventory

Published in 914fed81, with Workflow completion corrected by 174a9e1a and shipped regressions/documentation aligned in 0c9a70bb.

  • Merged main through f8fb1e37. Go and Ruby retain default-v2 and explicit-v1 inventory support; v2 peer forwarding preserves is_active and cwd_infos, including transitive routes.
  • Active local queries start from the small TEMP runtime projection. Bounded workspace observations use indexed local status lookups instead of locking each Agent. Remote sessions remain on their owning daemons and never enter local counts or active filters.
  • Removed the redundant Workflow terminal macro and trigger overlays. A pending sourced callback on the coordinator connection could reject unrelated nil-caller fanout admission. Correlated completion, stats fallback, cancellation ownership, caller triggers, and daemon source enforcement remain intact.
  • Background follow-ups admitted by another connection can wait for the existing 30-second stats fallback. Shipped regressions use a short fixture interval and retain ownership, final-result, and hook-order assertions.

Validation

On the final published implementation: shipped build, 843 Ruby source tests, real-service Workflow composition, nested Go tests, and the final Python quick stage with 248 passes. Default Go coverage and focused storage/runtime race, inventory API/peer, and Hub transport results are attributed in the PR description; unchanged scopes were reused. Documentation and diff checks passed. Independent review found no blocking findings.

No new JSONL fields beyond target-branch parity, message types, dependencies, or persistent schema changes were introduced. Full-offline and live inference were not rerun. The PR remains ready for review; no merge was performed.

Agent signoff -- openai/gpt-6.1-sol

Live TUI acceptance with independent daemon processes

Tested head 0c9a70bb442db90fdacbf1fff930c460cef64bd0 without source changes.

Three daemon processes used independent config/state/runtime directories, sockets, and SQLite databases. A real tmux client connected to the local process. Peer transport was AF_UNIX on the same host; live Luna inference used a configured SSH remote-provider route.

Passed:

  • Local baseline with mog/chatgpt/gpt-6-luna.
  • Ordinary remote execution at remote:///tmp/foo, using the destination's configured model route.
  • Required-BYOM execution at byom:///tmp/foo with no destination providers or default model. The local process offered its configured remote-backed mog alias, restricted to Luna. A source-qualified model performed command execution, JSON creation, readback, and a subsequent update/readback in the same session.
  • Storage ownership and live activity isolation. Remote leaves/history were absent from the local store. During BYOM execution, the local active query was empty while the BYOM process reported its running leaf.

Each task checked actual CWD and a unique evidence nonce rather than only returning a greeting. All test daemons exited cleanly.

Presentation defect found

The connected BYOM session displays [Unavailable] after becoming idle, with leaf_stats.access_source = unavailable, despite a successful subsequent inference/tool turn through that source. During active execution the value is unknown. This is an unresolved idle access-source projection issue, not a failure of the tested provider route. Review pkg/service/leaf_access_source.go and source-qualified model handling in idle projection.

A model-less destination was tested live; the alternative destination-with-another-account case was not. Service-peer SSH, Hub, and separate-host placement were outside this run.

Agent signoff -- openai/gpt-6.1-sol

Fixed in 3db37257d21973147603f985fedfdfe473197235.

Idle stats and leaf updates now classify source-owned models from the exact retained caller catalog. Valid offered routes without account evidence report unknown, not unavailable. Retired or replaced admissions remain unavailable without falling back to destination accounts. Ordinary local config/auth refresh and active-run snapshots are unchanged.

Regression coverage checks both projections and the context-aware path, retained-catalog model edits, foreign/missing models, withdrawal/replacement, colliding host accounts, and unloaded leaves. Focused service and Agent race checks passed. Independent review found no blocking code findings; the service and API documentation now describe retained-source idle projection.

The rebuilt live tmux retest used independent local and model-less BYOM daemon processes with isolated XDG homes and SQLite stores. Real Luna inference through the source's configured remote-provider offer completed command/file verification and a subsequent update/readback. After both runs, stats were idle with access_source: unknown, and the footer remained [Unknown]. No remote conversation appeared in the local store. Both test processes exited cleanly.

Final validation on the published head:

  • just test-quick: shipped build, default non-AgentHub root/nested Go scope, 843 Ruby tests, and 248 Python quick tests passed.
  • Focused service/Agent race checks passed.
  • just docs-check: 32 files and 620 local links/anchors passed.
  • Diff and clean-tree checks passed. The PR remains ready for review and unmerged.

This resolves the idle presentation defect recorded in the preceding live acceptance report. No JSONL fields/types, dependencies, or persistent schema changes were added.

Agent signoff -- openai/gpt-6.1-sol

Added 3 commits

  • Project idle BYOM access source from its retained caller catalog3db3725
  • Preserve selected peer policy when resolving remote resources20fb988
  • Keep preferred direct-peer ownership probes local-onlyace7dd4

Configurator-only acceptance

Published head: ace7dd4b91e4c2e72c4537bbee5db6cd3bfc6baa.

Starting with empty isolated environments, Configurator created every provider descriptor, model selection, default model, peer connection, and policy setting. No configuration was copied, generated, or hand-edited. Saved configuration hashes remained unchanged through the live retests; Configurator reload and hello validation passed.

Live tmux acceptance with real Luna passed:

  • Local inference through the configured SSH remote-provider route.
  • Ordinary remote inference using the destination's configured model.
  • Optional BYOM with both catalogs visible, executing caller, destination, then caller again in the same conversation.
  • Required BYOM at a model-less destination, including continuation.

Each inference performed command execution, wrote a nonce-bearing JSON file, read it back, and verified the destination CWD. Remote histories remained destination-owned. Completed live sessions reported idle and access_source: unknown; the footer displayed [Unknown].

The mixed-catalog test exposed an ownership-routing race between aliases with different provider policies pointing to the same destination. 20fb9887 preserves the selected alias and rejects unresolved ownership instead of changing policy. ace7dd4b keeps direct ownership checks on separate local-only terminal sessions, preserving the existing probe/forwarding separation invariant. Confirmed non-ownership still permits discovery elsewhere; pending CWD selection does not block unrelated resource operations.

Focused direct-peer, source-policy, transitive-routing, and selection tests passed, including focused race coverage. The first quick gate exposed the terminal-session regression corrected in ace7dd4b; the complete quick gate retry is pending. No wire fields, persistent schema changes, or dependencies were added.

Both configured model routes used the same authorized upstream account. This acceptance does not establish separation between different billing accounts. Service peers used same-host AF_UNIX connections; upstream model access used SSH. Separate-host service-peer and Hub deployment acceptance remain outside this run.

Agent signoff -- openai/gpt-6.1-sol

Final validation passed on ace7dd4b91e4c2e72c4537bbee5db6cd3bfc6baa: complete just test-quick, including default non-AgentHub root/nested Go coverage, 843 Ruby tests, and 248 Python quick tests. just docs-check checked 32 files and 620 local links/anchors. The 6m02s gate includes the unchanged direct-session separation assertion that failed on 20fb9887. Focused race checks and the rebuilt Configurator-only live acceptance also passed. No current validation failure remains.

Agent signoff -- openai/gpt-6.1-sol

Added 1 commit

  • Complete client routing and retain per-call destination ownershipe5564e9

Independent review

Reviewed head e5564e9bc083da7f642a39a563873c14e0030edf against 9e6e28d17b372fb81305021e2e4095e5a7c9b4a1.

P2: A pending remote leaf admission blocks unrelated leaf commands

pkg/service/peer_control.go:356-363 holds p.cwdMu across the downstream PromptTurn acknowledgement wait. Ordinary forwarded commands acquire the same mutex in pkg/service/peers.go:535-545, also retaining it through their downstream reply. Consequently, a prompt delayed on leaf L1 prevents unrelated commands for leaf L2 from being sent through the same inbound connection and peer alias. Destinations sharing that command owner can be affected as well.

This is a per-leaf isolation regression. The wait is for prompt acceptance, not the full inference run, but acceptance can wait on a leaf gate, lazy Agent recovery, lifecycle-lock contention, or durable append. A healthy destination leaf should remain usable during those waits.

A temporary regression test reproduced the issue using the existing isolated service fixtures and two real JSONL hops:

  1. Send a prompt for B's L1 through A and arrange for admission to wait on L1's leaf gate after routing.
  2. Rename B's L2 directly. This control succeeds while L1 remains blocked.
  3. Rename L2 through the original A connection with a 750 ms deadline. It fails with context deadline exceeded.
  4. Release L1's gate and allow the pending prompt to finish admission.

The focused reproduction failed consistently. It was removed after review; no source changes are included.

Preserve atomic destination selection and request enqueue, but release shared CWD serialization before waiting for the correlated reply. Simply unlocking between UpdateCwd and sending the operation would introduce a destination-selection race. Audit both the dedicated prompt path and generic peerRequest, and add durable prompt-versus-unrelated-command coverage. Preserve exact-generation ownership and the prohibition on replaying uncertain mutations.

Coverage and limitations

Review covered daemon peer routing and inventories, source/provider admission and callback ownership, Go/Ruby caller contexts, Workflow placement/recovery, CLI/TUI Inbox and forwarding, Hub startup policy, and configurator persistence. No additional actionable findings were substantiated in those areas.

Existing focused routing, inventory, reply-fidelity, prompt-completion, virtual-root, source-lifecycle, callback-ownership, and managed-environment checks passed. These passes do not cover the isolation failure above. Broad build/quick results reported for this head were reused, not rerun. No new live-provider, manual TUI, deployed SSH/Hub, or full-repository validation was performed.

Recommendation: address the P2 isolation issue before merging.

Agent signoff -- openai/gpt-6.1-sol

Fixed in adaea8b728afa097fff996c4f267ae935d099df6.

The retained peer connection now serializes destination selection and target enqueue, then releases cwdMu before waiting for the correlated reply. The enqueue notification is installed after the selector RPC, and one-shot release also covers validation, cancellation and send failures. This preserves request ordering without reconnecting, changing generations or replaying uncertain mutations.

The same boundary covers generic forwarding, prompt admission, create/fork preflights, catalog follow-ups, tool acceptance and indirect ownership reads. Multi-read paths reselect their captured destination for each request.

Durable direct and common-hop regressions reproduce the reported prompt-versus-unrelated-leaf failure and the analogous pending-history case. Before the fix, all four forwarded renames timed out at 750 ms while direct controls succeeded. With the fix, each rename completes before the blocked operation is released. Additional checks cover destination capture, enqueue ordering, completion correlation and failure cleanup.

Validation on the published head:

  • Focused Go SDK/service behavior and race selections passed.
  • just build and complete just test-quick passed, including default non-AgentHub root/nested Go coverage, 850 Ruby tests and 248 offline Python quick tests.
  • Documentation and diff checks passed.

No JSONL fields, messages, capabilities, dependencies or SQLite changes were introduced. The added-field inventory is unchanged. Separate-host/live-provider acceptance was not repeated for this lock-scope correction.

Agent signoff -- openai/gpt-6.1-sol

Added 3 commits

  • Release peer CWD locks after request enqueueadaea8b
  • Merge main through PR #43 for CWD listing semantics0dfc1bd
  • Carry CWD visibility through v2 workspace discovery71a6ed4

Merged main through 9532fd35, including PR #43 and the intervening PR #42 changes. Merge commit 0dfc1bd9 preserves both histories; v2 integration is completed in 71a6ed44b071e1fe552b1c74df0b402defc45182.

  • CWD summaries remain destination-local and now preserve PR #43's running/aborting/background activity counts through direct and common-hop v2 calls. Temporary and zero-turn leaves do not contribute CWDs, counts or timestamps; forks with inherited history qualify.
  • Global and qualified list_leaves.is_active remain execution-only. Temporary and empty running/aborting leaves are still returned, while background leaves are excluded. Ordinary root and leaf inventories remain unfiltered by CWD visibility.
  • Bounded service.workspaces CWD discovery uses the same qualification without extending its root sample to find matches. Duplicate and ineligible roots retain their scan/byte cost. Qualification can examine multiple indexed leaves within each sampled root; the sample bound is not a bound on every SQLite row visit.
  • Bare-path routing checks persisted roots independently of discovery visibility. Empty, temporary-only and orphan local roots cannot fall through to a remote CWD collision. Qualified service/path and resource access remain available.

Validation on the published head passed: just build, both real-daemon test_cwd_activity.py cases, focused storage and direct/common-hop service race tests, Go/Ruby typed CWD consumers, and complete just test-quick with 850 Ruby tests and 248 offline Python quick tests. Documentation and diff checks passed.

No new wire members, message types, dependencies or persistent schema changes were added. No live inference or manual TUI journey was repeated for this integration.

Agent signoff -- openai/gpt-6.1-sol

Added 2 commits

  • Add core v2 build identity and shutdown readiness messagesd9f52cb
  • Stamp Git revision explicitly in standard buildsa8be96a

Core v2 version and shutdown messages

Published head: a8be96a02be40883807f8a1d605fa3288823d9a3.

  • Add correlated version / version_result for the receiving daemon, independent of selected remote views. Release identity starts at embedded 0.2.0 with separate alpha stability, UTC build date and Git commit. Standard builds stamp the date and revision explicitly; direct builds retain honest unavailable-metadata fallbacks and link-time overrides.
  • Add optional strict-boolean hello.clean_restart, false and omitted by default. No existing client, CLI, TUI, provider or peer automatically opts in. The client capability is not echoed as server support.
  • Add a separate v2 shutdown reason for restart and upgrade, plus explicit correlated shutdown_ready. Go/Ruby SDKs expose notification handling and readiness sends without automatic acknowledgements or ordinary RPC completion. V1 shutdown encoding and the existing daemon shutdown trigger remain compatible.

This change provides messages only. It does not add broadcast, readiness tracking, shutdown grace/deadline enforcement, admission blocking or live-upgrade continuity. Other shutdown reasons remain future scope.

Validation passed:

  • Full build and just test-quick on d9f52cbe: default non-AgentHub Go scope, 862 Ruby tests and 250 offline Python quick tests.
  • Final-head full build and all 10 protocol integration cases after the build-recipe-only metadata follow-up.
  • Focused lifecycle race tests, metadata override checks and direct-build metadata-fallback integration tests.
  • Documentation and diff checks.

No dependencies or persistent SQLite changes were added. No live-model or manual TUI acceptance was repeated for these message additions.

Agent signoff -- chatgpt/gpt-6.1-sol

Added 1 commit

  • Merge main through PR #47 into PR #3724a7d83

Main refresh

Merged main through 7facda261325010a22d81ba1407c7f66c03f5828, including PRs #44 through #48. Published head: 24a7d83bc94ce1ffddb748652c00c1acd0452959.

The merge combines composable/default model sources and provider sharing, remembered model limits/access sources, interpreter-specific command output and the upstream provider transport/recovery fixes with PR #37's source-aware routing.

Integration corrections preserve:

  • Captured source routing and required-provider restrictions, including model-less destinations and retained source configuration fields.
  • Remembered metadata ownership by exact caller offer or configured socket/SSH destination, so retired offers and repointed aliases cannot reuse another destination's evidence.
  • Default-source catalog projections in builtin metadata and Configurator project editing without hiding explicit remote choices behind local overrides.
  • Interpreter-aware background completion and provider loss with retained caller context and exact-once insertion.
  • V1/local-only behavior, peer command/stat independence, and the core v2 version/shutdown messages. Clean restart remains opt-in and off for all existing callers; shutdown coordination is still out of scope.

Validation passed on the published head: full build and just test-quick with 862 Ruby tests and 250 offline Python quick tests; focused integration and narrow source/background race checks; documentation, catalog, formatting and diff checks.

No additional dependency, SQLite schema/version change or JSONL contract addition was introduced by the integration corrections. No live-model or manual TUI acceptance was repeated for this refresh.

Agent signoff -- chatgpt/gpt-6.1-sol

Added 1 commit

  • Preserve last-known remote context limitsc73100c

Preserve last-known remote context limits

Published head: c73100cfe034b13bc97a2e0d4d2134bd6f3b3139.

Restore remembered context-limit behavior in primary/default remote model-source mode. A known maximum for the selected model reference remains available during upstream outages, managed callbacks and owner changes. It is informational model metadata, not an inference-eligibility or access-source check.

  • Remove the metadata-read guard that required caller/route validation before displaying a saved maximum. Known limits no longer require catalog discovery or an effective-config lookup.
  • Preserve the limit across partial updates for the same selected reference. A new positive reported limit replaces it, including a smaller value. Distinct model selections and late reports cannot borrow unrelated limits.
  • Keep existing best-effort catalog lookup for older records with no known maximum; missing limits remain unknown. Existing known values do not require the newer owner-key format.
  • Keep access-source observations and inference admission bound to their owners. Retired offers and changed destinations do not inherit access-source labels through the context-limit fallback.

This corrects an overly broad restriction introduced during the main refresh in 24a7d83b. It does not remove default-source discovery, ordinary provider/model references, local overrides, or explicit source choices.

Validation passed on the published head: full build and just test-quick with 862 Ruby tests and 250 offline Python quick tests; focused metadata/storage/service checks and narrow storage/idle-ownership race tests; documentation and diff checks. Tests verify replacement after metadata reaches storage, not a new push-triggered persistence mechanism. Catalog discovery and snapshot reads remain read-only.

No dependencies, schema changes or JSONL contract additions were introduced. No live-model or manual TUI checks were run.

Agent signoff -- chatgpt/gpt-6.1-sol

Added 3 commits

  • Merge main through PR #50 into PR #3720fa197
  • Align remote CWD rejection regression with shared validation75ec617
  • Observe bounded Inbox discovery in the shipped Hub regression5f787b4

Main refresh through PR #50

Merged main at 7910d15ee1ec11fa4230da7614a573b0e07f0603 into PR #37 with merge commit 20fa1976a29bfda09a0a0254cae951c8494a67ab, preserving both histories. Published head: 5f787b49177c69d28626c9a29bf8e7a3cfd126ee.

  • Combine PR #49's named connections, interactive SSH setup, directory picker and grouped Inbox with source-qualified peer routing. Preserve basename/dropdown UX for basic local and physical-remote use, independent source identities and authoritative open-leaf roots.
  • Keep built-in Local readiness/autolaunch separate from custom endpoints. Reuse established SSH forwards for independent discovery without a second authentication exchange or ownership of the chat forward. Legacy provider discovery remains noninteractive and v1; independent sessions retain v2 policy and callbacks.
  • Pin cache cleanup and natural-language snooze inference, including cleanup, to independent sessions owned by the original service/root. Delayed replies cannot redirect mutations through a newly selected directory or same-ID leaf.
  • Preserve PR #50's symlinked caller-root support and managed-descendant confinement. Extend that distinction to coordinator-local Workflow buffer and create-intent storage, rejecting linked or replaced managed records without remote-path trust or replaying uncertain creations.
  • Preserve primary remote-model UX, informational remembered context limits and all core v2 version/shutdown messages. No current caller opts into clean restart; shutdown coordination remains out of scope.

Validation passed on the published head:

  • Complete just test-quick on 75ec6170: 871 Ruby tests, 250 offline Python quick tests and default non-AgentHub Go coverage. Final-head full build passed after a follow-up limited to the Linux build-tagged Hub process observer.
  • Both targeted shipped Hub startup/application and typed-migration process cases.
  • Focused integration checks and narrow TUI races; Ruby evidence/placement/lifecycle and symlink confinement checks; packaged helper loading.
  • Darwin/amd64 CLI/TUI test compilation, documentation, formatting and diff checks.

No dependencies, SQLite schema/version changes or JSONL contract additions were introduced by the integration corrections. Windows runtime/DACL checks, live SSH authentication and a manual TUI journey were not run. Ruby coordinator-local descriptor-relative writes require Linux, consistent with the shipped companion.

Agent signoff -- chatgpt/gpt-6.1-sol

Added 2 commits

  • Merge main through PR #52 into PR #37f5fa59f
  • Use draft-aware teardown for the settle transition regression1dfdcc4

Main refresh through PR #52

Merged main at 0fe3eb880dbd56ad07a9867095c7f61fd7c2462a into PR #37 with merge commit f5fa59fff730a921d960ce544388ef9140d7c2ad. Published head: 1dfdcc4140ab8ae5769383ad666de2ae70050cb5.

  • Preserve PR #51's recovery from a rejected draft creation through /cwd. Cover local, remote-connection and qualified-peer directories without deleting a helper that never persisted.
  • Preserve PR #52's persistent database node_id and optional external-provider hello field. Adapt the PR #37-only provider client caller and verify that the source-host path retains the consumer's node_id/session_id while applying host-owned credentials and launch options.
  • Use the existing draft-aware fixture for the Ctrl+S settle transition, so teardown drains admitted UI continuations before joining Inbox/helper workers. Production code and transition assertions are unchanged by this follow-up.
  • Retain runtime sender_id, source generations and exact provider admissions. Database identity is not authentication or a replacement for runtime ownership. Copies retain their database identity, so it is not sufficient for live-route deduplication or freshness.

Validation passed on the published head: full build and EZ_AGENT_GO_TEST_TIMEOUT=5m just test-quick, including default non-AgentHub Go coverage, 871 Ruby tests and 250 offline Python quick tests, in 6m47s. Focused recovery/provider/storage checks and narrow TUI/storage races passed. Documentation checks passed for 32 files and 620 links/anchors; formatting and diff checks passed. No live-model or manual TUI checks were run for this refresh.

No additional dependency, storage change or core JSONL field was introduced by the integration corrections. The upstream external-provider addition does not expose a generic service-properties API or implement Claude-specific behavior.

Agent signoff -- chatgpt/gpt-6.1-sol

Added 3 commits

  • Pass optional persistent peer identity in v2 hello442ac81
  • Merge PR #53 service acknowledgement identity into PR #378c0f73f
  • Allow peer policy runtimes without persisted identitybd939ed

Persistent identity exchange

Published head: bd939ede841b1fccaada8ee77c8f1fd8e8ed8ab2. PR #53 source head 5f3bb7196487e4607765553f3bb7adeccc3ebb51 is included by merge commit 8c0f73fc; main is included through 0fe3eb88.

Add optional node_id to initiating v2 hello and integrate PR #53's receiving-service identity in hello_ack.

  • Directed peer command, subscription-feed and local-only probe sessions send the initiating service's persisted database identity. Each hop identifies itself, not the original caller. Ordinary clients omit the field unless explicitly supplied through the Go or Ruby API.
  • Retain the initiating identity separately from the assigned connection ID. Multiple connections advertising the same node remain independent. Runtime discovery, caller/source generations and provider admissions are unchanged.
  • Preserve PR #53's receiving-service hello_ack.node_id in v1/v2, including Go hooks, Ruby accessors and TUI callbacks, without losing negotiated v2 policy. The acknowledgement identifies the receiver; it does not echo the initiating identity. Bootstrap/older-service omission remains supported.
  • Cover identity preservation through Hub policy rewriting and independent peer command/feed/probe sessions. Align the upstream malformed-identity fixture with this branch's v2 client default.

Validation passed on the published head: full build and quick suite with default Go coverage, 878 Ruby tests and 250 offline Python tests, in 6m58s. Focused protocol/API/service/TUI and Hub proxy checks, narrow peer/TUI races, 59 focused Ruby tests, documentation and diff checks passed. Independent static review found no blocking findings. Policy-only runtimes without storage retain an unspecified identity, while normal service peers send the stored ID. No live-model or manual TUI checks were run.

No restart/resume behavior, handoff flags, identity-based authorization, route deduplication or new database changes are included.

Agent signoff -- chatgpt/gpt-6.1-sol

Added 16 commits

  • Merge main through PR #53 into PR #37bcae6f6
  • Merge public/main into PR #37e281d11
  • Restore comments lost in the main mergecbc1dfb
  • Merge public/main into PR #37b4e3767
  • Track remote child servers and keep sidebar browsing passive144d4f3
  • Include Connection Details in the sidebar command regression746b174
  • Expect the destination default thinking level for cross-CWD childrenbea16aa
  • Remove state_dir from v2 startup acknowledgements629f23c
  • Update frontend v2 handshake expectation1f20598
  • Isolate standalone builtin tests through launch XDG roots8b566c5
  • Isolate builtin request-response fixtures before launchf1771b5
  • Merge main into PR #37db29fee
  • Teach raw v2 fixtures to complete extra discovery52a554c
  • Merge main lazy extra discovery into PR #37f2ba803
  • Keep force-kill regression focused on process cleanupf0e4d9f
  • Merge main into PR #37e90b566