Skip to content

fix(os): package elizaOS live runtime plugins#7800

Merged
lalalune merged 7 commits into
developfrom
nubs/elizaos-live-runtime-followup-20260519051650
May 19, 2026
Merged

fix(os): package elizaOS live runtime plugins#7800
lalalune merged 7 commits into
developfrom
nubs/elizaos-live-runtime-followup-20260519051650

Conversation

@NubsCarson
Copy link
Copy Markdown
Member

@NubsCarson NubsCarson commented May 19, 2026

Summary

Fixes the current elizaOS Live packaged-runtime blocker found during QEMU validation: the app window opened, but the backend timed out because @elizaos/plugin-app-manager and @elizaos/plugin-registry were staged as package folders without runtime dist/index.js files.

This PR:

  • builds runtime JS for those first-party plugins during just milady-app
  • keeps plugin-registry externalized from plugin-app-manager
  • extends static smoke so missing runtime plugin dist files fail before ISO promotion
  • refreshes elizaOS desktop launcher labels and docs with the current artifact status
  • keeps the ACP absolute-CLI preflight fix from the CI follow-up patch

Validation

  • packages/os/linux/variants/milady-tails/scripts/static-smoke.sh passed
  • packages/os/linux/variants/milady-tails/scripts/security-smoke.sh passed with expected warnings for missing production update keyring and SBOM/provenance artifacts
  • packaged runtime smoke passed: /api/auth/status returned local unauthenticated status from the staged runtime
  • rebuilt ISO with 4 CPU cap: out/binary.iso
  • ISO SHA256: fb706edd7016b415e53fc263c37d09ed26d7f0d8d3bced250bde5b1b3ea9bec8
  • verified squashfs contains:
    • /opt/milady/Resources/app/eliza-dist/node_modules/@elizaos/plugin-app-manager/dist/index.js
    • /opt/milady/Resources/app/eliza-dist/node_modules/@elizaos/plugin-registry/dist/index.js
  • QEMU boot passed for greeter, GNOME desktop, and elizaOS app onboarding; the previous Backend Timeout screen did not recur
  • docs-only follow-up aa82b25248 clarifies validated-artifact versus exact-release-commit status; it does not change ISO contents

Remaining honest gaps

This is demo-ready for VM review, not a production release claim. Still pending: repeat USB flash/readback for this exact artifact, real hardware boot, real USB Persistent Storage create/unlock/delete, Privacy Mode network proof for embedded web/OAuth surfaces, production update keyring, SBOM/provenance artifacts, and production updater rollout hardening.

Review follow-up

Updated 2026-05-19 after merging latest origin/develop through d683f4bffa:

  • plugin-registry now uses the package's own build:js path during live runtime staging, matching its workspace build contract instead of the direct bun build shortcut.
  • The ACP missing-CLI diagnostic now uses one shared helper for both the Android preflight assertion and the non-spawn runAcpx failure path, so the event payload and error text cannot drift.

Additional validation after this update:

bun run --cwd plugins/plugin-local-inference test -- src/services/__stress__/cache-restart-corruption.test.ts -t 'persistConversationKv handles'
bun run --cwd plugins/plugin-local-inference test -- src/services/dflash-server.test.ts src/services/__stress__/cache-restart-corruption.test.ts
bun run --cwd plugins/plugin-local-inference test -- src/services/backend.test.ts
bun run --cwd plugins/plugin-local-inference format:check
bun install --frozen-lockfile --ignore-scripts
bun run --cwd packages/core build
bun run --cwd plugins/plugin-agent-orchestrator typecheck
bun run --cwd plugins/plugin-agent-orchestrator test:unit -- -t 'fails with a clear diagnostic'
packages/os/linux/variants/milady-tails/scripts/static-smoke.sh
git diff --check

Results:

  • plugin-agent-orchestrator typecheck passed.
  • targeted ACP missing-CLI unit test passed: 1 passed, 212 skipped.
  • static smoke passed.
  • whitespace diff check passed.
  • local-inference KV persistence focused test passed.
  • local-inference restore async error catch regression passed.
  • local-inference dflash server/stress/backend tests passed on latest head: 103 passed.
  • local-inference format check passed.

Greptile Summary

This PR fixes the elizaOS Live packaged-runtime blocker where @elizaos/plugin-app-manager and @elizaos/plugin-registry were staged without built dist/index.js files, causing backend timeouts on QEMU boot. It also refactors the ACP CLI-missing detection into a shared helper and fixes a missing await in dflash-server.ts that made the restoreConversationKv catch block dead code for async errors.

  • Build pipeline: Adds package-build and bun-runtime-index build modes to the milady-app Justfile target; plugin-registry goes through its own build:js script (package-js mode) while plugin-app-manager uses a direct bun build invocation with all first-party deps externalized.
  • ACP service: Extracts missingCliMessage() and emitMissingCli() helpers so runAcpx (all platforms) and assertTransportAvailable (Android throw path) share one error message and event payload, eliminating drift between the two guards.
  • KV persistence interface: Return types of persistConversationKv / restoreConversationKv changed from Promise<void> to Promise<boolean> across the interface, BackendDispatcher, DflashLlamaServer, and FfiStreamingBackend; a new stress test verifies the restoreConversationKv catch block fires correctly on a 500 response.

Confidence Score: 5/5

All three previously flagged issues have been addressed and are backed by targeted new tests; the changes are well-scoped with no apparent correctness regressions.

The return await fix in dflash-server.ts is validated by the new stress test. The ACP refactoring consolidates two code paths into one shared helper without changing observable behaviour on either Android or non-Android. The build pipeline change is straightforward: plugin-registry correctly delegates to its own bun run build:js script, and plugin-app-manager uses a bun build invocation with all first-party deps externalized.

No files require special attention; the most structurally complex change (acp-service.ts) is well-covered by the updated unit test.

Important Files Changed

Filename Overview
plugins/plugin-agent-orchestrator/src/services/acp-service.ts Refactored CLI-missing detection into shared helpers (missingCliMessage, emitMissingCli); runAcpx now short-circuits with code 127 on all platforms when the CLI path doesn't exist, while assertTransportAvailable still throws on Android.
plugins/plugin-local-inference/src/services/dflash-server.ts Return types of persistConversationKv / restoreConversationKv changed from Promise<void> to Promise<boolean>; restoreConversationKv now correctly uses return await so the catch block catches async errors from requestSlotRestore.
plugins/plugin-local-inference/src/services/backend.ts Interface and BackendDispatcher updated to Promise<boolean> return type; dispatcher delegates with bare return (no await) which is safe here since there is no enclosing try/catch.
plugins/plugin-local-inference/src/services/ffi-streaming-backend.ts Adapts persistConversationKv / restoreConversationKv to Promise<boolean>; synchronous FFI calls are now followed by return true, with early-return guards returning false.
packages/os/linux/variants/milady-tails/Justfile Adds package-build and bun-runtime-index build modes with dependency guards; registers plugin-registry (via package-js) and plugin-app-manager (via bun-runtime-index) for live-runtime staging.
packages/os/linux/variants/milady-tails/scripts/static-smoke.sh Adds @elizaos/plugin-app-manager and @elizaos/plugin-registry to the list of plugins whose dist/index.js is verified before ISO promotion.
plugins/plugin-app-manager/build.ts Adds @elizaos/plugin-registry to the externals list so it is not bundled into the plugin-app-manager artifact.
plugins/plugin-local-inference/src/services/stress/cache-restart-corruption.test.ts New stress test verifies that restoreConversationKv resolves to false (rather than leaking a rejected Promise) when the server returns a 500 on the slot-restore POST.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[milady-app Just target] --> B{ensure_plugin_runtime_dist}
    B --> C[plugin-health\npackage-js]
    B --> D[plugin-calendly\ntsup-index]
    B --> E[plugin-registry\npackage-js]
    B --> F[plugin-app-manager\nbun-runtime-index]

    E --> G[bun run build:js\ntsup shared config]
    F --> H[bun build src/index.ts\nexternal: plugin-registry, core, etc.]

    I[static-smoke.sh] --> J{check dist/index.js}
    J --> K[plugin-app-manager ✓]
    J --> L[plugin-calendly ✓]
    J --> M[plugin-health ✓]
    J --> N[plugin-registry ✓]

    O[runAcpx] --> P{missingCliMessage?}
    P -- yes --> Q[return code 127\nemit error event]
    P -- no --> R[spawn CLI process]

    S[assertTransportAvailable\nAndroid only] --> T{missingCliMessage?}
    T -- yes --> U[emitMissingCli + throw]
    T -- no --> V[continue]
Loading

Reviews (5): Last reviewed commit: "fix(local-inference): await slot restore..." | Re-trigger Greptile

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Important

Review skipped

Auto reviews are disabled on this repository. 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

Run ID: de8ac05a-5eb0-4d6c-b8bd-537fb7943dcc

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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nubs/elizaos-live-runtime-followup-20260519051650

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 and usage tips.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 19, 2026

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

Comment thread packages/os/linux/variants/milady-tails/Justfile Outdated
Comment thread plugins/plugin-agent-orchestrator/src/services/acp-service.ts Outdated
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 19, 2026

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 19, 2026

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 19, 2026

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 19, 2026

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

Comment thread plugins/plugin-local-inference/src/services/dflash-server.ts
Without `await`, the async rejection from `requestSlotRestore` propagates
out of `restoreConversationKv` as a raw rejected Promise instead of being
caught and swallowed as `false`. The catch was dead for async errors.

Adds a direct stress-test case that exercises the 500-on-restore path
through `DflashLlamaServer.restoreConversationKv` and asserts the result
resolves to `false`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 19, 2026

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@lalalune lalalune merged commit cd3d338 into develop May 19, 2026
37 checks passed
@lalalune lalalune deleted the nubs/elizaos-live-runtime-followup-20260519051650 branch May 19, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants