Skip to content

fix: move model lifecycle controls off peer-reachable ingress - #1279

Merged
ndizazzo merged 3 commits into
mainfrom
codex/issue-1190-lifecycle-ingress-impl
Aug 13, 2026
Merged

ndizazzo merged 3 commits into
mainfrom
codex/issue-1190-lifecycle-ingress-impl

Conversation

@ndizazzo

@ndizazzo ndizazzo commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Original problem

POST /mesh/load and POST /mesh/drop were handled by the model-aware OpenAI ingress on :9337. Because inbound STREAM_TUNNEL_HTTP traffic is relayed to the loopback API port, an admitted peer could reach model lifecycle controls through the same channel intended for inference and discovery.

Diagnostics

The request path was traced through the OpenAI ingress, the runtime proxy, and the inbound HTTP tunnel relay. Regression tests cover both direct ingress requests and the passive/bootstrap path used for tunneled peer HTTP requests.

Fix

  • Removed model load/drop runtime-control handlers and control-channel plumbing from the peer-reachable OpenAI ingress.
  • Recognize the legacy /mesh/load and /mesh/drop paths before any inference or model routing, including query-string variants.
  • Return HTTP 410 Gone with the legacy_route_gone error code for those legacy paths. They do not reach an inference upstream and cannot mutate runtime state.
  • Kept inference, model discovery, normal peer HTTP tunneling, and Skippy stage control/transport behavior unchanged.
  • Retained the trusted local lifecycle API as the canonical path:
    • POST :3131/api/runtime/models
    • DELETE :3131/api/runtime/models/{model}
  • Retained authenticated owner-control lifecycle commands for remote administration.
  • Added tests proving the canonical management routes still load/unload models and the legacy ingress paths are rejected without routing or mutation.
  • Updated hosted-mesh and runtime lifecycle documentation, including the compatibility behavior for older callers.

This is an HTTP-surface compatibility change only; the mesh wire protocol is unchanged, and mixed-version inference/split serving remains supported.

Validation

  • just with-lld cargo test -p mesh-llm-host-runtime -- --test-threads=1 — 2,455 passed, 8 ignored.
  • just with-lld cargo clippy -p mesh-llm-host-runtime --all-targets -- -D warnings — passed.
  • just build — passed.
  • just website-build — passed.
  • git diff --check — passed.
  • No UI changes; screenshots are not applicable.

Closes #1190

Summary by CodeRabbit

  • Breaking Changes

    • Legacy /mesh/load and /mesh/drop endpoints now return 410 Gone without changing runtime state, including through inbound tunnels.
    • OpenAI interfaces remain available for inference and model discovery.
  • New Features

    • Local lifecycle operations use the management API.
    • Remote administration uses authenticated owner-control endpoints.
  • Documentation

    • Updated lifecycle and hosted mesh serving guidance.
  • Tests

    • Added coverage confirming rejected lifecycle requests are not forwarded.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e96ad667-91cb-41f3-a049-7cda04d8c961

📥 Commits

Reviewing files that changed from the base of the PR and between a429090 and ae1a79e.

📒 Files selected for processing (1)
  • crates/mesh-llm-host-runtime/src/network/openai/ingress.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/mesh-llm-host-runtime/src/network/openai/ingress.rs

📝 Walkthrough

Walkthrough

The OpenAI ingress no longer handles runtime model load or unload requests. Legacy lifecycle paths return HTTP 410 before routing. Runtime control-channel wiring is removed. Local lifecycle APIs, rejection behavior, and control-surface documentation receive coverage.

Changes

Lifecycle ingress separation

Layer / File(s) Summary
Legacy route rejection contract
crates/mesh-llm-host-runtime/src/network/openai/request_parse.rs, crates/mesh-llm-host-runtime/src/network/openai/response/..., crates/mesh-llm-host-runtime/src/network/openai/transport...
The parser recognizes /mesh/load and /mesh/drop, including query strings. The transport rejects these paths with HTTP 410 and legacy_route_gone before mesh routing.
OpenAI ingress control removal
crates/mesh-llm-host-runtime/src/network/openai/ingress.rs, crates/mesh-llm-host-runtime/src/network/openai/ingress_tests/*
The ingress removes lifecycle dispatch and runtime control-channel state. Legacy-path rejection occurs before inference admission.
Runtime proxy wiring update
crates/mesh-llm-host-runtime/src/runtime/proxy.rs, crates/mesh-llm-host-runtime/src/runtime/proxy/tests/*, crates/mesh-llm-host-runtime/src/runtime/serving_surface.rs
Proxy entry points, serving setup, and test harnesses no longer create or forward the runtime control channel.
Lifecycle validation and documentation
crates/mesh-llm-host-runtime/src/api/tests/runtime_lifecycle_routes.rs, crates/mesh-llm-host-runtime/src/runtime/proxy/tests/basic.rs, crates/mesh-llm-host-runtime/src/network/openai/transport_tests/durable_artifacts.rs, docs/plugins/plugin-hosted-mesh-serving-design.md, website/src/docs/pages/runtime-lifecycle.md
Tests cover local load and unload routes. Integration tests confirm legacy routes return HTTP 410, preserve runtime state, and do not reach inference targets. Documentation identifies local management and remote owner-control paths.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Mergeability Score: ⚪ Minimal · up to ae1a7

The change removes peer-reachable model lifecycle controls while preserving canonical local management, inference, tunneling, and owner-control behavior; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant OpenAIIngress
  participant RequestParser
  participant MeshTransport
  participant InferenceTarget
  Client->>OpenAIIngress: POST /mesh/load or /mesh/drop
  OpenAIIngress->>RequestParser: classify path
  RequestParser->>MeshTransport: identify legacy lifecycle route
  MeshTransport-->>Client: HTTP 410 legacy_route_gone
  Note over MeshTransport,InferenceTarget: No request is forwarded
Loading

Possibly related PRs

  • Mesh-LLM/mesh-llm#1082: Adds authenticated management and owner-control lifecycle APIs that supersede the legacy routes.
  • Mesh-LLM/mesh-llm#1175: Modifies the same OpenAI ingress lifecycle routing and path parsing areas.

Suggested reviewers: i386

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: moving model lifecycle controls off the peer-reachable ingress.
Linked Issues check ✅ Passed The changes satisfy issue #1190 by rejecting legacy lifecycle routes with 410 Gone, preserving inference and discovery, and retaining trusted management paths.
Out of Scope Changes check ✅ Passed The code, tests, and documentation changes directly support issue #1190 and do not introduce unrelated scope.
Docstring Coverage ✅ Passed Docstring coverage is 84.62% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-1190-lifecycle-ingress-impl

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
github-actions Bot requested a review from i386 August 13, 2026 02:07
@ndizazzo ndizazzo added this to the 0.76.0 milestone Aug 13, 2026

@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: 1

🤖 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/network/openai/transport_tests/durable_artifacts.rs`:
- Around line 3-55: Expand passive_legacy_lifecycle_paths_are_rejected to use
two test nodes connected through Node::open_http_tunnel and the
STREAM_TUNNEL_HTTP path, with the receiving node’s API proxy handling /mesh/load
and /mesh/drop. Assert each response is 410 Gone with legacy_route_gone, and
verify the runtime state remains unchanged and no inference request is
forwarded.
🪄 Autofix

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: 71138dfb-e62f-4c79-a92a-6c7b8d748d10

📥 Commits

Reviewing files that changed from the base of the PR and between 3fb86fe and a50134c.

📒 Files selected for processing (14)
  • crates/mesh-llm-host-runtime/src/api/tests/runtime_lifecycle_routes.rs
  • crates/mesh-llm-host-runtime/src/network/openai/ingress.rs
  • crates/mesh-llm-host-runtime/src/network/openai/ingress_tests/durable_artifacts.rs
  • crates/mesh-llm-host-runtime/src/network/openai/request_parse.rs
  • crates/mesh-llm-host-runtime/src/network/openai/response.rs
  • crates/mesh-llm-host-runtime/src/network/openai/response/send.rs
  • crates/mesh-llm-host-runtime/src/network/openai/transport.rs
  • crates/mesh-llm-host-runtime/src/network/openai/transport_tests/durable_artifacts.rs
  • crates/mesh-llm-host-runtime/src/runtime/proxy.rs
  • crates/mesh-llm-host-runtime/src/runtime/proxy/tests/basic.rs
  • crates/mesh-llm-host-runtime/src/runtime/proxy/tests/mod.rs
  • crates/mesh-llm-host-runtime/src/runtime/serving_surface.rs
  • docs/plugins/plugin-hosted-mesh-serving-design.md
  • website/src/docs/pages/runtime-lifecycle.md
💤 Files with no reviewable changes (3)
  • crates/mesh-llm-host-runtime/src/network/openai/ingress_tests/durable_artifacts.rs
  • crates/mesh-llm-host-runtime/src/runtime/serving_surface.rs
  • crates/mesh-llm-host-runtime/src/runtime/proxy.rs

@ndizazzo
ndizazzo force-pushed the codex/issue-1190-lifecycle-ingress-impl branch from a429090 to ae1a79e Compare August 13, 2026 09:53

@michaelneale michaelneale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thanks, yes we need this.

@ndizazzo
ndizazzo force-pushed the codex/issue-1190-lifecycle-ingress-impl branch from ae1a79e to fe830d3 Compare August 13, 2026 11:17
@ndizazzo
ndizazzo merged commit 7a92bc0 into main Aug 13, 2026
46 checks passed
@ndizazzo
ndizazzo deleted the codex/issue-1190-lifecycle-ingress-impl branch August 13, 2026 16:00
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.

Move model load/drop controls off the peer-reachable OpenAI ingress

2 participants