Skip to content

feat(mesh): load deadline-safe native serving plugins - #1155

Merged
i386 merged 8 commits into
agent/generation-lifecycle-eventsfrom
agent/native-serving-plugin
Aug 4, 2026
Merged

feat(mesh): load deadline-safe native serving plugins#1155
i386 merged 8 commits into
agent/generation-lifecycle-eventsfrom
agent/native-serving-plugin

Conversation

@i386

@i386 i386 commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Use case

An inference product should be able to attach a native proposal/state implementation to the normal Mesh OpenAI serving binary without wrapping Mesh, owning another model runtime, or blocking Skippy's decode loop.

Dependencies

This draft is stacked on #1149 and merges #1152 so the complete contract compiles and tests together. The session-identity portion will disappear from this diff when #1152 lands.

Change

  • Add a small versioned C-compatible mesh-native-serving-plugin-api function-table ABI with safe Rust-side types.
  • Add mesh-native-serving-plugin-host, loaded only when explicit hidden local-serving flags provide the library, config, state directory, and deadline.
  • Map Mesh's authoritative tokenizer, authenticated agent session, generation begin/commit/finish/abort, proposal submit/poll/cancel, and proposal outcomes across the ABI.
  • Run plugin work on a bounded worker queue. Mesh owns the absolute proposal deadline, stops waiting at that deadline, and cancels work without allowing a blocking plugin call to hold the decode path.
  • Validate ABI version, table size, status values, correlation identities, output lengths, token buffers, and proposal bounds fail-closed.
  • Remove the fixed 256-token proposal ceiling. Each query carries the exact capacity allowed by the current runtime/context/verifier boundary, and the host allocates the return buffer to that capacity.
  • Keep the normal Mesh executable and --local-model-only startup path. There is no alternate launcher or compatibility entrypoint.

Runtime contract

Without plugin flags, behavior is unchanged. With plugin flags, all flags are required together and local-model-only serving creates the native hook factory after loading the plugin. Skippy remains authoritative for model execution, tokenizer identity, KV cache, scheduling, verification, proposal admission, and outcomes.

Validation

  • Focused compile passes for the ABI, host, CLI, Mesh runtime, and Skippy.
  • 507 focused tests pass: 2 ABI, 4 host/loader, 149 OpenAI frontend, and 352 Skippy.
  • The hard-deadline test blocks inside plugin proposal submission for 250 ms; a 5 ms query still returns before the decode-path bound and cancellation is delivered later.
  • Strict Clippy passes for the ABI, host, CLI, OpenAI frontend, and Skippy with -D warnings.
  • Workspace publish-order, CI crate-list, and all-Rust-crate coverage consistency checks pass.

The broader host runtime still reports 28 pre-existing unfulfilled_lint_expectations warnings in untouched compatibility code; the focused strict-Clippy set is clean.

i386 added 3 commits August 2, 2026 17:58
…ity' into agent/native-serving-plugin

# Conflicts:
#	crates/openai-frontend/src/router.rs
#	crates/skippy-server/src/frontend/generation/cache_hints.rs
#	crates/skippy-server/src/frontend/generation_flow.rs
#	crates/skippy-server/src/frontend/local_generation.rs
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8570aa58-1573-4fbd-8a6c-a593a326b4b5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ 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 agent/native-serving-plugin

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 commented Aug 2, 2026

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.

@i386
i386 marked this pull request as ready for review August 2, 2026 23:03
@github-actions
github-actions Bot requested a review from michaelneale August 2, 2026 23:03
@i386
i386 marked this pull request as draft August 3, 2026 05:44
@i386
i386 marked this pull request as ready for review August 4, 2026 03:38
@github-actions
github-actions Bot requested a review from ndizazzo August 4, 2026 03:43

i386 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Please perform a full review of the current PR head, including the native serving plugin ABI, deadline/cancellation behavior, and the restored dynamic proposal-width contract.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

@i386 I will perform a full review of the current PR head. I will check the native serving plugin ABI, deadline and cancellation behavior, and the dynamic proposal-width contract.

✅ Action performed

Full review finished.

@i386
i386 merged commit 18aeb33 into agent/generation-lifecycle-events Aug 4, 2026
58 checks passed
@i386
i386 deleted the agent/native-serving-plugin branch August 4, 2026 11:20
ndizazzo pushed a commit that referenced this pull request Aug 4, 2026
* feat(openai): propagate stable agent session identity

* feat(mesh): load deadline-safe native serving plugins

* docs: document native serving integrations

* fix(skippy): preserve native proposal query contract

* fix(skippy): compile native proposal plugin tests

* fix(plugin): use public proposal query constructor
ndizazzo pushed a commit that referenced this pull request Aug 4, 2026
* feat(openai): propagate stable agent session identity

* feat(mesh): load deadline-safe native serving plugins

* docs: document native serving integrations

* fix(skippy): preserve native proposal query contract

* fix(skippy): compile native proposal plugin tests

* fix(plugin): use public proposal query constructor
ndizazzo added a commit that referenced this pull request Aug 4, 2026
* feat(skippy): expose authoritative generation lifecycle

* refactor(mesh): remove injected local model launcher

* fix(skippy): make serving hooks independent

* feat(mesh): load deadline-safe native serving plugins (#1155)

* feat(openai): propagate stable agent session identity

* feat(mesh): load deadline-safe native serving plugins

* docs: document native serving integrations

* fix(skippy): preserve native proposal query contract

* fix(skippy): compile native proposal plugin tests

* fix(plugin): use public proposal query constructor

* fix(skippy): make lifecycle delivery nonblocking

* refactor(skippy): add lifecycle ingress adapter

* fix: address generation lifecycle review

---------

Co-authored-by: Nick DiZazzo <nick.dizazzo@gmail.com>
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.

2 participants