Voltar ao Blog
CortexPrism v0.52.0 — Distributed Intelligence: WASM Plugin Runtime Overhaul, Multi-Instance Swarm Orchestration, 6 New LLM Providers

CortexPrism v0.52.0 — Distributed Intelligence: WASM Plugin Runtime Overhaul, Multi-Instance Swarm Orchestration, 6 New LLM Providers

CortexPrism v0.52.0 is here — the distributed intelligence release that fundamentally expands what the platform can do. WASM plugins can now be compiled from C, Rust, or Zig with a production-grade runtime.

jacobJune 23, 20267 min de leitura5 visualizações

Cortex instances can form distributed agent swarms across multiple machines. Six new LLM providers bring the total to 30. And six critical codegraph bugs — some of which masked each other for months — are finally resolved.

WASM Plugin Runtime — Complete Overhaul

The WASM plugin runtime was rewritten from scratch. The previous implementation had critical architectural flaws that made it unsuitable for production use: hardcoded memory offsets that could collide with WASM stack and heap data, an http_request function that launched fetch().then(...) and returned immediately (leaving the WASM module reading garbage from unpopulated memory), no ABI versioning (any WASM module could load regardless of compatibility), no PluginContext integration (no logging, state, or configuration), and no memory lifecycle management (plugin_destroy was never called, leaking WebAssembly.Memory and instances).

v0.52.0 replaces all of this with:

  • ABI versioning so forward/backward compatible plugin loading works reliably. Host rejects WASM modules with unsupported ABI versions.

  • Linear memory bump allocator (host_alloc/host_free) with a 64KB host scratch area, 64KB allocator metadata, and 896KB managed heap. Bounds-checked with auto-grow. No more hardcoded offset magic numbers.

  • Synchronous HTTP via a dedicated Worker thread + SharedArrayBuffer + Atomics.wait with 30-second timeout. Proper status code and body return. The broken fire-and-forget pattern is gone.

  • Tool parameter schemas (params[] with name, type, description, required) so LLMs can read and understand what each WASM tool does.

  • PluginContext integration — WASM plugins now have access to logging (host_log), state persistence (host_set_state/host_get_state via SQLite-backed cache with dirty tracking), and configuration (host_get_config via CORTEX_PLUGIN_{NAME}_{KEY} env vars).

  • Permission enforcementhost_http_request gates on network:fetch or net:outbound capability. Returns HTTP 403 if the required permission isn't declared.

  • Execution timeouts — 120-second maximum per tool execution, preventing runaway WASM tools.

  • Supply-chain binary scanningscanWasmBinary() parses WASM section headers at install time, detecting suspicious imports (wasi_snapshot_preview1.proc_exit, sock_*, args_get, environ_get), excessive memory requests (>4GB), unknown env imports, and WASM version mismatches.

  • Diagnostics APIgetWasmDiagnostics(name) returns memory usage, heap pointer position, ABI version, and registered tool count.

  • SDK — a C-compatible header (wasm-plugin.h) declaring all host functions, memory layout constants, and required exports. A TypeScript client library (client.ts) with defineTool(), definePlugin(), generateCapabilitiesJson(), and generateWasmPluginModule() helpers.

  • Test suite — 7 tests covering binary encoding, module compilation, ABI version checking, supply-chain scanning, memory layout, capabilities JSON parsing, and worker code integrity.

All host function names were standardized with a host_ prefix for clarity. 3,900+ lines of stale duplicate plugin code in packages/core/src/plugins/ were replaced with re-exports to the canonical src/plugins/ implementations.

Multi-Instance Swarm Orchestration

Cortex instances can now form distributed agent swarms — think of it as a Kubernetes for AI agents, but simpler and native to the platform. Multiple Cortex instances discover each other, exchange heartbeat metrics, dispatch work directives, and aggregate resource usage into a unified fleet view.

The architecture is cleanly layered:

  1. ContractsISwarmNode, ISwarmCoordinator, ISwarmTransport pure TypeScript interfaces defining the swarm boundary.
  2. Node registry — heartbeat-based registration with periodic metrics snapshots. Stale nodes are evicted. Peers discovered via A2A agent cards, configured seed nodes, or shared database.
  3. Transport — directives mapped to A2A SendMessage JSON-RPC calls with agent card caching and Promise.allSettled broadcast fan-out.
  4. Coordinator — singleton managing self-registration, peer discovery, directive dispatch (tracked in a dedicated swarm_directives table), broadcast to node groups, aggregated resource reporting, and a 30-second heartbeat loop.
  5. Directive handler — processes all five directive kinds on the receiving node: spawn_agent, execute_task, query_resources, forward_message, and sync_state.
  6. Remote kernel — proxies remote processes into the local OS kernel process tree with synthetic PIDs (≥900000), enabling unified resource accounting across the entire fleet.
  7. A2A server integration — swarm directives are detected via metadata.swarmKind and routed to the directive handler instead of the normal Cortex executor.

The Web UI gains a dedicated Nodes page with fleet summary cards (average CPU, total memory, active sessions, processes, tokens today), individual node cards with color-coded CPU and memory bars, and a view-mode toggle between Node List, Swarm Topology (process tree visualization + fleet token/cost report), and Directive History. Five new API routes expose topology, reports, directives, node metrics, and snapshots. The CLI gets cortex swarm with init, nodes, topology, report, drain, and seal subcommands.

6 New LLM Providers (30 Total)

CortexPrism now supports 30 LLM providers with the addition of six new ones:

  • DeepInfra — running Llama 3.3 70B as default, with pricing for 6 models
  • Hyperbolic — 80% cheaper than traditional cloud providers, defaulting to DeepSeek-V3
  • MiniMax — shipping the M3 model which scores 80.5% on SWE-bench Verified at just $0.30/$1.20 per 1M tokens — the cheapest 80%+ coding model available through any hosted API
  • Zhipu (GLM) — offering GLM-4-Flash with a free tier
  • Replicate — using a predictions-based API with polling and SSE streaming for open-source models
  • Cloudflare Workers AI — edge inference platform requiring an Account ID alongside the API token

6 Codegraph Bug Fixes

The code intelligence subsystem had six bugs that compounded each other, making the call graph and dependency visualization unreliable. Call edges were attributed to empty source qualified names, causing all edges to point to the first node in each file. Edge source paths used absolute paths while node keys used relative paths, so resolveEdges couldn't find valid source nodes. Bulk node inserts returned wrong IDs because separate SQL statements ran on different connections. A cleanup DELETE after each insert chunk removed all edges instead of just orphans. The auto-index endpoint re-triggered indexing on every page load when the node count appeared to be zero (stale from a previous failed index), causing an infinite delete-and-retry loop. And stale projects from deleted workspaces persisted in the database forever. All six are now fixed, and the codegraph is reliably functional.

Production Bug Fixes (12+)

A dozen production bugs that ranged from "this never worked" to "this silently corrupted data" were resolved:

Six CLI aliases (cortex chat, tui, serve, start, stop, restart) were dead stubs that printed a deprecation warning and exited with code 1 — the real implementations existed but were unreachable. Six fully-implemented CLI commands (cortex run, update, migrate, service, qm, mqm — 1,475 lines total) were never registered in the active command registry. PUT /api/workflows/:id accepted update bodies but returned { ok: true } without modifying anything. Pipeline hooks pre-reflect and post-reflect were defined in the type union but never wired to the hook system. decryptValue() caught decryption errors but returned the encrypted string instead of null, allowing corrupted blobs to flow through the config loader. GitHub clone operations had no token authentication, blocking private repos. The Telegram webhook dispatched to the wrong method name. The channel bridge called the agent turn with zero tools, no workspace directory, and no system prompt. A migration file was created in the wrong directory, crashing server startup. Model fetch endpoints for Novita, Alibaba, and Cloudflare were broken. And LM Studio had dead configuration fields shown in the UI.

Technical Excellence

CortexPrism maintains its commitment to technical quality:

  • Deno 2.x strict TypeScript — single binary, no Docker required
  • SQLite (WAL mode) via libSQL — five databases with clean schema
  • 6 workspace packages with 41 pure TypeScript contract interfaces in a clean dependency graph (core ← gate ← ai ← server ← cli)
  • 30 LLM providers with a unified streaming interface and intelligent model routing
  • 5-tier persistent memory with hybrid search, automatic learning, and health monitoring
  • Production-ready WASM runtime — ABI versioning, memory safety, supply-chain scanning
  • Distributed swarm coordination — A2A-native, heartbeat-based, resource-aware
  • Rigorous security — Parallax policy validator + LLM supervisor + SSRF protection
  • Zero telemetry — everything runs on your hardware

Get Started

Ready to experience distributed intelligence?

# Install
curl -fsSL https://cortexprism.io/install.sh | bash

# Setup and start
cortex setup
cortex serve

# Open http://localhost:3000

Already running? Upgrade in place:

cortex self update

The project is Apache 2.0 licensed, fully open source, and has zero telemetry. Everything runs on your hardware.

GitHub: github.com/CortexPrism/cortex Changelog: CHANGELOG.md


Built with Deno. 6 packages. WASM plugin runtime. Multi-instance swarms. 30 LLM providers. Zero telemetry.

J

jacob

Related posts

CortexPrism v0.53.0 — Team-Ready: Multi-User Collaboration, Teams, API Tokens, Resource Scoping, Federation, and Internationalization
+8

CortexPrism v0.53.0 — Team-Ready: Multi-User Collaboration, Teams, API Tokens, Resource Scoping, Federation, and Internationalization

CortexPrism v0.53.0 is here — the team-ready release that fundamentally redefines who can use the platform.

jacobJune 24, 20266 min de leitura4
CortexPrism v0.51.0 — Agent Autonomy: Runtime Tool Forging, Multi-Agent Orchestration, HEXACO Personalities
+5

CortexPrism v0.51.0 — Agent Autonomy: Runtime Tool Forging, Multi-Agent Orchestration, HEXACO Personalities

CortexPrism v0.51.0 is here — the agent autonomy release that fundamentally transforms what agents can do.

jacobJune 23, 20267 min de leitura3