Skip to content

feat: add extensible owned-node command system - #1002

Merged
ndizazzo merged 13 commits into
mainfrom
codex/owned-node-commands-plan
Jul 18, 2026
Merged

feat: add extensible owned-node command system#1002
ndizazzo merged 13 commits into
mainfrom
codex/owned-node-commands-plan

Conversation

@ndizazzo

@ndizazzo ndizazzo commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

#991 Should merge first!

Purpose

Provide an extensible, private command path for operating one explicitly targeted, owner-attested node without adding another transport or coupling node management to the public mesh plane.

This makes remote inventory scan/refresh the first supported owned-node command and hardens the existing owner-control lifecycle before future mutating operations are added.

What changed

  • decomposed the oversized mesh implementation and tests into semantically owned modules without changing public behavior
  • hardened owner-control framing and lifecycle:
    • rejects oversized outbound frames before writing a prefix or body
    • bounds connect, stream-open, handshake, request, unary, and scan phases
    • keeps accepted watch streams long-lived
    • limits each connection to 32 concurrent stream workers
    • preserves non-zero request IDs through wraparound
    • narrows legacy probing to ambiguous negotiation failures
    • preserves last-good inventory and advertisements when scans fail
  • extended the existing refresh_inventory = 5 operation additively with:
    • deterministic, sorted inventory entries
    • optional compact model metadata
    • executed versus coalesced disposition
  • made coalesced scans return the same snapshot while performing one loader scan
  • routed all current commands through one typed, authenticated dispatcher with shared target, requester, deadline, and response-size policy
  • exposed the new result through:
    • mesh-client::scan_refresh()
    • loopback-only POST /api/runtime/control/scan-refresh
    • visible mesh-llm runtime scan-refresh --endpoint <token>
  • retained the old snapshot-only client, REST route, and hidden CLI spelling for compatibility
  • documented operator usage, protocol extension rules, compatibility/privacy boundaries, runtime QA, and the public website CLI/API reference

Why

The existing private owner-control lane already had the correct authentication and transport boundary, but inventory refresh only returned a legacy snapshot and several lifecycle phases were not sufficiently bounded for a broader command surface. In particular, command deadlines were defined but not enforced server-side, and oversized outbound payloads needed rejection before any frame bytes were emitted.

Extending the shipped typed protobuf envelope keeps ownership and compatibility explicit while avoiding a second control protocol, opaque command registry, endpoint inference, or changes to public discovery/routing.

Compatibility and security

  • no ALPN, public stream ID, gossip/Nostr field, route-table field, or /api/status schema change
  • refresh_inventory = 5 and response snapshot = 1 remain unchanged; rich inventory is additive tag 2
  • new clients accept snapshot-only responses from older servers
  • endpoint tokens are explicit, out-of-band, and never inferred from peer IDs or public state
  • owner authentication happens before command dispatch
  • REST orchestration remains loopback-only
  • rich command results remain private and are not copied into gossip, peer state, or status
  • future start/stop/load/unload commands are documented extension targets only and are not implemented here

Validation

  • just test-all
    • repository consistency, formatting, and Clippy passed
    • host runtime: 1,606 passed, 8 ignored
    • UI: 899 passed, 3 skipped
    • Playwright: 2 passed, 1 skipped
  • just build
  • just website-build
  • focused owner-control, protocol compatibility, client, REST, CLI, coalescing, timeout, oversize, request-ID, and failure-preservation tests
  • current/current runtime QA:
    • same-owner typed scan refresh succeeded
    • wrong-owner scan refresh was rejected with HTTP 403 before execution
    • no owner-control endpoint data appeared in status
  • released v0.73.1/current public-mesh QA:
    • join, model exposure, routed inference, and privacy checks passed in both directions

Summary by CodeRabbit

  • New Features

    • Added targeted runtime scan-refresh CLI command and loopback REST endpoint for owner-controlled inventory rescans.
    • Scan-refresh responses now provide target_node_id, disposition (executed/coalesced), and optional typed inventory details; older servers may return inventory: null while the request still succeeds.
  • Bug Fixes

    • Hardened owner-control and refresh flows with stricter frame sizing/validation, safer request-id generation, improved watch/timeout behavior, and more accurate control-plane negotiation errors.
    • Deterministic named mesh IDs and more robust mesh identity/“last mesh” persistence.
  • Documentation

    • Updated CLI/API/usage and protocol guidance for scan-refresh semantics and compatibility behavior.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change adds typed owner-control scan refresh across protocol, client, server, REST, CLI, and documentation layers. It also reorganizes mesh runtime modules and adds connection, identity, admission, gossip, stage transport, artifact transfer, plugin, persistence, and validation implementations.

Changes

Owner-control scan refresh

Layer / File(s) Summary
Protocol and client flow
crates/mesh-llm-protocol/..., crates/mesh-client/...
Adds typed inventory responses, strict validation, compatibility handling, bounded frame writes, explicit deadlines, watch acceptance buffering, and non-zero request IDs.
Server command execution
crates/mesh-llm-host-runtime/src/mesh/owner_control/..., crates/mesh-llm-host-runtime/src/runtime_data/...
Adds typed scan-refresh decoding, inventory coalescing outcomes, error propagation, ownership checks, and bounded response handling.
Operator surfaces
crates/mesh-llm/..., crates/mesh-llm-host-runtime/src/api/..., docs/..., website/..., scripts/...
Adds the scan-refresh CLI and loopback REST route, formats typed results, extends QA validation, and documents compatibility and limits.

Mesh runtime

Layer / File(s) Summary
Mesh foundation and identity
crates/mesh-llm-host-runtime/src/mesh/{mod,node,connections,peer_state,...}.rs
Adds module wiring, node startup, connection management, identity persistence, invite tokens, requirement policies, peer state, routing, and gossip behavior.
Stage, artifact, plugin, and bridge networking
crates/mesh-llm-host-runtime/src/mesh/{stage_*,artifact_transfer_io,plugin_*,stun}.rs
Adds stage control and transport handling, resumable artifact transfer, plugin forwarding, stream bridges, authorization, and public-address discovery.
Runtime validation
crates/mesh-llm-host-runtime/src/{mesh/tests,protocol/tests,runtime_data/tests}/...
Adds admission, connection, gossip, protocol, owner-control, stage, inventory, persistence, and compatibility coverage.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers: michaelneale

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant RuntimeAPI
  participant OwnerControlClient
  participant OwnerControlNode
  participant InventoryScanner
  CLI->>RuntimeAPI: POST /api/runtime/control/scan-refresh
  RuntimeAPI->>OwnerControlClient: Connect with endpoint token
  OwnerControlClient->>OwnerControlNode: Send typed refresh_inventory request
  OwnerControlNode->>InventoryScanner: Coalesce inventory scan
  InventoryScanner-->>OwnerControlNode: Return snapshot and disposition
  OwnerControlNode-->>OwnerControlClient: Return snapshot and optional inventory
  OwnerControlClient-->>RuntimeAPI: Map scan-refresh result
  RuntimeAPI-->>CLI: Return human-readable or JSON output
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 56.40% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding an extensible owned-node command system.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/owned-node-commands-plan

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request is currently a draft. Reviews will not take place until the PR is marked as ready for review.

@ndizazzo ndizazzo changed the title Add extensible owned-node scan refresh commands feat: add extensible owned-node command system Jul 15, 2026
@ndizazzo ndizazzo self-assigned this Jul 16, 2026
@ndizazzo
ndizazzo force-pushed the codex/owned-node-commands-plan branch from 5c66f88 to 11795d1 Compare July 18, 2026 04:20
@ndizazzo
ndizazzo marked this pull request as ready for review July 18, 2026 04:20
@github-actions
github-actions Bot requested a review from michaelneale July 18, 2026 04:20

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Due to the large number of review comments, Critical severity comments were prioritized as inline comments.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
crates/mesh-llm-host-runtime/src/protocol/tests.rs (1)

1-1760: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

Split this near-limit test module by responsibility.

At 1,760 lines, this new file is already approaching the 2,000-line limit. Move the owner-control, peer lifecycle, announcement, and config-roundtrip suites into named test submodules.

As per coding guidelines, “If a file is approaching that size, split it by responsibility into an owning module instead of adding more code to the oversized file.” <coding_guidelines>

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/protocol/tests.rs` around lines 1 - 1760,
Split the oversized tests module by responsibility: move the owner-control
tests, peer lifecycle tests, peer announcement/protocol conversion tests, and
configuration round-trip tests into separate named test submodules. Keep shared
fixtures and helpers such as make_valid_gossip_frame, make_test_peer_info,
make_config_snapshot, and make_nested_mesh_config in a shared scope or expose
them as needed, and leave only shared wiring or broadly applicable tests in the
parent module.

Source: Coding guidelines

crates/mesh-llm-host-runtime/src/mesh/gossip.rs (1)

365-449: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Validate the direct sender before applying any announcement.

When direct_peer_requirements_validated is false, sender-controlled ordering allows transitive peers to be applied before the direct announcement is checked. The direct branch also calls set_mesh_id before validation. A rejected peer can therefore seed mesh identity or peer state.

Pre-locate and validate the remote peer’s direct announcement, then adopt its mesh ID and process the remaining announcements.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/gossip.rs` around lines 365 - 449,
Update apply_announced_peers to locate the announcement whose endpoint ID
matches remote and, when direct_peer_requirements_validated is false, validate
it with validate_direct_peer_requirements before processing any announcements.
Only after successful validation should it adopt the announcement’s mesh ID and
process the remaining entries, ensuring rejected senders cannot seed mesh
identity or transitive peer state; preserve apply_announced_peer’s existing
handling for already-validated direct peers.
🟠 Major comments (23)
crates/mesh-llm-host-runtime/src/mesh/owner_control/mod.rs-337-355 (1)

337-355: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Bound server response writes, including the timeout fallback.

If the peer stops reading, the original response write can consume the command deadline; the fallback then calls the same unbounded writer and may hang indefinitely. Apply a write timeout and close/reset the stream when it expires.

Also applies to: 862-869

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/owner_control/mod.rs` around lines 337
- 355, The owner-control response writers send_owner_control_envelope and
send_owner_control_terminal_envelope must enforce a write timeout, including the
terminal fallback path. Wrap the length-prefixed write with the command
deadline, and when it expires close or reset the SendStream before returning the
timeout error so neither the initial response nor the fallback can hang
indefinitely.
crates/mesh-client/src/client/control_plane.rs-383-386 (1)

383-386: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Leave delivery margin between the server deadline and client timeout.

Both sides currently use 30 seconds, so a scan completing near the server deadline cannot reliably deliver its result or timeout envelope before the client reports a transport timeout.

  • crates/mesh-client/src/client/control_plane.rs#L383-L386: increase the response timeout above the complete server-side execution budget.
  • crates/mesh-llm-host-runtime/src/mesh/owner_control/commands/mod.rs#L145-L145: retain or centralize the 30-second execution deadline while ensuring clients add transport margin.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-client/src/client/control_plane.rs` around lines 383 - 386, The
client response timeout in send_unary_request must exceed the server’s 30-second
execution deadline by a delivery margin; update the timeout used by the
control-plane request in crates/mesh-client/src/client/control_plane.rs (lines
383-386) while retaining or centralizing the 30-second execution deadline in
crates/mesh-llm-host-runtime/src/mesh/owner_control/commands/mod.rs (line 145),
which requires no direct increase.
crates/mesh-llm-host-runtime/src/mesh/identity_persistence.rs-3-15 (1)

3-15: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Use the documented stable mesh-ID algorithm.

This produces a 64-bit DefaultHasher value, not the documented SHA-256 digest. Named meshes therefore have a different format, weaker collision resistance, and no explicit cross-version algorithm contract. Introduce a fixed digest plus compatibility handling for existing IDs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/identity_persistence.rs` around lines 3
- 15, Update generate_mesh_id to compute named mesh IDs using the documented
SHA-256 input format and return the full stable digest rather than a
DefaultHasher value. Preserve unnamed mesh UUID persistence, and add
compatibility handling so existing generated IDs remain recognized or resolvable
while new named IDs use the fixed algorithm.
crates/mesh-llm-host-runtime/src/mesh/stage_artifacts.rs-121-137 (1)

121-137: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Local stage-control waits have no deadline, so a stalled control loop can retain callers indefinitely. Apply the command-specific timeout consistently.

  • crates/mesh-llm-host-runtime/src/mesh/stage_artifacts.rs#L121-L137: bound inbound peer command execution.
  • crates/mesh-llm-host-runtime/src/mesh/stage_transport.rs#L814-L822: bound local API command execution.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/stage_artifacts.rs` around lines 121 -
137, Apply the command-specific timeout to both stage-control execution paths:
wrap the response wait in execute_stage_control_request in stage_artifacts.rs
and the corresponding local API command wait in stage_transport.rs (lines
814-822) with the established timeout mechanism, returning the timeout error
consistently while preserving existing send and response-drop errors.
crates/mesh-llm-host-runtime/src/mesh/stage_transport.rs-966-1011 (1)

966-1011: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Make stage-bridge creation atomic per key.

Two concurrent calls can both pass contains_key, spawn listeners, and then overwrite one JoinHandle; the losing bridge remains running but cannot be stopped through the map. Reserve the key under the lock before binding/spawning, and roll back the reservation on failure.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/stage_transport.rs` around lines 966 -
1011, Make stage-bridge creation in the surrounding method atomic by reserving
the computed key in stage_transport_bridges before binding the listener or
spawning the task, rejecting an existing reservation. If listener binding or
task setup fails, remove the reservation before returning the error; otherwise
replace the reservation with the running JoinHandle without allowing concurrent
calls to overwrite it.
crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs-218-243 (1)

218-243: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Requirement-aware mesh state is published and read through independent locks, allowing partial snapshots. Replace these fields with one synchronized state object.

  • crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs#L218-L243: commit mesh ID, policy/hash, signed policy, and bootstrap token atomically.
  • crates/mesh-llm-host-runtime/src/mesh/node_identity.rs#L117-L139: read that atomic snapshot so requirement-aware setup cannot emit a legacy invite token.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs` around lines 218
- 243, The requirement-aware mesh fields currently use independent locks and can
expose partial state. Introduce or reuse one synchronized state object, update
install_requirement_aware_mesh_state in
crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs:218-243 to atomically
commit mesh ID, policy/hash, signed policy, and bootstrap token, and update the
corresponding read path in
crates/mesh-llm-host-runtime/src/mesh/node_identity.rs:117-139 to consume one
atomic snapshot and avoid emitting a legacy invite token.
crates/mesh-llm-host-runtime/src/mesh/stage_artifacts.rs-783-795 (1)

783-795: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Add an idle timeout to artifact-transfer writes.

A peer that stops reading can block write_all indefinitely while retaining the file, stream, and task. Bound each write or the transfer loop with a write-idle timeout.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/stage_artifacts.rs` around lines 783 -
795, Update the artifact transfer loop around the write_all call to enforce a
write-idle timeout, so a peer that stops reading cannot retain the file, stream,
and task indefinitely. Wrap each send.write_all operation, or the transfer loop,
with the existing timeout mechanism and propagate a contextual timeout error
while preserving normal chunked transfer behavior.
crates/mesh-llm-host-runtime/src/mesh/identity_persistence.rs-106-111 (1)

106-111: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Identity persistence fails open because filesystem errors are discarded. Propagate these failures so startup cannot continue with identity state that was never recorded.

  • crates/mesh-llm-host-runtime/src/mesh/identity_persistence.rs#L106-L111: require successful public-mode marker persistence before continuing.
  • crates/mesh-llm-host-runtime/src/mesh/identity_persistence.rs#L25-L35: return an error instead of publishing an unpersisted random mesh ID.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/identity_persistence.rs` around lines
106 - 111, Update
crates/mesh-llm-host-runtime/src/mesh/identity_persistence.rs:106-111 so
mark_was_public propagates create_dir_all and write failures, requiring
successful marker persistence before continuing; update
crates/mesh-llm-host-runtime/src/mesh/identity_persistence.rs:25-35 so the
identity-loading flow returns an error instead of publishing a random mesh ID
when persistence fails.
crates/mesh-llm-host-runtime/src/mesh/stage_transport.rs-1153-1155 (1)

1153-1155: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Timeout the stream-kind read before accepting the next stream.

The accept loop waits here serially, so one admitted peer can open a bidirectional stream, send no type byte, and block every subsequent stage stream on that connection.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/stage_transport.rs` around lines 1153 -
1155, Update the stream-kind read in the accept loop to apply the established
stream-read timeout before awaiting recv.read_exact, and treat timeout or other
read failure as StageStreamAccept::Continue. Ensure a peer that sends no type
byte cannot block acceptance of subsequent stage streams.
crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs-69-105 (1)

69-105: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Do not silently rotate genesis policy after read or validation failures.

Any I/O, parse, or signature failure falls through to generating a new timestamped policy, changing the policy-derived mesh ID and partitioning the node from its existing mesh. Only NotFound should create a policy; surface corruption and read failures.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs` around lines 69 -
105, Update load_or_create_signed_genesis_policy so only a missing policy file
generates a new signed policy. Propagate filesystem read errors, and surface
JSON parse or existing-policy validation failures—including verify, owner ID,
requirements, and signing-key mismatches—instead of silently creating a
timestamped replacement; preserve returning the valid existing policy unchanged.
crates/mesh-llm-host-runtime/src/mesh/node_identity.rs-217-223 (1)

217-223: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Allow the valid cached-token fallback after signing fails.

Returning Some(String::new()) makes the caller return immediately, so its cached-token fallback is unreachable. Return None on failure.

Proposed fix
             Err(error) => {
                 tracing::warn!(
                     error = %error,
                     "failed to sign requirement-aware bootstrap token; refusing to emit legacy invite token"
                 );
-                Some(String::new())
+                None
             }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/node_identity.rs` around lines 217 -
223, Update the signing failure branch in the requirement-aware bootstrap token
flow to return None instead of Some(String::new()), allowing the caller’s
cached-token fallback to execute. Preserve the existing warning log and
successful signing behavior.
crates/mesh-llm-host-runtime/src/mesh/node.rs-1854-1877 (1)

1854-1877: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Use saturating age calculations for gossiped timestamps.

merge_remote_demand accepts peer-provided last_active values. A future timestamp makes now - d.last_active underflow, panicking with overflow checks or becoming a huge age and incorrectly dropping demand.

Proposed fix
-        demand.retain(|model, d| pinned.contains(model) || (now - d.last_active) < DEMAND_TTL_SECS);
+        demand.retain(|model, d| {
+            pinned.contains(model)
+                || now.saturating_sub(d.last_active) < DEMAND_TTL_SECS
+        });
...
-            .filter(|(model, d)| pinned.contains(model) || (now - d.last_active) < DEMAND_TTL_SECS)
+            .filter(|(model, d)| {
+                pinned.contains(model)
+                    || now.saturating_sub(d.last_active) < DEMAND_TTL_SECS
+            })

Also applies to: 1879-1900

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/node.rs` around lines 1854 - 1877,
Update the demand age calculation in gc_demand, and any corresponding filtering
logic in the adjacent demand code, to use saturating subtraction when comparing
now against peer-provided last_active timestamps. Ensure future timestamps
produce age zero rather than underflowing, while preserving the existing TTL and
pinned-model retention behavior.
crates/mesh-llm-host-runtime/src/mesh/connections.rs-1469-1484 (1)

1469-1484: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Publish replacement connections only after gossip succeeds.

Both paths install and dispatch a connection before its gossip exchange is validated, with no rollback on failure. This leaves unadmitted connections tracked or replaces a healthy connection with a failed reverse dial.

  • crates/mesh-llm-host-runtime/src/mesh/connections.rs#L1469-L1484: on gossip failure, remove and close the inserted connection, or delay insertion/dispatch until gossip succeeds.
  • crates/mesh-llm-host-runtime/src/mesh/direct_path.rs#L429-L461: retain the previous connection until reverse-dial gossip succeeds; close the new connection and preserve/restore the old one on failure.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/connections.rs` around lines 1469 -
1484, Ensure connection publication and stream dispatch occur only after
initiate_gossip succeeds: in
crates/mesh-llm-host-runtime/src/mesh/connections.rs lines 1469-1484, either
defer insertion and dispatch until gossip completes or remove and close the
inserted connection on failure. In
crates/mesh-llm-host-runtime/src/mesh/direct_path.rs lines 429-461, retain the
existing connection while reverse-dial gossip runs, close the replacement on
failure, and preserve or restore the previous connection; publish the
replacement only after successful gossip.
crates/mesh-llm-host-runtime/src/mesh/node.rs-57-76 (1)

57-76: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Correlate and validate STUN responses before advertising their address.

The current flow accepts any sufficiently shaped UDP packet received on the socket. It does not verify the sender, Binding Success response type, declared length, magic cookie, or transaction ID.

  • crates/mesh-llm-host-runtime/src/mesh/node.rs#L57-L76: retain the recv_from source and reject responses not originating from the probed server.
  • crates/mesh-llm-host-runtime/src/mesh/connections.rs#L209-L228: validate the STUN header and request transaction ID before parsing mapped-address attributes.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/node.rs` around lines 57 - 76, Validate
STUN responses across probe_stun_server and parse_stun_public_addr: in
crates/mesh-llm-host-runtime/src/mesh/node.rs:57-76, retain recv_from’s source
and reject packets not from the resolved server; in
crates/mesh-llm-host-runtime/src/mesh/connections.rs:209-228, require a valid
STUN Binding Success header, declared message length, magic cookie, and matching
request transaction ID before parsing mapped-address attributes.
crates/mesh-llm-host-runtime/src/mesh/node.rs-923-1114 (1)

923-1114: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

Split this module before it crosses the crate’s file-size limit.

This new file is already 1,934 lines. Move startup construction and one or more state domains—capture, metrics, model state, or control-listener lifecycle—into owning modules before further growth.

As per coding guidelines, “Do not add Rust source files over 2,000 lines. If a file is approaching that size, split it by responsibility into an owning module.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/node.rs` around lines 923 - 1114, Split
the oversized node module before adding further code: extract the startup
construction centered on Node::start and at least one cohesive state domain such
as capture, metrics, model state, or control-listener lifecycle into an owning
module. Move its related fields, initialization, and methods together, update
imports and call sites, and keep Node::start behavior unchanged while keeping
the original file below the 2,000-line limit.

Source: Coding guidelines

crates/mesh-llm-host-runtime/src/mesh/connections.rs-317-330 (1)

317-330: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Return an error for malformed relay URLs instead of panicking.

RelayConfig.urls is configuration input; one invalid URL reaches expect and aborts node startup. Make this builder return Result<RelayMap> and propagate URL-specific parse context.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/connections.rs` around lines 317 - 330,
Update relay_map_from_urls to return Result<iroh::RelayMap> instead of panicking
on malformed configuration. Replace the expect in URL parsing with error
propagation that includes the invalid URL as context, and collect or propagate
the iterator’s parse errors before constructing the RelayMap with
iroh::RelayMap::from_iter.
crates/mesh-llm-host-runtime/src/mesh/plugin_mesh.rs-204-217 (1)

204-217: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Bound plugin-frame reads with deadlines.

An admitted peer can send a length prefix and indefinitely stall the body, retaining one spawned task and QUIC stream per request. Apply timeouts to both the prefix and payload reads for channel and bulk frames.

Also applies to: 284-297

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/plugin_mesh.rs` around lines 204 - 217,
Update handle_plugin_channel_stream and the corresponding bulk-frame read path
to apply bounded deadlines to both recv.read_exact calls: the 4-byte length
prefix and the allocated payload body. Reuse the existing timeout/deadline
configuration where available, and propagate timeout errors so stalled admitted
peers cannot retain the spawned task and QUIC stream indefinitely.
crates/mesh-llm-host-runtime/src/mesh/plugin_mesh.rs-247-279 (1)

247-279: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Route targeted plugin messages beyond one intermediary.

The forwarding path only checks direct connections. In a chain such as A→B→C→D, a message from A targeting D stops at B. Resolve the target endpoint and use the admission-aware on-demand connection path, or implement bounded next-hop forwarding.

Also applies to: 327-356

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/plugin_mesh.rs` around lines 247 - 279,
Update the targeted-message forwarding logic in the plugin frame handler so
messages continue beyond a single intermediary instead of being sent only when
the target is already in state.connections. Resolve message.target_peer_id and
use the existing admission-aware on-demand connection mechanism to reach the
target through multi-hop paths such as A→B→C→D, while preserving local delivery
and avoiding broadcast flooding.
crates/mesh-llm-host-runtime/src/mesh/peer_state.rs-1131-1173 (1)

1131-1173: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Do not reuse a connection before local admission completes.

Lines 1133-1134 return any tracked connection immediately, although unadmitted peers can already exist in state.connections. This skips the gossip verification performed by the fallback branch and lets local trust-policy rejection be bypassed for outbound mesh streams. Reuse the connection only when PeerInfo::is_admitted() is true; otherwise complete gossip first.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/peer_state.rs` around lines 1131 -
1173, The connection lookup in connection_to_peer must only return a tracked
connection when its associated PeerInfo::is_admitted() is true. For an existing
but unadmitted connection, retain the connection/address flow needed to run
initiate_gossip_inner before returning it, ensuring local admission completes
before reuse and trust-policy rejection cannot be bypassed.
crates/mesh-llm-host-runtime/src/mesh/peer_state.rs-197-209 (1)

197-209: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Remove the unexplained dead-code suppression.

Delete these unused helpers, use them from production code, or restrict them to tests instead of suppressing the warnings.

As per coding guidelines, “Do not silence Rust warnings with #[allow(...)] unless there is a clear reason and the developer has asked for that tradeoff.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/peer_state.rs` around lines 197 - 209,
Remove the #[allow(dead_code)] suppression from descriptor_from_model_path and
descriptor_from_identity, then either delete these unused helpers, integrate
them into production code, or limit their definitions to test-only code so they
no longer require warning suppression.

Source: Coding guidelines

crates/mesh-llm-host-runtime/src/mesh/tests/protocol_compat.rs-185-267 (1)

185-267: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Test production protocol and state-transition boundaries rather than reproducing their expected behavior. The current surrogate structs and manual map/timestamp mutations can remain green after the real compatibility or lifecycle implementation regresses.

  • crates/mesh-llm-host-runtime/src/mesh/tests/protocol_compat.rs#L185-L267: deserialize legacy payloads through the production /0 adapter.
  • crates/mesh-llm-host-runtime/src/mesh/tests/protocol_compat.rs#L395-L433: validate production field defaults and aliases rather than local Serde definitions.
  • crates/mesh-llm-host-runtime/src/mesh/tests/protocol_frames.rs#L321-L332: invoke the production transitive-peer update path.
  • crates/mesh-llm-host-runtime/src/mesh/tests/protocol_frames.rs#L414-L450: decode and assert rejection for every listed stream type.
  • crates/mesh-llm-host-runtime/src/mesh/tests/protocol_frames.rs#L825-L839: exercise the actual dead-peer reconnect gate.
  • crates/mesh-llm-host-runtime/src/mesh/tests/protocol_frames.rs#L990-L1015: drive the real reconnect-gossip failure cleanup.

As per coding guidelines, mixed-version /1 protobuf and /0 legacy JSON operation must remain compatible.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/tests/protocol_compat.rs` around lines
185 - 267, Replace the surrogate compatibility structs in
crates/mesh-llm-host-runtime/src/mesh/tests/protocol_compat.rs:185-267 with
legacy-payload deserialization through the production /0 adapter, preserving
mixed-version /1 protobuf and /0 JSON compatibility; likewise validate
production defaults and aliases at
crates/mesh-llm-host-runtime/src/mesh/tests/protocol_compat.rs:395-433. At
crates/mesh-llm-host-runtime/src/mesh/tests/protocol_frames.rs:321-332, invoke
the production transitive-peer update path; at :414-450, decode and assert
rejection for every listed stream type; at :825-839, exercise the actual
dead-peer reconnect gate; and at :990-1015, drive the real reconnect-gossip
failure cleanup instead of manually reproducing state transitions.

Source: Coding guidelines

crates/mesh-llm-host-runtime/src/mesh/peer_state.rs-745-757 (1)

745-757: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Preserve the Hugging Face revision in public model IDs.

Line 756 always passes None, so repo@revision identities collapse together and revision-qualified routing requests cannot match.

Proposed fix
-                model_ref::format_model_ref(repo, None, selector.as_deref())
+                model_ref::format_model_ref(
+                    repo,
+                    identity.revision.as_deref(),
+                    selector.as_deref(),
+                )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/peer_state.rs` around lines 745 - 757,
Update public_model_id_from_identity for the ModelSourceKind::HuggingFace branch
to pass identity.revision to model_ref::format_model_ref instead of always
passing None, preserving repo@revision in the generated public model ID while
leaving artifact selector handling unchanged.
crates/mesh-llm-host-runtime/src/mesh/peer_state.rs-3-34 (1)

3-34: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Select exactly one primary model.

When primary_model_name is not first, Line 13 marks both index zero and the matching model as primary. Select the matching index, falling back to zero only when no match exists.

Proposed fix
+    let primary_idx = serving_models
+        .iter()
+        .position(|name| name == primary_model_name)
+        .unwrap_or(0);
     serving_models
         .iter()
         .enumerate()
         .map(|(idx, model_name)| {
-            let identity = if idx == 0 || model_name == primary_model_name {
+            let identity = if idx == primary_idx {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/peer_state.rs` around lines 3 - 34,
Update infer_remote_served_descriptors to compute one primary index by finding
the entry matching primary_model_name, falling back to index zero when no match
exists. Use only that index in the identity selection condition so exactly one
ServedModelDescriptor has is_primary set to true, while preserving the existing
primary identity and unknown-identity handling.
🟡 Minor comments (3)
crates/mesh-llm-host-runtime/src/runtime_data/mod.rs-1079-1081 (1)

1079-1081: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Bound waiter polling so regressions fail instead of hanging CI.

Each loop can run forever if waiter registration breaks. Wrap the polling phase in a short tokio::time::timeout or a shared bounded helper.

Also applies to: 1094-1096, 1154-1156, 1168-1170

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/runtime_data/mod.rs` around lines 1079 -
1081, Bound each waiter-count polling loop around inventory_scan_waiter_count
with a short tokio::time::timeout or existing shared bounded helper, including
the additional loops at the referenced locations. Preserve the current
yield-and-wait behavior while ensuring registration regressions terminate with a
timeout failure instead of hanging indefinitely.
crates/mesh-llm-host-runtime/src/mesh/mod.rs-113-116 (1)

113-116: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove or explicitly justify the warning suppressions.

Narrow/remove unused imports and re-exports instead of masking them; if any are temporary compatibility shims, document that reason locally.

As per coding guidelines: “Do not silence Rust warnings with #[allow(...)] unless there is a clear reason and the developer has asked for that tradeoff.”

Also applies to: 121-122, 128-129, 136-137, 147-148, 153-157

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/mod.rs` around lines 113 - 116, Remove
the #[allow(unused_imports)] attributes around the imports and re-exports in the
mesh module, including the additional locations noted in the review, then narrow
each import to only the symbols actually used. If any import must remain as a
compatibility shim, retain it only with a local comment documenting the specific
reason.

Source: Coding guidelines

crates/mesh-llm-host-runtime/src/mesh/tests/owner_control.rs-71-109 (1)

71-109: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Document the env-mutation safety invariant
EnvVarGuard is only used by a #[serial] test, but the unsafe std::env calls still need an explicit SAFETY: explanation that no concurrent code in this process reads or mutates env while the guard is live.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/tests/owner_control.rs` around lines 71
- 109, Add explicit SAFETY comments to every unsafe environment operation in
EnvVarGuard, documenting that its callers run under #[serial] and that no
concurrent code reads or mutates the environment while the guard is live.
Replace the existing TODO comments in set, set_str, unset, and Drop without
changing the guard’s behavior.
🧹 Nitpick comments (4)
crates/mesh-client/src/lib.rs (1)

19-20: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep the new result type in its owning module.

Remove this crate-root re-export and use mesh_client::client::OwnerControlScanRefreshResult instead.

As per coding guidelines, “Minimize crate-root re-exports… new code should prefer importing from the owning module directly.”

Proposed change
-    MeshClient, Model, OwnerControlClient, OwnerControlRemoteError, OwnerControlScanRefreshResult,
+    MeshClient, Model, OwnerControlClient, OwnerControlRemoteError,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-client/src/lib.rs` around lines 19 - 20, Remove
OwnerControlScanRefreshResult from the crate-root export list in lib.rs. Update
consumers to import it from the owning mesh_client::client module directly,
leaving the other exports unchanged.

Source: Coding guidelines

crates/mesh-llm-host-runtime/src/runtime_data/inventory.rs (1)

11-12: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Make the test-only error variant conditional instead of suppressing warnings.

Use #[cfg(test)] on both the variant and its Display arm.

As per coding guidelines, “Do not silence Rust warnings with #[allow(...)] unless there is a clear reason and the developer has asked for that tradeoff.”

Proposed change
-    #[allow(dead_code)]
+    #[cfg(test)]
     LoaderFailed(String),
...
+            #[cfg(test)]
             Self::LoaderFailed(message) => {
                 write!(formatter, "local inventory scan failed: {message}")
             }

Also applies to: 19-22

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/runtime_data/inventory.rs` around lines 11 -
12, Update the LoaderFailed variant in the relevant error enum to use
#[cfg(test)] instead of #[allow(dead_code)], and apply the same #[cfg(test)]
condition to its corresponding Display match arm. Keep the variant and arm
consistently available only during tests.

Source: Coding guidelines

crates/mesh-llm-host-runtime/src/runtime_data/mod.rs (1)

1052-1188: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Move the inventory tests out of this 1,700-plus-line module.

These additions move runtime_data/mod.rs closer to the 2,000-line limit and already form a cohesive inventory-test unit.

As per coding guidelines, “If a file is approaching [2,000 lines], split it by responsibility into an owning module instead of adding more code to the oversized file.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/runtime_data/mod.rs` around lines 1052 -
1188, Move the inventory-focused tests
runtime_data_inventory_single_flight_scan_coalesces and
runtime_data_inventory_scan_panic_fans_out_error_and_preserves_snapshot out of
runtime_data/mod.rs into a dedicated inventory test module owned by the
runtime_data implementation. Update module declarations and imports so both
tests retain access to RuntimeDataCollector, inventory result types, and
synchronization utilities, while preserving their existing behavior and
assertions.

Source: Coding guidelines

crates/mesh-llm-host-runtime/src/mesh/tests/admission.rs (1)

688-754: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Split this 1,722-line test module by responsibility.

Move owner-control, direct-proof, bootstrap-token, and RTT tests into dedicated submodules before this file crosses the 2,000-line limit.

As per coding guidelines, “If a file is approaching that size, split it by responsibility into an owning module instead of adding more code to the oversized file.”

Also applies to: 997-1077, 1611-1700

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/tests/admission.rs` around lines 688 -
754, Split the oversized admission test module by responsibility before adding
further tests: move owner-control, direct-proof, bootstrap-token, and RTT tests
into dedicated submodules, including the tests represented by
assert_mesh_requirements_outbound_admits_compliant_peer_after_requirements_pass
and assert_mesh_requirements_inbound_rejects_before_topology_announcement where
applicable. Preserve shared helpers and test behavior, and update module
declarations/imports so all tests continue compiling and running.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@crates/mesh-llm-host-runtime/src/mesh/gossip.rs`:
- Around line 365-449: Update apply_announced_peers to locate the announcement
whose endpoint ID matches remote and, when direct_peer_requirements_validated is
false, validate it with validate_direct_peer_requirements before processing any
announcements. Only after successful validation should it adopt the
announcement’s mesh ID and process the remaining entries, ensuring rejected
senders cannot seed mesh identity or transitive peer state; preserve
apply_announced_peer’s existing handling for already-validated direct peers.

In `@crates/mesh-llm-host-runtime/src/protocol/tests.rs`:
- Around line 1-1760: Split the oversized tests module by responsibility: move
the owner-control tests, peer lifecycle tests, peer announcement/protocol
conversion tests, and configuration round-trip tests into separate named test
submodules. Keep shared fixtures and helpers such as make_valid_gossip_frame,
make_test_peer_info, make_config_snapshot, and make_nested_mesh_config in a
shared scope or expose them as needed, and leave only shared wiring or broadly
applicable tests in the parent module.

---

Major comments:
In `@crates/mesh-client/src/client/control_plane.rs`:
- Around line 383-386: The client response timeout in send_unary_request must
exceed the server’s 30-second execution deadline by a delivery margin; update
the timeout used by the control-plane request in
crates/mesh-client/src/client/control_plane.rs (lines 383-386) while retaining
or centralizing the 30-second execution deadline in
crates/mesh-llm-host-runtime/src/mesh/owner_control/commands/mod.rs (line 145),
which requires no direct increase.

In `@crates/mesh-llm-host-runtime/src/mesh/connections.rs`:
- Around line 1469-1484: Ensure connection publication and stream dispatch occur
only after initiate_gossip succeeds: in
crates/mesh-llm-host-runtime/src/mesh/connections.rs lines 1469-1484, either
defer insertion and dispatch until gossip completes or remove and close the
inserted connection on failure. In
crates/mesh-llm-host-runtime/src/mesh/direct_path.rs lines 429-461, retain the
existing connection while reverse-dial gossip runs, close the replacement on
failure, and preserve or restore the previous connection; publish the
replacement only after successful gossip.
- Around line 317-330: Update relay_map_from_urls to return
Result<iroh::RelayMap> instead of panicking on malformed configuration. Replace
the expect in URL parsing with error propagation that includes the invalid URL
as context, and collect or propagate the iterator’s parse errors before
constructing the RelayMap with iroh::RelayMap::from_iter.

In `@crates/mesh-llm-host-runtime/src/mesh/identity_persistence.rs`:
- Around line 3-15: Update generate_mesh_id to compute named mesh IDs using the
documented SHA-256 input format and return the full stable digest rather than a
DefaultHasher value. Preserve unnamed mesh UUID persistence, and add
compatibility handling so existing generated IDs remain recognized or resolvable
while new named IDs use the fixed algorithm.
- Around line 106-111: Update
crates/mesh-llm-host-runtime/src/mesh/identity_persistence.rs:106-111 so
mark_was_public propagates create_dir_all and write failures, requiring
successful marker persistence before continuing; update
crates/mesh-llm-host-runtime/src/mesh/identity_persistence.rs:25-35 so the
identity-loading flow returns an error instead of publishing a random mesh ID
when persistence fails.

In `@crates/mesh-llm-host-runtime/src/mesh/node_identity.rs`:
- Around line 217-223: Update the signing failure branch in the
requirement-aware bootstrap token flow to return None instead of
Some(String::new()), allowing the caller’s cached-token fallback to execute.
Preserve the existing warning log and successful signing behavior.

In `@crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs`:
- Around line 218-243: The requirement-aware mesh fields currently use
independent locks and can expose partial state. Introduce or reuse one
synchronized state object, update install_requirement_aware_mesh_state in
crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs:218-243 to atomically
commit mesh ID, policy/hash, signed policy, and bootstrap token, and update the
corresponding read path in
crates/mesh-llm-host-runtime/src/mesh/node_identity.rs:117-139 to consume one
atomic snapshot and avoid emitting a legacy invite token.
- Around line 69-105: Update load_or_create_signed_genesis_policy so only a
missing policy file generates a new signed policy. Propagate filesystem read
errors, and surface JSON parse or existing-policy validation failures—including
verify, owner ID, requirements, and signing-key mismatches—instead of silently
creating a timestamped replacement; preserve returning the valid existing policy
unchanged.

In `@crates/mesh-llm-host-runtime/src/mesh/node.rs`:
- Around line 1854-1877: Update the demand age calculation in gc_demand, and any
corresponding filtering logic in the adjacent demand code, to use saturating
subtraction when comparing now against peer-provided last_active timestamps.
Ensure future timestamps produce age zero rather than underflowing, while
preserving the existing TTL and pinned-model retention behavior.
- Around line 57-76: Validate STUN responses across probe_stun_server and
parse_stun_public_addr: in crates/mesh-llm-host-runtime/src/mesh/node.rs:57-76,
retain recv_from’s source and reject packets not from the resolved server; in
crates/mesh-llm-host-runtime/src/mesh/connections.rs:209-228, require a valid
STUN Binding Success header, declared message length, magic cookie, and matching
request transaction ID before parsing mapped-address attributes.
- Around line 923-1114: Split the oversized node module before adding further
code: extract the startup construction centered on Node::start and at least one
cohesive state domain such as capture, metrics, model state, or control-listener
lifecycle into an owning module. Move its related fields, initialization, and
methods together, update imports and call sites, and keep Node::start behavior
unchanged while keeping the original file below the 2,000-line limit.

In `@crates/mesh-llm-host-runtime/src/mesh/owner_control/mod.rs`:
- Around line 337-355: The owner-control response writers
send_owner_control_envelope and send_owner_control_terminal_envelope must
enforce a write timeout, including the terminal fallback path. Wrap the
length-prefixed write with the command deadline, and when it expires close or
reset the SendStream before returning the timeout error so neither the initial
response nor the fallback can hang indefinitely.

In `@crates/mesh-llm-host-runtime/src/mesh/peer_state.rs`:
- Around line 1131-1173: The connection lookup in connection_to_peer must only
return a tracked connection when its associated PeerInfo::is_admitted() is true.
For an existing but unadmitted connection, retain the connection/address flow
needed to run initiate_gossip_inner before returning it, ensuring local
admission completes before reuse and trust-policy rejection cannot be bypassed.
- Around line 197-209: Remove the #[allow(dead_code)] suppression from
descriptor_from_model_path and descriptor_from_identity, then either delete
these unused helpers, integrate them into production code, or limit their
definitions to test-only code so they no longer require warning suppression.
- Around line 745-757: Update public_model_id_from_identity for the
ModelSourceKind::HuggingFace branch to pass identity.revision to
model_ref::format_model_ref instead of always passing None, preserving
repo@revision in the generated public model ID while leaving artifact selector
handling unchanged.
- Around line 3-34: Update infer_remote_served_descriptors to compute one
primary index by finding the entry matching primary_model_name, falling back to
index zero when no match exists. Use only that index in the identity selection
condition so exactly one ServedModelDescriptor has is_primary set to true, while
preserving the existing primary identity and unknown-identity handling.

In `@crates/mesh-llm-host-runtime/src/mesh/plugin_mesh.rs`:
- Around line 204-217: Update handle_plugin_channel_stream and the corresponding
bulk-frame read path to apply bounded deadlines to both recv.read_exact calls:
the 4-byte length prefix and the allocated payload body. Reuse the existing
timeout/deadline configuration where available, and propagate timeout errors so
stalled admitted peers cannot retain the spawned task and QUIC stream
indefinitely.
- Around line 247-279: Update the targeted-message forwarding logic in the
plugin frame handler so messages continue beyond a single intermediary instead
of being sent only when the target is already in state.connections. Resolve
message.target_peer_id and use the existing admission-aware on-demand connection
mechanism to reach the target through multi-hop paths such as A→B→C→D, while
preserving local delivery and avoiding broadcast flooding.

In `@crates/mesh-llm-host-runtime/src/mesh/stage_artifacts.rs`:
- Around line 121-137: Apply the command-specific timeout to both stage-control
execution paths: wrap the response wait in execute_stage_control_request in
stage_artifacts.rs and the corresponding local API command wait in
stage_transport.rs (lines 814-822) with the established timeout mechanism,
returning the timeout error consistently while preserving existing send and
response-drop errors.
- Around line 783-795: Update the artifact transfer loop around the write_all
call to enforce a write-idle timeout, so a peer that stops reading cannot retain
the file, stream, and task indefinitely. Wrap each send.write_all operation, or
the transfer loop, with the existing timeout mechanism and propagate a
contextual timeout error while preserving normal chunked transfer behavior.

In `@crates/mesh-llm-host-runtime/src/mesh/stage_transport.rs`:
- Around line 966-1011: Make stage-bridge creation in the surrounding method
atomic by reserving the computed key in stage_transport_bridges before binding
the listener or spawning the task, rejecting an existing reservation. If
listener binding or task setup fails, remove the reservation before returning
the error; otherwise replace the reservation with the running JoinHandle without
allowing concurrent calls to overwrite it.
- Around line 1153-1155: Update the stream-kind read in the accept loop to apply
the established stream-read timeout before awaiting recv.read_exact, and treat
timeout or other read failure as StageStreamAccept::Continue. Ensure a peer that
sends no type byte cannot block acceptance of subsequent stage streams.

In `@crates/mesh-llm-host-runtime/src/mesh/tests/protocol_compat.rs`:
- Around line 185-267: Replace the surrogate compatibility structs in
crates/mesh-llm-host-runtime/src/mesh/tests/protocol_compat.rs:185-267 with
legacy-payload deserialization through the production /0 adapter, preserving
mixed-version /1 protobuf and /0 JSON compatibility; likewise validate
production defaults and aliases at
crates/mesh-llm-host-runtime/src/mesh/tests/protocol_compat.rs:395-433. At
crates/mesh-llm-host-runtime/src/mesh/tests/protocol_frames.rs:321-332, invoke
the production transitive-peer update path; at :414-450, decode and assert
rejection for every listed stream type; at :825-839, exercise the actual
dead-peer reconnect gate; and at :990-1015, drive the real reconnect-gossip
failure cleanup instead of manually reproducing state transitions.

---

Minor comments:
In `@crates/mesh-llm-host-runtime/src/mesh/mod.rs`:
- Around line 113-116: Remove the #[allow(unused_imports)] attributes around the
imports and re-exports in the mesh module, including the additional locations
noted in the review, then narrow each import to only the symbols actually used.
If any import must remain as a compatibility shim, retain it only with a local
comment documenting the specific reason.

In `@crates/mesh-llm-host-runtime/src/mesh/tests/owner_control.rs`:
- Around line 71-109: Add explicit SAFETY comments to every unsafe environment
operation in EnvVarGuard, documenting that its callers run under #[serial] and
that no concurrent code reads or mutates the environment while the guard is
live. Replace the existing TODO comments in set, set_str, unset, and Drop
without changing the guard’s behavior.

In `@crates/mesh-llm-host-runtime/src/runtime_data/mod.rs`:
- Around line 1079-1081: Bound each waiter-count polling loop around
inventory_scan_waiter_count with a short tokio::time::timeout or existing shared
bounded helper, including the additional loops at the referenced locations.
Preserve the current yield-and-wait behavior while ensuring registration
regressions terminate with a timeout failure instead of hanging indefinitely.

---

Nitpick comments:
In `@crates/mesh-client/src/lib.rs`:
- Around line 19-20: Remove OwnerControlScanRefreshResult from the crate-root
export list in lib.rs. Update consumers to import it from the owning
mesh_client::client module directly, leaving the other exports unchanged.

In `@crates/mesh-llm-host-runtime/src/mesh/tests/admission.rs`:
- Around line 688-754: Split the oversized admission test module by
responsibility before adding further tests: move owner-control, direct-proof,
bootstrap-token, and RTT tests into dedicated submodules, including the tests
represented by
assert_mesh_requirements_outbound_admits_compliant_peer_after_requirements_pass
and assert_mesh_requirements_inbound_rejects_before_topology_announcement where
applicable. Preserve shared helpers and test behavior, and update module
declarations/imports so all tests continue compiling and running.

In `@crates/mesh-llm-host-runtime/src/runtime_data/inventory.rs`:
- Around line 11-12: Update the LoaderFailed variant in the relevant error enum
to use #[cfg(test)] instead of #[allow(dead_code)], and apply the same
#[cfg(test)] condition to its corresponding Display match arm. Keep the variant
and arm consistently available only during tests.

In `@crates/mesh-llm-host-runtime/src/runtime_data/mod.rs`:
- Around line 1052-1188: Move the inventory-focused tests
runtime_data_inventory_single_flight_scan_coalesces and
runtime_data_inventory_scan_panic_fans_out_error_and_preserves_snapshot out of
runtime_data/mod.rs into a dedicated inventory test module owned by the
runtime_data implementation. Update module declarations and imports so both
tests retain access to RuntimeDataCollector, inventory result types, and
synchronization utilities, while preserving their existing behavior and
assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5fd24668-33eb-4e9f-b5c4-0a97ca0434d6

📥 Commits

Reviewing files that changed from the base of the PR and between d7dfa6c and 11795d1.

📒 Files selected for processing (55)
  • crates/mesh-client/src/client/control_plane.rs
  • crates/mesh-client/src/client/mod.rs
  • crates/mesh-client/src/lib.rs
  • crates/mesh-client/tests/control_plane_client.rs
  • crates/mesh-llm-cli/src/runtime.rs
  • crates/mesh-llm-host-runtime/src/api/mod.rs
  • crates/mesh-llm-host-runtime/src/api/routes/mod.rs
  • crates/mesh-llm-host-runtime/src/api/routes/runtime.rs
  • crates/mesh-llm-host-runtime/src/mesh/artifact_transfer_io.rs
  • crates/mesh-llm-host-runtime/src/mesh/connections.rs
  • crates/mesh-llm-host-runtime/src/mesh/direct_path.rs
  • crates/mesh-llm-host-runtime/src/mesh/gossip.rs
  • crates/mesh-llm-host-runtime/src/mesh/heartbeat.rs
  • crates/mesh-llm-host-runtime/src/mesh/identity_persistence.rs
  • crates/mesh-llm-host-runtime/src/mesh/lan_bootstrap.rs
  • crates/mesh-llm-host-runtime/src/mesh/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/node.rs
  • crates/mesh-llm-host-runtime/src/mesh/node_identity.rs
  • crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs
  • crates/mesh-llm-host-runtime/src/mesh/owner_control/commands/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/owner_control/commands/scan_refresh.rs
  • crates/mesh-llm-host-runtime/src/mesh/owner_control/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/peer_state.rs
  • crates/mesh-llm-host-runtime/src/mesh/plugin_mesh.rs
  • crates/mesh-llm-host-runtime/src/mesh/plugin_streams.rs
  • crates/mesh-llm-host-runtime/src/mesh/public_identity_tests.rs
  • crates/mesh-llm-host-runtime/src/mesh/requirements.rs
  • crates/mesh-llm-host-runtime/src/mesh/stage_artifacts.rs
  • crates/mesh-llm-host-runtime/src/mesh/stage_transport.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/admission.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/connections.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/gossip.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/owner_control.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/peer_state.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/protocol_compat.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/protocol_frames.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/requirements.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/stage_transport.rs
  • crates/mesh-llm-host-runtime/src/protocol/mod.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests.rs
  • crates/mesh-llm-host-runtime/src/runtime_data/collector.rs
  • crates/mesh-llm-host-runtime/src/runtime_data/inventory.rs
  • crates/mesh-llm-host-runtime/src/runtime_data/mod.rs
  • crates/mesh-llm-protocol/proto/node.proto
  • crates/mesh-llm-protocol/src/proto/node.rs
  • crates/mesh-llm-protocol/src/protocol/mod.rs
  • crates/mesh-llm/src/commands/runtime.rs
  • crates/mesh-llm/tests/owned_node_commands_cli.rs
  • docs/USAGE.md
  • docs/design/TESTING.md
  • docs/design/message_protocol.md
  • scripts/qa-control-plane-mixed-version.sh
  • website/src/docs/pages/CLI.md
  • website/src/docs/pages/api-reference.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
crates/mesh-llm-host-runtime/src/mesh/peer_state.rs (1)

774-872: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

Split peer_state.rs before it reaches the file-size limit.

At roughly 1,631 lines, this module now combines model identity, peer domain types, connection reservations, routing, stage connectivity, and lifecycle ingestion. Move these responsibilities into owning submodules.

As per coding guidelines, “If a file is approaching [2,000 lines], split it by responsibility into an owning module instead of adding more code to the oversized file.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/peer_state.rs` around lines 774 - 872,
Split the responsibilities currently concentrated in `peer_state.rs` into owning
submodules before adding further functionality: keep model identity and peer
domain types together, move connection reservation types and methods such as
`PendingConnectionHandshake`, `PendingConnectionWaiter`, and
`MeshState::pending_connection_is_active` into a connection-reservation module,
and separate routing, stage connectivity, and lifecycle-ingestion logic
similarly. Update module declarations and visibility/imports so existing callers
retain the same behavior and APIs.

Source: Coding guidelines

crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs (1)

233-275: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Make requirement-policy transitions atomic.

Lines 241-259 check the current mesh and publish under separate lock acquisitions, so concurrent joins can both observe no policy and install conflicting states. Similarly, Lines 304-325 verify against snapshot A but may attach its signed policy to a newly installed snapshot B.

Perform compare-and-set and signed-policy enrichment while holding requirement_mesh_state; verify the mesh ID, policy hash, and policy still match before mutation.

Also applies to: 299-325

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs` around lines 233
- 275, Make requirement-policy transitions atomic in
install_requirement_aware_mesh_state and the signed-policy enrichment flow
around the corresponding snapshot validation. Hold requirement_mesh_state for
the entire compare-and-set operation, verify the existing mesh ID, policy hash,
and policy still match the requested values, then install or enrich the state
while retaining the guard; do not validate against a released snapshot before
mutation.
crates/mesh-llm-host-runtime/src/mesh/connections.rs (1)

800-823: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Bound the stream-type read before continuing dispatch.

Line 821 waits indefinitely for the discriminator. Because the dispatcher processes streams sequentially, a peer can open one bi-stream without sending this byte and block all subsequent gossip/control streams on the connection. Apply a read deadline and reset the stalled stream.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/connections.rs` around lines 800 - 823,
Update accept_mesh_stream’s discriminator read after type_buf is created to use
a bounded read deadline; when the deadline expires or the read fails, reset the
stalled receive stream before returning Err(()), while preserving normal
dispatch for successfully read stream types.
🧹 Nitpick comments (1)
crates/mesh-llm-host-runtime/src/network/openai/transport.rs (1)

5122-5136: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Test request routing with the new revision-qualified ID.

The test verifies /v1/models output but not that this exact repo@revision:selector ID rewrites to the internal model name. Add an alias-rewrite regression test so every advertised ID is demonstrably routable.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/network/openai/transport.rs` around lines
5122 - 5136, Extend the regression coverage around
models_list_uses_public_huggingface_model_ref_ids to pass the advertised
repo@revision:selector ID through the request alias-rewrite path and assert it
resolves to the internal model name. Reuse the existing alias-rewrite function
and test fixtures, ensuring the exact ID emitted by models_list_json is
demonstrably routable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/mesh-llm-host-runtime/src/mesh/connections.rs`:
- Around line 951-956: Handle the Err result from await_pending_connection in
the PendingConnectionReservation::Waiter branch instead of discarding it. When
the competing pending connection fails, remove or retry the peer so no stale
peer remains after dispatcher exit; preserve the existing close-and-return
behavior when awaiting succeeds.

In `@crates/mesh-llm-host-runtime/src/mesh/gossip.rs`:
- Around line 499-504: Update the direct-peer admission flow around
add_peer_after_direct_requirements_validated so it returns whether the sender
was accepted; only after successful admission should set_mesh_id and
merge_remote_demand be invoked, while rejected peers must not mutate local
identity or demand.

In `@crates/mesh-llm-host-runtime/src/mesh/peer_state.rs`:
- Around line 161-164: Remove the dead-code suppression and either delete the
unused helper or integrate it into the model-path identity reconstruction flow.
Update the relevant callers around the helper in peer state handling so the
implementation no longer relies on the #[expect(dead_code)] attribute.
- Around line 9-17: Update the primary_index handling in the serving-model
identity mapping so a missing primary_model_name does not default to index 0 or
assign the primary identity to another model. Only mark a model as primary when
position finds an actual match; preserve the existing identity behavior for
matching and non-primary models.

In `@crates/mesh-llm-host-runtime/src/mesh/stun.rs`:
- Around line 39-61: Update probe_stun_server and receive_matching_stun_response
so the returned SocketAddr uses the port decoded from the STUN mapped-address
response rather than advertised_port. Probe with the QUIC endpoint’s actual UDP
socket when available, and only return an advertised port after independently
verifying it; otherwise return the discovered IP without claiming an unverified
port.

In `@crates/mesh-llm-host-runtime/src/mesh/tests/admission/requirements.rs`:
- Around line 1155-1169: Update assert_persisted_random_mesh_id_is_preserved and
the similarly structured helpers at the referenced locations to use an RAII drop
guard immediately after changing HOME. Have the guard restore the saved HOME
value on drop, including during assertion or expect unwinding, and remove the
manual restore_env calls that rely on reaching the function end.

In `@crates/mesh-llm-host-runtime/src/plugin/transport.rs`:
- Around line 499-510: Update the mesh stream request flow around mesh_tx.send
and response_rx so one deadline covers both broker enqueue and response waiting,
including when the bounded queue is full and the receiver is stalled. Return the
existing mesh stream error for either enqueue or response timeout, preserving
the response handling for successful sends. Add a test that fills the queue and
verifies the request times out while enqueue is blocked.

In `@crates/mesh-llm-host-runtime/src/runtime/mod.rs`:
- Around line 3285-3300: Split the oversized modules by responsibility before
adding further logic: in
crates/mesh-llm-host-runtime/src/runtime/mod.rs:3285-3300, extract
handle_public_identity_transition and related identity/persistence and startup
phases into an owning module, updating callers and visibility as needed; in
crates/mesh-llm-host-runtime/src/mesh/connections.rs:1403-1725, extract the
relay, dispatch/admission, and pending-connection state machines into an owning
module. Keep behavior unchanged and ensure no Rust source file exceeds 2,000
lines.

---

Outside diff comments:
In `@crates/mesh-llm-host-runtime/src/mesh/connections.rs`:
- Around line 800-823: Update accept_mesh_stream’s discriminator read after
type_buf is created to use a bounded read deadline; when the deadline expires or
the read fails, reset the stalled receive stream before returning Err(()), while
preserving normal dispatch for successfully read stream types.

In `@crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs`:
- Around line 233-275: Make requirement-policy transitions atomic in
install_requirement_aware_mesh_state and the signed-policy enrichment flow
around the corresponding snapshot validation. Hold requirement_mesh_state for
the entire compare-and-set operation, verify the existing mesh ID, policy hash,
and policy still match the requested values, then install or enrich the state
while retaining the guard; do not validate against a released snapshot before
mutation.

In `@crates/mesh-llm-host-runtime/src/mesh/peer_state.rs`:
- Around line 774-872: Split the responsibilities currently concentrated in
`peer_state.rs` into owning submodules before adding further functionality: keep
model identity and peer domain types together, move connection reservation types
and methods such as `PendingConnectionHandshake`, `PendingConnectionWaiter`, and
`MeshState::pending_connection_is_active` into a connection-reservation module,
and separate routing, stage connectivity, and lifecycle-ingestion logic
similarly. Update module declarations and visibility/imports so existing callers
retain the same behavior and APIs.

---

Nitpick comments:
In `@crates/mesh-llm-host-runtime/src/network/openai/transport.rs`:
- Around line 5122-5136: Extend the regression coverage around
models_list_uses_public_huggingface_model_ref_ids to pass the advertised
repo@revision:selector ID through the request alias-rewrite path and assert it
resolves to the internal model name. Reuse the existing alias-rewrite function
and test fixtures, ensuring the exact ID emitted by models_list_json is
demonstrably routable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2fc1c05f-fae5-4cea-9991-b0b96e97910f

📥 Commits

Reviewing files that changed from the base of the PR and between 11795d1 and d9f6adf.

📒 Files selected for processing (49)
  • crates/mesh-client/src/client/control_plane.rs
  • crates/mesh-llm-host-runtime/src/api/routes/runtime.rs
  • crates/mesh-llm-host-runtime/src/exact_test_wrappers.rs
  • crates/mesh-llm-host-runtime/src/mesh/artifact_transfer_io.rs
  • crates/mesh-llm-host-runtime/src/mesh/connections.rs
  • crates/mesh-llm-host-runtime/src/mesh/direct_path.rs
  • crates/mesh-llm-host-runtime/src/mesh/gossip.rs
  • crates/mesh-llm-host-runtime/src/mesh/identity_persistence.rs
  • crates/mesh-llm-host-runtime/src/mesh/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/node.rs
  • crates/mesh-llm-host-runtime/src/mesh/node_identity.rs
  • crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs
  • crates/mesh-llm-host-runtime/src/mesh/owner_control/commands/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/owner_control/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/peer_state.rs
  • crates/mesh-llm-host-runtime/src/mesh/plugin_mesh.rs
  • crates/mesh-llm-host-runtime/src/mesh/plugin_streams.rs
  • crates/mesh-llm-host-runtime/src/mesh/public_identity_tests.rs
  • crates/mesh-llm-host-runtime/src/mesh/stage_artifacts.rs
  • crates/mesh-llm-host-runtime/src/mesh/stage_transport.rs
  • crates/mesh-llm-host-runtime/src/mesh/stage_transport_bridge.rs
  • crates/mesh-llm-host-runtime/src/mesh/stun.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/admission.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/admission/connectivity.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/admission/helpers.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/admission/requirements.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/connections.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/direct_path.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/gossip.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/owner_control.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/peer_state.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/protocol_compat.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/protocol_frames.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/stage_transport.rs
  • crates/mesh-llm-host-runtime/src/models/inventory.rs
  • crates/mesh-llm-host-runtime/src/models/mod.rs
  • crates/mesh-llm-host-runtime/src/network/openai/transport.rs
  • crates/mesh-llm-host-runtime/src/plugin/transport.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests/announcements.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests/config.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests/control_frames.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests/mesh_timestamps.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests/owner_control.rs
  • crates/mesh-llm-host-runtime/src/runtime/mod.rs
  • crates/mesh-llm-host-runtime/src/runtime_data/inventory.rs
  • crates/mesh-llm-host-runtime/src/runtime_data/mod.rs
  • crates/mesh-llm-host-runtime/src/runtime_data/tests/inventory.rs
🚧 Files skipped from review as they are similar to previous changes (18)
  • crates/mesh-llm-host-runtime/src/mesh/public_identity_tests.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/connections.rs
  • crates/mesh-llm-host-runtime/src/mesh/plugin_mesh.rs
  • crates/mesh-llm-host-runtime/src/mesh/plugin_streams.rs
  • crates/mesh-llm-host-runtime/src/mesh/identity_persistence.rs
  • crates/mesh-llm-host-runtime/src/mesh/artifact_transfer_io.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/owner_control.rs
  • crates/mesh-llm-host-runtime/src/runtime_data/inventory.rs
  • crates/mesh-llm-host-runtime/src/mesh/owner_control/mod.rs
  • crates/mesh-llm-host-runtime/src/api/routes/runtime.rs
  • crates/mesh-llm-host-runtime/src/mesh/owner_control/commands/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/stage_transport.rs
  • crates/mesh-llm-host-runtime/src/mesh/node_identity.rs
  • crates/mesh-client/src/client/control_plane.rs
  • crates/mesh-llm-host-runtime/src/mesh/stage_artifacts.rs
  • crates/mesh-llm-host-runtime/src/mesh/node.rs

Comment thread crates/mesh-llm-host-runtime/src/mesh/connections.rs
Comment thread crates/mesh-llm-host-runtime/src/mesh/gossip.rs Outdated
Comment thread crates/mesh-llm-host-runtime/src/mesh/peer_state.rs Outdated
Comment thread crates/mesh-llm-host-runtime/src/mesh/peer_state.rs Outdated
Comment thread crates/mesh-llm-host-runtime/src/mesh/stun.rs Outdated
Comment thread crates/mesh-llm-host-runtime/src/mesh/tests/admission/requirements.rs Outdated
Comment thread crates/mesh-llm-host-runtime/src/plugin/transport.rs Outdated
Comment thread crates/mesh-llm-host-runtime/src/runtime/mod.rs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
crates/mesh-llm-host-runtime/src/mesh/stun.rs (1)

22-29: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Ensure timeout warnings are consistently logged.

If the deadline has already passed just before checked_duration_since is called, the ? operator will silently return None from the function, bypassing the timeout warning on line 26.

Using unwrap_or_default() ensures that a zero duration is passed to tokio::time::timeout, which will immediately fail with an Elapsed error and guarantee the warning is logged correctly.

♻️ Proposed fix
-        let remaining = deadline.checked_duration_since(tokio::time::Instant::now())?;
+        let remaining = deadline
+            .checked_duration_since(tokio::time::Instant::now())
+            .unwrap_or_default();
         match tokio::time::timeout(remaining, addresses.updated()).await {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/stun.rs` around lines 22 - 29, Update
the deadline duration calculation in the surrounding address-discovery flow to
replace the fallible `checked_duration_since` propagation with a zero-duration
fallback such as `unwrap_or_default()`. Ensure an expired deadline reaches
`tokio::time::timeout`, triggering the existing warning and `None` return path
consistently.
crates/mesh-llm-host-runtime/src/mesh/model_identity.rs (1)

182-190: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Simplify URL parsing and fix support for top-level repositories.

Formatting a canonical string and passing it back to parse_hf_ref_parts is not only inefficient but also causes parsing to fail for top-level Hugging Face models (like gpt2). This happens because parse_hf_ref_parts explicitly requires exactly three slash-separated segments (e.g., owner/repo).

Since split_once has already isolated the repository, revision, and filename components from the URL structure, you can return them directly.

♻️ Proposed fix
 pub(crate) fn parse_hf_resolve_url_parts(url: &str) -> Option<(String, Option<String>, String)> {
     let path = url
         .strip_prefix("https://huggingface.co/")
         .or_else(|| url.strip_prefix("http://huggingface.co/"))?;
     let (repo, rest) = path.split_once("/resolve/")?;
     let (revision, file) = rest.split_once('/')?;
-    let canonical = format!("{repo}@{revision}/{file}");
-    parse_hf_ref_parts(&canonical)
+    if repo.is_empty() || file.is_empty() {
+        return None;
+    }
+    Some((repo.to_string(), Some(revision.to_string()), file.to_string()))
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/mesh/model_identity.rs` around lines 182 -
190, Update parse_hf_resolve_url_parts to return the repository, revision, and
file components directly after the existing URL prefix and split_once
validations; remove the canonical string construction and parse_hf_ref_parts
call so top-level repositories such as “gpt2” are supported.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@crates/mesh-llm-host-runtime/src/mesh/model_identity.rs`:
- Around line 182-190: Update parse_hf_resolve_url_parts to return the
repository, revision, and file components directly after the existing URL prefix
and split_once validations; remove the canonical string construction and
parse_hf_ref_parts call so top-level repositories such as “gpt2” are supported.

In `@crates/mesh-llm-host-runtime/src/mesh/stun.rs`:
- Around line 22-29: Update the deadline duration calculation in the surrounding
address-discovery flow to replace the fallible `checked_duration_since`
propagation with a zero-duration fallback such as `unwrap_or_default()`. Ensure
an expired deadline reaches `tokio::time::timeout`, triggering the existing
warning and `None` return path consistently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6f079e72-23f0-4710-8191-1091851bac58

📥 Commits

Reviewing files that changed from the base of the PR and between d9f6adf and 8ebcdd5.

📒 Files selected for processing (19)
  • crates/mesh-llm-host-runtime/src/exact_test_wrappers.rs
  • crates/mesh-llm-host-runtime/src/mesh/connection_reservation.rs
  • crates/mesh-llm-host-runtime/src/mesh/connections.rs
  • crates/mesh-llm-host-runtime/src/mesh/gossip.rs
  • crates/mesh-llm-host-runtime/src/mesh/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/model_identity.rs
  • crates/mesh-llm-host-runtime/src/mesh/node.rs
  • crates/mesh-llm-host-runtime/src/mesh/node_identity.rs
  • crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs
  • crates/mesh-llm-host-runtime/src/mesh/peer_state.rs
  • crates/mesh-llm-host-runtime/src/mesh/stun.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/admission/connectivity.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/admission/requirements.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/gossip.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/peer_state.rs
  • crates/mesh-llm-host-runtime/src/network/openai/transport.rs
  • crates/mesh-llm-host-runtime/src/plugin/transport.rs
  • crates/mesh-llm-host-runtime/src/runtime/mod.rs
  • crates/mesh-llm-host-runtime/src/runtime/startup_identity.rs
💤 Files with no reviewable changes (1)
  • crates/mesh-llm-host-runtime/src/mesh/peer_state.rs
🚧 Files skipped from review as they are similar to previous changes (13)
  • crates/mesh-llm-host-runtime/src/exact_test_wrappers.rs
  • crates/mesh-llm-host-runtime/src/runtime/mod.rs
  • crates/mesh-llm-host-runtime/src/network/openai/transport.rs
  • crates/mesh-llm-host-runtime/src/mesh/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/admission/connectivity.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/gossip.rs
  • crates/mesh-llm-host-runtime/src/mesh/node_identity.rs
  • crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/peer_state.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/admission/requirements.rs
  • crates/mesh-llm-host-runtime/src/mesh/gossip.rs
  • crates/mesh-llm-host-runtime/src/mesh/node.rs
  • crates/mesh-llm-host-runtime/src/mesh/connections.rs

@ndizazzo
ndizazzo force-pushed the codex/owned-node-commands-plan branch from ce38f49 to fe437aa Compare July 18, 2026 17:25

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
crates/mesh-llm-host-runtime/src/runtime_data/tests/inventory.rs (1)

5-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Improve test stability by replacing yield_now() with a short sleep.

Using tokio::task::yield_now().await in a polling loop can lead to test flakiness in CI environments. If the executor thread is lightly loaded, yield_now can return almost instantly, exhausting the 100 iterations before the background tasks have had enough wall-clock time to execute and update the waiter count.

Consider using a short tokio::time::sleep to give background tasks reliable scheduling time.

♻️ Proposed refactor
 async fn wait_for_inventory_scan_waiters(collector: &RuntimeDataCollector, expected: usize) {
     for _ in 0..WAITER_POLL_LIMIT {
         if collector.inventory_scan_waiter_count() == expected {
             return;
         }
-        tokio::task::yield_now().await;
+        tokio::time::sleep(std::time::Duration::from_millis(10)).await;
     }
     panic!(
         "inventory scan waiter count did not reach {expected}; got {}",
         collector.inventory_scan_waiter_count()
     );
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-host-runtime/src/runtime_data/tests/inventory.rs` around
lines 5 - 16, Update wait_for_inventory_scan_waiters to replace
tokio::task::yield_now().await with a short tokio::time::sleep delay between
polling attempts, while preserving the existing waiter-count checks, limit, and
panic behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/mesh-llm-host-runtime/src/mesh/tests/peer_state.rs`:
- Line 305: Split the oversized peer_state test file into
responsibility-specific modules under peer_state/, separating the relay, LAN
targeting, admission, gossip, tunnel-map, and route-table test groups. Update
the parent test module declarations and any imports or shared fixtures so all
tests continue compiling and running without changing their behavior.
- Around line 561-588: Replace the direct peer-map mutation in the admission
test with valid gossip submitted through the production gossip handler, then
assert promotion via is_peer_admitted. In
crates/mesh-llm-host-runtime/src/mesh/tests/peer_state.rs:652-657, submit
malformed gossip through that handler and assert rejection with no state
mutation; at 691-723, process the route request and assert it does not admit the
peer; at 1134-1150, submit mismatched sender identity and assert the production
validator rejects it. Use the relevant production handlers and validators rather
than reconstructing their effects.

In `@docs/design/message_protocol.md`:
- Around line 50-54: Update the owned-node command protocol description to scope
the “exactly one typed request and its response” rule to unary commands only.
Document that accepted watch_config streams have no unary deadline and carry the
appropriate ongoing watch message sequence instead of a single response.
- Line 46: Update the Skippy protocol description in the design document to
state that gossip advertises skippy-stage major version 1, while stream 0x0d
opens major version 2. Preserve the existing ownership and framing details, but
remove wording that implies major version 2 is advertised directly.

---

Nitpick comments:
In `@crates/mesh-llm-host-runtime/src/runtime_data/tests/inventory.rs`:
- Around line 5-16: Update wait_for_inventory_scan_waiters to replace
tokio::task::yield_now().await with a short tokio::time::sleep delay between
polling attempts, while preserving the existing waiter-count checks, limit, and
panic behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e84035b3-04dd-4c63-80ae-d0e46243e045

📥 Commits

Reviewing files that changed from the base of the PR and between ce38f49 and fe437aa.

📒 Files selected for processing (75)
  • crates/mesh-client/src/client/control_plane.rs
  • crates/mesh-client/src/client/mod.rs
  • crates/mesh-client/tests/control_plane_client.rs
  • crates/mesh-llm-cli/src/runtime.rs
  • crates/mesh-llm-host-runtime/src/api/mod.rs
  • crates/mesh-llm-host-runtime/src/api/routes/mod.rs
  • crates/mesh-llm-host-runtime/src/api/routes/runtime.rs
  • crates/mesh-llm-host-runtime/src/exact_test_wrappers.rs
  • crates/mesh-llm-host-runtime/src/mesh/artifact_transfer_io.rs
  • crates/mesh-llm-host-runtime/src/mesh/connection_reservation.rs
  • crates/mesh-llm-host-runtime/src/mesh/connections.rs
  • crates/mesh-llm-host-runtime/src/mesh/direct_path.rs
  • crates/mesh-llm-host-runtime/src/mesh/gossip.rs
  • crates/mesh-llm-host-runtime/src/mesh/heartbeat.rs
  • crates/mesh-llm-host-runtime/src/mesh/identity_persistence.rs
  • crates/mesh-llm-host-runtime/src/mesh/lan_bootstrap.rs
  • crates/mesh-llm-host-runtime/src/mesh/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/model_identity.rs
  • crates/mesh-llm-host-runtime/src/mesh/node.rs
  • crates/mesh-llm-host-runtime/src/mesh/node_identity.rs
  • crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs
  • crates/mesh-llm-host-runtime/src/mesh/owner_control/commands/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/owner_control/commands/scan_refresh.rs
  • crates/mesh-llm-host-runtime/src/mesh/owner_control/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/peer_state.rs
  • crates/mesh-llm-host-runtime/src/mesh/plugin_mesh.rs
  • crates/mesh-llm-host-runtime/src/mesh/plugin_streams.rs
  • crates/mesh-llm-host-runtime/src/mesh/public_identity_tests.rs
  • crates/mesh-llm-host-runtime/src/mesh/requirements.rs
  • crates/mesh-llm-host-runtime/src/mesh/stage_artifacts.rs
  • crates/mesh-llm-host-runtime/src/mesh/stage_transport.rs
  • crates/mesh-llm-host-runtime/src/mesh/stage_transport_bridge.rs
  • crates/mesh-llm-host-runtime/src/mesh/stun.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/admission.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/admission/connectivity.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/admission/helpers.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/admission/requirements.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/connections.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/direct_path.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/gossip.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/owner_control.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/peer_state.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/protocol_compat.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/protocol_frames.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/requirements.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/stage_transport.rs
  • crates/mesh-llm-host-runtime/src/models/inventory.rs
  • crates/mesh-llm-host-runtime/src/models/mod.rs
  • crates/mesh-llm-host-runtime/src/network/openai/transport.rs
  • crates/mesh-llm-host-runtime/src/plugin/transport.rs
  • crates/mesh-llm-host-runtime/src/protocol/mod.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests/announcements.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests/config.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests/control_frames.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests/mesh_timestamps.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests/owner_control.rs
  • crates/mesh-llm-host-runtime/src/runtime/mod.rs
  • crates/mesh-llm-host-runtime/src/runtime/startup_identity.rs
  • crates/mesh-llm-host-runtime/src/runtime_data/collector.rs
  • crates/mesh-llm-host-runtime/src/runtime_data/inventory.rs
  • crates/mesh-llm-host-runtime/src/runtime_data/mod.rs
  • crates/mesh-llm-host-runtime/src/runtime_data/tests/inventory.rs
  • crates/mesh-llm-protocol/proto/node.proto
  • crates/mesh-llm-protocol/src/proto/node.rs
  • crates/mesh-llm-protocol/src/protocol/mod.rs
  • crates/mesh-llm/src/commands/runtime.rs
  • crates/mesh-llm/tests/owned_node_commands_cli.rs
  • docs/USAGE.md
  • docs/design/TESTING.md
  • docs/design/message_protocol.md
  • scripts/qa-control-plane-mixed-version.sh
  • website/src/docs/pages/CLI.md
  • website/src/docs/pages/api-reference.md
🚧 Files skipped from review as they are similar to previous changes (66)
  • crates/mesh-llm-host-runtime/src/mesh/tests/admission.rs
  • crates/mesh-llm-host-runtime/src/models/mod.rs
  • crates/mesh-llm-host-runtime/src/api/routes/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/public_identity_tests.rs
  • crates/mesh-client/src/client/mod.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests/mesh_timestamps.rs
  • crates/mesh-llm-host-runtime/src/api/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/connection_reservation.rs
  • crates/mesh-llm-host-runtime/src/mesh/owner_control/commands/scan_refresh.rs
  • website/src/docs/pages/api-reference.md
  • crates/mesh-llm-host-runtime/src/runtime/startup_identity.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests/owner_control.rs
  • crates/mesh-llm-host-runtime/src/exact_test_wrappers.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests.rs
  • crates/mesh-llm-host-runtime/src/mesh/lan_bootstrap.rs
  • crates/mesh-llm-host-runtime/src/mesh/stun.rs
  • crates/mesh-llm-host-runtime/src/runtime/mod.rs
  • crates/mesh-llm/src/commands/runtime.rs
  • crates/mesh-llm-host-runtime/src/mesh/owner_control/commands/mod.rs
  • crates/mesh-llm-host-runtime/src/runtime_data/collector.rs
  • crates/mesh-llm-host-runtime/src/api/routes/runtime.rs
  • crates/mesh-llm-protocol/proto/node.proto
  • crates/mesh-llm-host-runtime/src/models/inventory.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/protocol_compat.rs
  • crates/mesh-llm/tests/owned_node_commands_cli.rs
  • crates/mesh-llm-host-runtime/src/mesh/mod.rs
  • website/src/docs/pages/CLI.md
  • crates/mesh-llm-host-runtime/src/protocol/tests/control_frames.rs
  • crates/mesh-llm-host-runtime/src/mesh/requirements.rs
  • crates/mesh-llm-host-runtime/src/runtime_data/inventory.rs
  • docs/design/TESTING.md
  • crates/mesh-llm-protocol/src/proto/node.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/connections.rs
  • crates/mesh-llm-host-runtime/src/runtime_data/mod.rs
  • crates/mesh-llm-host-runtime/src/plugin/transport.rs
  • crates/mesh-llm-host-runtime/src/mesh/plugin_streams.rs
  • crates/mesh-llm-protocol/src/protocol/mod.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests/announcements.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/gossip.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/requirements.rs
  • crates/mesh-llm-host-runtime/src/mesh/model_identity.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/direct_path.rs
  • crates/mesh-llm-host-runtime/src/mesh/plugin_mesh.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/admission/helpers.rs
  • scripts/qa-control-plane-mixed-version.sh
  • crates/mesh-llm-host-runtime/src/network/openai/transport.rs
  • crates/mesh-llm-host-runtime/src/protocol/mod.rs
  • crates/mesh-client/tests/control_plane_client.rs
  • crates/mesh-llm-host-runtime/src/protocol/tests/config.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/protocol_frames.rs
  • crates/mesh-llm-host-runtime/src/mesh/artifact_transfer_io.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/stage_transport.rs
  • crates/mesh-llm-host-runtime/src/mesh/peer_state.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/owner_control.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/admission/requirements.rs
  • crates/mesh-llm-host-runtime/src/mesh/node_requirements.rs
  • crates/mesh-llm-host-runtime/src/mesh/direct_path.rs
  • crates/mesh-llm-host-runtime/src/mesh/identity_persistence.rs
  • crates/mesh-llm-host-runtime/src/mesh/owner_control/mod.rs
  • crates/mesh-client/src/client/control_plane.rs
  • crates/mesh-llm-host-runtime/src/mesh/stage_artifacts.rs
  • crates/mesh-llm-host-runtime/src/mesh/stage_transport.rs
  • crates/mesh-llm-host-runtime/src/mesh/node.rs
  • crates/mesh-llm-host-runtime/src/mesh/node_identity.rs
  • crates/mesh-llm-host-runtime/src/mesh/gossip.rs
  • crates/mesh-llm-host-runtime/src/mesh/connections.rs

Comment thread crates/mesh-llm-host-runtime/src/mesh/tests/peer_state.rs
Comment thread crates/mesh-llm-host-runtime/src/mesh/tests/peer_state.rs
Comment thread docs/design/message_protocol.md
Comment thread docs/design/message_protocol.md Outdated
Address current CodeRabbit feedback by routing peer-state coverage through production admission and decoder seams, and clarify owner-control watch protocol semantics.
@ndizazzo
ndizazzo merged commit 5104495 into main Jul 18, 2026
22 checks passed
@ndizazzo
ndizazzo deleted the codex/owned-node-commands-plan branch July 18, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant