From 0b5da36ad347ad3edb519c3ba80a71b15b9f59fb Mon Sep 17 00:00:00 2001
From: Rohit Ghumare
Date: Thu, 29 Oct 2026 15:25:42 +0530
Subject: [PATCH 01/36] feat(runtime): pin iii 0.25-built state/http workers
and lift the transport cap to 64 MiB
state 0.22.20 and http 0.22.7 are built on iii-sdk 0.24.6, which caps outgoing
messages at 16 MiB, so any whole-scope state read past that failed with
payload_too_large. state 0.22.22 and http 0.22.8 are iii-sdk 0.25.0 builds that
fragment messages up to 64 MiB, so the payload guard moves to 60 MiB.
Graph index migration now appends the underlying error to its storage-failure
message, AGENTMEMORY_LOCAL_DISPATCH=false sends internal calls back through the
engine for full traces, and gate:large-store measures large scopes against a
real Compose runtime. The startup gate gains --repeat N for cold-boot loops.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Signed-off-by: Rohit Ghumare
---
.env.example | 1 +
CHANGELOG.md | 14 +
INSTALL_FOR_AGENTS.md | 2 +-
deploy/Dockerfile | 4 +-
deploy/README.md | 2 +-
docker-compose.yml | 4 +-
docs/reliability/compression-recovery.md | 2 +-
docs/upgrades/iii-0.25.md | 3 +-
package.json | 1 +
plugin/skills/agentmemory-config/REFERENCE.md | 3 +-
scripts/docs-sync.state.json | 2 +-
scripts/release-gate/graph-index.mjs | 4 +-
scripts/release-gate/large-store.mjs | 463 ++++++++++++++++++
scripts/release-gate/startup.mjs | 36 +-
scripts/release-gate/vector-recovery.mjs | 4 +-
src/cli/compose-project.ts | 5 +-
src/functions/export-import.ts | 4 +-
src/index.ts | 5 +-
src/runtime/registration.ts | 19 +
src/state/frame-guard.ts | 10 +-
src/state/graph-index-migration.ts | 10 +-
test/engine-config.test.ts | 6 +-
test/engine-launch-hardening.test.ts | 4 +-
test/export-incremental-budget.test.ts | 12 +-
test/frame-guard.test.ts | 2 +-
test/graph-index-migration.test.ts | 16 +-
test/graph-ingestion.test.ts | 2 +-
test/mcp-standalone-proxy.test.ts | 6 +-
test/observation-source.test.ts | 2 +-
test/registration-defaults.test.ts | 61 +++
website/app/security/page.tsx | 2 +-
31 files changed, 658 insertions(+), 53 deletions(-)
create mode 100644 scripts/release-gate/large-store.mjs
create mode 100644 src/runtime/registration.ts
create mode 100644 test/registration-defaults.test.ts
diff --git a/.env.example b/.env.example
index e325877f3a..1075f68d68 100644
--- a/.env.example
+++ b/.env.example
@@ -216,6 +216,7 @@
# The CLI downloads the engine into ~/.agentmemory/bin on macOS/Linux.
# Native Windows requires installing the matching iii.exe manually.
# AGENTMEMORY_III_VERSION=0.25.0 # Override only when deliberately matching a different engine
+# AGENTMEMORY_LOCAL_DISPATCH=true # iii 0.25 runs calls to the worker's own functions in-process; set false for full engine traces
# Engine usage telemetry (iii). Off unless you set it; true opts in.
# III_TELEMETRY_ENABLED=false
diff --git a/CHANGELOG.md b/CHANGELOG.md
index abac402cbc..c085383eda 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
## [Unreleased]
+### Added
+
+- **`AGENTMEMORY_LOCAL_DISPATCH` runtime switch.** iii 0.25 runs a worker's calls to its own functions in-process by default, so AgentMemory's internal calls produce only the SDK's execute span and skip the engine round trip. Set `AGENTMEMORY_LOCAL_DISPATCH=false` for full engine call spans at the cost of a round trip per call.
+- **`npm run gate:large-store`**, a release-gate harness that seeds `mem:semantic`, `mem:graph:nodes`, `mem:graph:edges`, `mem:insights` and `mem:sessions` to configurable sizes directly through the engine, then measures the semantic, insights, sessions, counts, graph-index migration, export and mesh-export probes against a real Compose runtime. `--small` selects CI-friendly sizes; `--state-version`/`--http-version` allow A/B runs against different registry worker pins and `--assert` turns it into a gate.
+- **`--repeat N` for the startup release gate**, which runs the whole scenario suite N times in fresh temp dirs and reports a per-run pass/fail summary.
+
+### Changed
+
+- **Registry worker pins move to `state@0.22.22` and `http@0.22.8`.** Both are built on iii-sdk 0.25.0, which fragments engine transport messages up to 64 MiB; the previous 0.22.20/0.22.7 workers cap outgoing messages at 16 MiB, so whole-scope state reads beyond that failed. The payload guard (`SAFE_PAYLOAD_BYTES`) rises to 60 MiB and its error now names the engine transport message limit.
+
+### Fixed
+
+- **Graph index migration errors now include the underlying cause** (#1617). The friendly "storage failure" sentence is kept and the original `code: message` detail is appended (truncated to 300 chars), so a `payload_too_large` rejection or similar storage error is visible instead of hidden.
+
## [0.9.31] — 2026-10-25
### Upgrade notes
diff --git a/INSTALL_FOR_AGENTS.md b/INSTALL_FOR_AGENTS.md
index 49d6e11120..77e1ad519d 100644
--- a/INSTALL_FOR_AGENTS.md
+++ b/INSTALL_FOR_AGENTS.md
@@ -4,7 +4,7 @@ You are a coding agent. Follow this runbook top to bottom to install agentmemory
## What you are installing
-agentmemory is a local memory server for coding agents. Its CLI starts an iii Worker Compose runtime using the pinned iii 0.25.0 engine and registry workers `state@0.22.20` and `http@0.22.7`. The default listeners are REST/MCP HTTP on port 3111, the viewer on 3113, and the internal engine WebSocket on 49134. The viewer receives live updates as SSE through `GET /agentmemory/viewer/events` on the REST port.
+agentmemory is a local memory server for coding agents. Its CLI starts an iii Worker Compose runtime using the pinned iii 0.25.0 engine and registry workers `state@0.22.22` and `http@0.22.8`. The default listeners are REST/MCP HTTP on port 3111, the viewer on 3113, and the internal engine WebSocket on 49134. The viewer receives live updates as SSE through `GET /agentmemory/viewer/events` on the REST port.
The CLI downloads the pinned engine into `~/.agentmemory/bin` on macOS/Linux. Native Windows needs a manually installed pinned `iii.exe`; WSL2 follows the Linux path. Persistent state defaults to `~/Library/Application Support/agentmemory` on macOS, `$XDG_DATA_HOME/agentmemory` or `~/.local/share/agentmemory` on Linux, and `%APPDATA%\agentmemory` on Windows. Override the directory with `--data-dir ` or `AGENTMEMORY_DATA_DIR`, and reuse the same override on every restart. `AGENTMEMORY_ENV_FILE` selects a non-default env file. Instance 0 reuses an existing `./data/state_store.db` when present. `--instance N` creates an isolated directory and port set for another runtime.
diff --git a/deploy/Dockerfile b/deploy/Dockerfile
index d09589a7c3..dafe7cf4a8 100644
--- a/deploy/Dockerfile
+++ b/deploy/Dockerfile
@@ -1,8 +1,8 @@
# Shared build for local Compose and every deployment platform.
# Update these four pins together when promoting the runtime.
ARG III_VERSION=0.25.0
-ARG STATE_VERSION=0.22.20
-ARG HTTP_VERSION=0.22.7
+ARG STATE_VERSION=0.22.22
+ARG HTTP_VERSION=0.22.8
FROM node:24-slim AS agent-build
ARG III_VERSION
diff --git a/deploy/README.md b/deploy/README.md
index 6cb8a73e41..1db2b33705 100644
--- a/deploy/README.md
+++ b/deploy/README.md
@@ -1,6 +1,6 @@
# Docker deployments
-agentmemory runs on iii 0.25.0 with the `state` 0.22.20 and `http` 0.22.7 registry workers. All image builds use one [`Dockerfile`](Dockerfile), with engine and registry worker pins declared once. Update those build arguments together when promoting a release. Workers are fetched from the iii registry at startup; the `worker-compose.yaml` uses the same Worker Compose format as the CLI.
+agentmemory runs on iii 0.25.0 with the `state` 0.22.22 and `http` 0.22.8 registry workers. All image builds use one [`Dockerfile`](Dockerfile), with engine and registry worker pins declared once. Update those build arguments together when promoting a release. Workers are fetched from the iii registry at startup; the `worker-compose.yaml` uses the same Worker Compose format as the CLI.
The container runs `iii compose --up`: Compose owns the engine and supervises `state`, `http`, and the local `agentmemory` worker. There is no legacy embedded engine config, standalone stream, pubsub, or queue worker. The registry worker artifacts are pinned in the compose manifest. Engine and worker state, agentmemory state, generated secret, Compose cache, and logs live on the persistent `/data` volume. For Docker Compose, the volume key is `iii-data`, normally stored as `_iii-data`; set `AGENTMEMORY_DATA_DIR` to a host path to use a bind mount instead. The state worker continues to use `/data/state_store.db`, so the existing 0.22.1 file-based store is read in place without conversion or deletion.
diff --git a/docker-compose.yml b/docker-compose.yml
index cd236d8243..7143f5a6f1 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -5,8 +5,8 @@ services:
dockerfile: deploy/Dockerfile
args:
III_VERSION: "${III_VERSION:-0.25.0}"
- STATE_VERSION: "${STATE_VERSION:-0.22.20}"
- HTTP_VERSION: "${HTTP_VERSION:-0.22.7}"
+ STATE_VERSION: "${STATE_VERSION:-0.22.22}"
+ HTTP_VERSION: "${HTTP_VERSION:-0.22.8}"
restart: unless-stopped
environment:
AGENTMEMORY_DATA_DIR: /data
diff --git a/docs/reliability/compression-recovery.md b/docs/reliability/compression-recovery.md
index 8e5fa1d06b..3cc166f9d6 100644
--- a/docs/reliability/compression-recovery.md
+++ b/docs/reliability/compression-recovery.md
@@ -34,4 +34,4 @@ The authenticated REST equivalents are:
Both accept `project`, `agentId`, `limit` and `cursor`; at least `sessionId` or `project` is required. Results contain identifiers, status, safe error codes and counts. They do not return retained source or raw provider errors. A retry result with `success: false` exits the CLI with status 1. Inspect `recovered`, `items[].outcome` and `items[].retryable` for each batch; source-unavailable or concurrently changed rows are not model successes.
-Responses also obey the engine's 15 MiB payload allowance. If unusually large imported identifiers exceed it, REST returns HTTP 413 with a small error. Lower `--limit` or select one session. Already completed retries are not repeated when you inspect again.
+Responses also obey the engine's 60 MiB payload allowance. If unusually large imported identifiers exceed it, REST returns HTTP 413 with a small error. Lower `--limit` or select one session. Already completed retries are not repeated when you inspect again.
diff --git a/docs/upgrades/iii-0.25.md b/docs/upgrades/iii-0.25.md
index c91039f2ca..5ef252863a 100644
--- a/docs/upgrades/iii-0.25.md
+++ b/docs/upgrades/iii-0.25.md
@@ -1,6 +1,6 @@
# Upgrading the AgentMemory runtime to iii 0.25
-This release pins the engine, `iii-sdk` and `@iii-dev/helpers` to 0.25.0. Worker Compose starts the existing `state@0.22.20` and `http@0.22.7` registry workers with AgentMemory. Their versions are independent of the engine version.
+This release pins the engine, `iii-sdk` and `@iii-dev/helpers` to 0.25.0. Worker Compose starts the existing `state@0.22.22` and `http@0.22.8` registry workers with AgentMemory. Their versions are independent of the engine version.
## Before upgrading
@@ -24,6 +24,7 @@ Existing file state remains at `state_store.db`; this upgrade does not convert o
- `/agentmemory/status` reports the configured engine pin as `service.enginePinnedVersion`, replacing the old `engineVersion` field. This is the supported version, not a probe of an arbitrary remote engine.
- `registerTrigger` and `registerTriggerType` remain supported by iii 0.25, with deprecation warnings. HTTP and state providers still use these APIs; their warnings do not mean route registration failed.
- iii 0.25 can dispatch calls to a worker's own functions locally. Engine-side spans differ for those calls; SDK tracing and state-worker persistence still apply.
+- Local dispatch is on by default, so AgentMemory's internal calls to its own functions run in-process and produce only the SDK's execute span, not an engine call span. Set `AGENTMEMORY_LOCAL_DISPATCH=false` for full engine traces at the cost of a round trip per call.
## Retired engine console
diff --git a/package.json b/package.json
index 7e20ad1402..e901e20e20 100644
--- a/package.json
+++ b/package.json
@@ -31,6 +31,7 @@
"test:summary-recovery:packaged": "node scripts/release-gate/summary-recovery.mjs",
"test:cli-diagnostics:packaged": "node scripts/release-gate/cli-diagnostics.mjs",
"test:graph-index:packaged": "node scripts/release-gate/graph-index.mjs",
+ "gate:large-store": "node scripts/release-gate/large-store.mjs",
"test:skills:packaged": "node scripts/release-gate/skills.mjs",
"test:openclaw:packaged": "node scripts/release-gate/openclaw.mjs",
"release:gate": "node scripts/release-gate/run.mjs",
diff --git a/plugin/skills/agentmemory-config/REFERENCE.md b/plugin/skills/agentmemory-config/REFERENCE.md
index 7d58384e26..01e1546bbe 100644
--- a/plugin/skills/agentmemory-config/REFERENCE.md
+++ b/plugin/skills/agentmemory-config/REFERENCE.md
@@ -3,7 +3,7 @@
Generated by scanning `src/` for `AGENTMEMORY_*` usage. Do not edit the block below by hand; run `npm run skills:gen` after adding or removing a variable. Internal markers ending in two underscores are excluded.
-Configuration is read from the environment and from `~/.agentmemory/.env` (no `export` prefix). 75 recognized variables:
+Configuration is read from the environment and from `~/.agentmemory/.env` (no `export` prefix). 76 recognized variables:
- `AGENTMEMORY_AGENT_SCOPE`
- `AGENTMEMORY_ALLOW_AGENT_SDK`
@@ -51,6 +51,7 @@ Configuration is read from the environment and from `~/.agentmemory/.env` (no `e
- `AGENTMEMORY_INJECT_CONTEXT`
- `AGENTMEMORY_LLM_NOTHINK`
- `AGENTMEMORY_LLM_TIMEOUT_MS`
+- `AGENTMEMORY_LOCAL_DISPATCH`
- `AGENTMEMORY_MCP_BLOCK`
- `AGENTMEMORY_METRICS_PORT`
- `AGENTMEMORY_PRE_COMPACT_BUDGET`
diff --git a/scripts/docs-sync.state.json b/scripts/docs-sync.state.json
index 0538665c6a..377ea77be8 100644
--- a/scripts/docs-sync.state.json
+++ b/scripts/docs-sync.state.json
@@ -26,7 +26,7 @@
"322"
],
"sourceFiles": [
- "254"
+ "255"
],
"loc": [
"58000"
diff --git a/scripts/release-gate/graph-index.mjs b/scripts/release-gate/graph-index.mjs
index 33b579f43a..4387c41d6b 100644
--- a/scripts/release-gate/graph-index.mjs
+++ b/scripts/release-gate/graph-index.mjs
@@ -124,7 +124,7 @@ async function profile(name, instance = 0, sharedHome) {
"containers:",
" state:",
" worker: 'package://api.workers.iii.dev/state'",
- " version: '0.22.20'",
+ " version: '0.22.22'",
" config_name: state",
" config_override:",
" adapter:",
@@ -135,7 +135,7 @@ async function profile(name, instance = 0, sharedHome) {
" save_interval_ms: 2000",
" http:",
" worker: 'package://api.workers.iii.dev/http'",
- " version: '0.22.7'",
+ " version: '0.22.8'",
" config_name: http",
" config_override:",
" host: 127.0.0.1",
diff --git a/scripts/release-gate/large-store.mjs b/scripts/release-gate/large-store.mjs
new file mode 100644
index 0000000000..bd07990f5f
--- /dev/null
+++ b/scripts/release-gate/large-store.mjs
@@ -0,0 +1,463 @@
+#!/usr/bin/env node
+import assert from "node:assert/strict";
+import { spawn, execFileSync } from "node:child_process";
+import { createHash } from "node:crypto";
+import { appendFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, symlinkSync, writeFileSync } from "node:fs";
+import net from "node:net";
+import { arch, platform, tmpdir } from "node:os";
+import { delimiter, dirname, join, resolve } from "node:path";
+import { fileURLToPath } from "node:url";
+import { registerWorker } from "iii-sdk";
+import { assertSupportedPlatform } from "./command.mjs";
+
+assertSupportedPlatform();
+const repo = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
+const options = {};
+const booleanFlags = new Set(["--small", "--assert", "--help"]);
+const valueFlags = new Set(["--tarball", "--engine", "--out", "--dependencies", "--sizes", "--sessions", "--state-version", "--http-version", "--migrate-timeout-ms", "--probe-timeout-ms"]);
+for (let i = 2; i < process.argv.length; i++) {
+ const key = process.argv[i];
+ if (booleanFlags.has(key)) { options[key.slice(2)] = true; continue; }
+ assert(valueFlags.has(key), `Unknown argument ${key}`);
+ const value = process.argv[++i];
+ assert(value && !value.startsWith("--"), `Missing value for ${key}`);
+ options[key.slice(2).replaceAll("-", "_")] = value;
+}
+if (options.help) {
+ console.log("Usage: node scripts/release-gate/large-store.mjs --tarball file.tgz [--engine bin] [--out dir] [--dependencies dir] [--small] [--sizes semantic=30,nodes=70,edges=140,insights=500] [--sessions N] [--state-version v] [--http-version v] [--migrate-timeout-ms N] [--probe-timeout-ms N] [--assert]");
+ process.exit(0);
+}
+assert(options.tarball, "Pass --tarball with the built npm package to measure");
+options.tarball = resolve(options.tarball);
+if (options.out) options.out = resolve(options.out);
+if (options.dependencies) options.dependencies = resolve(options.dependencies);
+if (options.engine) options.engine = resolve(options.engine);
+
+const scopeOrder = ["semantic", "nodes", "edges", "insights"];
+const scopeNames = {
+ semantic: "mem:semantic",
+ nodes: "mem:graph:nodes",
+ edges: "mem:graph:edges",
+ insights: "mem:insights",
+ sessions: "mem:sessions",
+};
+const defaults = options.small
+ ? { semantic: 18, nodes: 18, edges: 20, insights: 20, sessions: 300 }
+ : { semantic: 30, nodes: 70, edges: 140, insights: 500, sessions: 3000 };
+const sizesMb = { semantic: defaults.semantic, nodes: defaults.nodes, edges: defaults.edges, insights: defaults.insights };
+if (options.sizes) {
+ for (const pair of options.sizes.split(",")) {
+ const [name, raw] = pair.split("=").map((part) => part.trim());
+ assert(scopeOrder.includes(name), `--sizes key must be one of ${scopeOrder.join(",")}: ${name}`);
+ const mb = Number(raw);
+ assert(Number.isFinite(mb) && mb >= 0, `--sizes ${name} must be a non-negative number of MiB`);
+ sizesMb[name] = mb;
+ }
+}
+const sessionCount = options.sessions !== undefined ? Number(options.sessions) : defaults.sessions;
+assert(Number.isSafeInteger(sessionCount) && sessionCount >= 0, "--sessions must be a non-negative integer");
+const migrateTimeoutMs = options.migrate_timeout_ms !== undefined ? Number(options.migrate_timeout_ms) : 300_000;
+const probeTimeoutMs = options.probe_timeout_ms !== undefined ? Number(options.probe_timeout_ms) : 300_000;
+assert(Number.isFinite(migrateTimeoutMs) && migrateTimeoutMs > 0, "--migrate-timeout-ms must be positive");
+assert(Number.isFinite(probeTimeoutMs) && probeTimeoutMs > 0, "--probe-timeout-ms must be positive");
+
+const composeSource = readFileSync(join(repo, "src/cli/compose-project.ts"), "utf8");
+const workerVersions = {
+ state: options.state_version ?? composeSource.match(/state:\s*"([^"]+)"/)?.[1],
+ http: options.http_version ?? composeSource.match(/http:\s*"([^"]+)"/)?.[1],
+};
+assert(workerVersions.state && workerVersions.http, "Could not resolve worker versions; pass --state-version and --http-version");
+
+const out = options.out ?? mkdtempSync(join(tmpdir(), "agentmemory-scale-"));
+mkdirSync(out, { recursive: true });
+const root = mkdtempSync(join(out, "run-"));
+console.log(`Artifacts: ${root}`);
+const prefix = join(root, "prefix"), modules = join(prefix, "node_modules"), pkg = join(modules, "@agentmemory/agentmemory");
+mkdirSync(pkg, { recursive: true });
+const children = new Set();
+const probes = [];
+const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
+const free = (port) => new Promise((resolve) => {
+ const server = net.createServer(); server.once("error", () => resolve(false));
+ server.listen(port, "127.0.0.1", () => server.close(() => resolve(true)));
+});
+async function poll(label, check, timeout = 30_000) {
+ const end = Date.now() + timeout;
+ let error;
+ do {
+ try { const value = await check(); if (value) return value; } catch (cause) { error = cause; }
+ await sleep(250);
+ } while (Date.now() < end);
+ throw new Error(`${label} timed out: ${error?.message ?? "not ready"}`);
+}
+function kill(child, signal = "SIGKILL") {
+ if (!child || child.exitCode !== null || child.signalCode !== null) return;
+ try { process.kill(-child.pid, signal); } catch { try { child.kill(signal); } catch {} }
+}
+process.on("exit", () => { for (const child of children) kill(child); });
+for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
+ process.on(signal, () => { for (const child of children) kill(child); process.exit(130); });
+}
+
+let manifest, engine, cli, fatal;
+const p = { name: "large-store", sockets: new Set() };
+function environment() {
+ return {
+ HOME: p.home, USERPROFILE: p.home, PATH: [dirname(process.execPath), "/usr/bin", "/bin", "/usr/sbin", "/sbin"].join(delimiter), TMPDIR: root,
+ CI: "1", NO_COLOR: "1", LANG: "C.UTF-8", OTEL_ENABLED: "false", III_TELEMETRY_ENABLED: "false",
+ AGENTMEMORY_DATA_DIR: p.data, AGENTMEMORY_RUNTIME_DIR: p.runtime,
+ III_REST_PORT: String(p.port), III_VIEWER_PORT: String(p.port + 2),
+ III_ENGINE_PORT: String(p.enginePort), III_ENGINE_URL: `ws://127.0.0.1:${p.enginePort}`, III_NAMESPACE: `agentmemory-${p.port}`, AGENTMEMORY_METRICS_PORT: String(p.port + 6353),
+ LLM_PROVIDER: "none", EMBEDDING_PROVIDER: "none", AGENTMEMORY_GRAPH_WEIGHT: "0.3",
+ AGENTMEMORY_GRAPH_COMPACT_ON_BOOT: "false", AGENTMEMORY_AUTO_COMPRESS: "false", AGENTMEMORY_SESSION_SWEEP_ENABLED: "false", AGENTMEMORY_FINALIZE_IDLE_MS: "0",
+ GRAPH_EXTRACTION_ENABLED: "false", CONSOLIDATION_ENABLED: "false", AGENTMEMORY_REFLECT: "false",
+ };
+}
+function launch(executable, args, name) {
+ const child = spawn(executable, args, { env: environment(), cwd: p.dir, detached: true, stdio: ["ignore", "pipe", "pipe"] });
+ children.add(child); child.text = "";
+ const log = (chunk) => { child.text = (child.text + chunk).slice(-1_048_576); appendFileSync(join(p.dir, `${name}.log`), chunk); };
+ child.stdout.on("data", log); child.stderr.on("data", log); child.on("error", (error) => log(String(error)));
+ child.done = new Promise((resolve) => child.on("close", (code, signal) => { children.delete(child); resolve({ code, signal }); }));
+ return child;
+}
+async function install() {
+ if (options.dependencies) {
+ execFileSync("tar", ["-xzf", options.tarball, "--strip-components=1", "-C", pkg]);
+ for (const entry of readdirSync(options.dependencies, { withFileTypes: true })) {
+ if (entry.name.startsWith(".")) continue;
+ if (entry.name.startsWith("@")) {
+ mkdirSync(join(modules, entry.name), { recursive: true });
+ for (const name of readdirSync(join(options.dependencies, entry.name))) {
+ const target = join(modules, entry.name, name);
+ if (!existsSync(target)) symlinkSync(join(options.dependencies, entry.name, name), target);
+ }
+ } else symlinkSync(join(options.dependencies, entry.name), join(modules, entry.name));
+ }
+ } else {
+ writeFileSync(join(prefix, "package.json"), '{"name":"large-store-gate","private":true}\n');
+ const installHome = join(root, "install-home"); mkdirSync(installHome);
+ execFileSync("npm", ["install", "--ignore-scripts", "--omit=optional", "--no-audit", "--no-fund", options.tarball], {
+ cwd: prefix, stdio: "inherit", timeout: 300_000,
+ env: { HOME: installHome, USERPROFILE: installHome, PATH: [dirname(process.execPath), "/usr/bin", "/bin"].join(delimiter), npm_config_cache: join(root, "npm-cache") },
+ });
+ }
+ manifest = JSON.parse(readFileSync(join(pkg, "package.json"), "utf8"));
+ cli = join(pkg, "dist/cli.mjs");
+}
+async function ensureEngine() {
+ const pinned = manifest.dependencies["iii-sdk"];
+ const candidate = options.engine ?? process.env.AGENTMEMORY_GATE_ENGINE;
+ if (candidate) {
+ const version = execFileSync(candidate, ["--version"], { encoding: "utf8" });
+ assert(version.includes(pinned), `Engine version mismatch: ${version} (expected ${pinned})`);
+ return candidate;
+ }
+ const targets = {
+ darwin: { arm64: "aarch64-apple-darwin", x64: "x86_64-apple-darwin" },
+ linux: { x64: "x86_64-unknown-linux-gnu", arm64: "aarch64-unknown-linux-gnu", arm: "armv7-unknown-linux-gnueabihf" },
+ };
+ const target = targets[platform()]?.[arch()];
+ assert(target, `No iii engine asset mapping for ${platform()}-${arch()}`);
+ const asset = `iii-${target}.tar.gz`;
+ const base = `https://github.com/iii-hq/iii/releases/download/iii/v${pinned}`;
+ const dir = join(root, "engine"); mkdirSync(dir, { recursive: true });
+ const archive = join(dir, asset);
+ const checksumResponse = await fetch(`${base}/${asset.replace(/\.tar\.gz$/, "")}.sha256`);
+ assert(checksumResponse.ok, `Engine checksum download: HTTP ${checksumResponse.status}`);
+ const expected = (await checksumResponse.text()).trim().split(/\s+/)[0];
+ const response = await fetch(`${base}/${asset}`);
+ assert(response.ok, `Engine download: HTTP ${response.status}`);
+ writeFileSync(archive, Buffer.from(await response.arrayBuffer()));
+ const actual = createHash("sha256").update(readFileSync(archive)).digest("hex");
+ assert.equal(actual, expected, `Engine archive checksum mismatch for ${asset}`);
+ execFileSync("tar", ["-xzf", archive, "-C", dir]);
+ const bin = join(dir, "iii");
+ assert(existsSync(bin), `Expected engine binary at ${bin}`);
+ const version = execFileSync(bin, ["--version"], { encoding: "utf8" });
+ assert(version.includes(pinned), `Engine version mismatch: ${version} (expected ${pinned})`);
+ return bin;
+}
+function writeWorkerCompose() {
+ const quote = (value) => `'${String(value).replaceAll("'", "''")}'`;
+ const composeText = [
+ `namespace: agentmemory-${p.port}`,
+ "engine:",
+ ` url: ws://127.0.0.1:${p.enginePort}`,
+ " workers:",
+ " configuration:",
+ " adapter:",
+ " name: fs",
+ " config:",
+ ` directory: ${quote(join(p.data, "compose-config"))}`,
+ " iii-worker-manager:",
+ " host: 127.0.0.1",
+ ` port: ${p.enginePort}`,
+ "containers:",
+ " state:",
+ " worker: 'package://api.workers.iii.dev/state'",
+ ` version: '${workerVersions.state}'`,
+ " config_name: state",
+ " config_override:",
+ " adapter:",
+ " name: kv",
+ " config:",
+ ` file_path: ${quote(join(p.data, "state_store.db"))}`,
+ " store_method: file_based",
+ " save_interval_ms: 2000",
+ " http:",
+ " worker: 'package://api.workers.iii.dev/http'",
+ ` version: '${workerVersions.http}'`,
+ " config_name: http",
+ " config_override:",
+ " host: 127.0.0.1",
+ ` port: ${p.port}`,
+ " default_timeout: 180000",
+ "",
+ ].join("\n");
+ writeFileSync(join(p.dir, "worker-compose.yaml"), composeText);
+}
+async function startEngine() {
+ p.engine = launch(engine, ["compose", "--namespace", `agentmemory-${p.port}`, "--up", "--file", join(p.dir, "worker-compose.yaml")], "compose");
+ await poll("Compose engine", async () => (await fetch(`http://127.0.0.1:${p.port}/`, { signal: AbortSignal.timeout(500) })).status > 0, 120_000);
+ p.client = registerWorker(`ws://127.0.0.1:${p.enginePort}`, { workerName: "large-store-fixture", namespace: `agentmemory-${p.port}`, invocationTimeoutMs: 60_000, enableMetricsReporting: false, otel: { enabled: false } });
+ await poll("Compose state worker", async () => {
+ await p.client.trigger({ function_id: "state::get", payload: { scope: scopeNames.sessions, key: "_probe" } });
+ return true;
+ }, 120_000);
+}
+async function startWorker() {
+ p.worker = launch(process.execPath, [cli, "--no-engine", "--port", String(p.port), "--data-dir", p.data], "worker");
+ await poll("packaged CLI", async () => {
+ if (p.worker.exitCode !== null) throw new Error(`CLI exited: ${p.worker.text}`);
+ if (!p.worker.text.includes("REST API")) return false;
+ const res = await fetch(`http://127.0.0.1:${p.port}/agentmemory/livez`, { signal: AbortSignal.timeout(2000) });
+ if (!res.ok) return false;
+ const value = await res.json();
+ return value.viewerPort || value.viewerSkipped;
+ }, 300_000);
+ p.secret = readFileSync(join(p.runtime, "secret"), "utf8").trim();
+}
+const state = (id, payload) => p.client.trigger({ function_id: id, payload });
+
+const timestamp = "2026-10-14T00:00:00.000Z";
+const RECORD_TARGET_BYTES = 1024 * 1024;
+const pad = (record, size, assign) => {
+ const skeleton = JSON.stringify(assign(record, "")).length;
+ return assign(record, "x".repeat(Math.max(1, RECORD_TARGET_BYTES - skeleton)));
+};
+const semanticRecord = (i) => pad({ id: `sem-${i}`, fact: "", confidence: 0.9, sourceSessionIds: ["sess-seed"], sourceMemoryIds: [], accessCount: 0, lastAccessedAt: timestamp, strength: 5, createdAt: timestamp, updatedAt: timestamp }, RECORD_TARGET_BYTES, (r, fill) => (r.fact = `Seeded semantic fact ${i}. ${fill}`, r));
+const nodeRecord = (i) => pad({ id: `node-${i}`, name: `SeedNode${i}`, type: "concept", properties: {}, sourceObservationIds: ["mem_seed_source"], createdAt: timestamp }, RECORD_TARGET_BYTES, (r, fill) => (r.properties = { payload: fill }, r));
+const edgeRecord = (i, nodeTotal) => pad({ id: `edge-${i}`, type: "related_to", sourceNodeId: `node-${i % Math.max(1, nodeTotal)}`, targetNodeId: `node-${(i + 1) % Math.max(1, nodeTotal)}`, weight: 0.8, sourceObservationIds: ["mem_seed_source"], createdAt: timestamp, isLatest: true }, RECORD_TARGET_BYTES, (r, fill) => (r.context = { reasoning: fill }, r));
+const insightRecord = (i) => pad({ id: `insight-${i}`, title: `Seeded insight ${i}`, content: "", confidence: 0.85, reinforcements: 1, sourceConceptCluster: ["seed"], sourceMemoryIds: [], sourceLessonIds: [], sourceCrystalIds: [], evidenceVersion: 1, project: "fixture-large", tags: ["seed"], createdAt: timestamp, updatedAt: timestamp, decayRate: 0 }, RECORD_TARGET_BYTES, (r, fill) => (r.content = `Seeded insight content ${i}. ${fill}`, r));
+const sessionRecord = (i) => ({ id: `sess-${i}`, project: "fixture-large", cwd: "/fixture/large", startedAt: timestamp, updatedAt: timestamp, endedAt: timestamp, status: "completed", observationCount: 0, agentId: "fixture-agent", firstPrompt: `Seeded session ${i}` });
+
+async function seedScope(scope, recordCount, make) {
+ let seeded = 0;
+ const concurrency = 8;
+ while (seeded < recordCount) {
+ const batch = Math.min(concurrency, recordCount - seeded);
+ await Promise.all(Array.from({ length: batch }, (_, offset) => {
+ const record = make(seeded + offset);
+ return state("state::set", { scope, key: record.id, value: record });
+ }));
+ seeded += batch;
+ if (seeded % 64 < concurrency) console.log(`seeded ${scope}: ${seeded}/${recordCount}`);
+ }
+ return seeded;
+}
+async function seed() {
+ const seeded = {};
+ const perScope = {
+ semantic: { count: Math.round(sizesMb.semantic), make: semanticRecord },
+ nodes: { count: Math.round(sizesMb.nodes), make: nodeRecord },
+ edges: { count: Math.round(sizesMb.edges), make: (i) => edgeRecord(i, Math.max(1, Math.round(sizesMb.nodes))) },
+ insights: { count: Math.round(sizesMb.insights), make: insightRecord },
+ };
+ for (const name of scopeOrder) {
+ const { count, make } = perScope[name];
+ const start = performance.now();
+ seeded[name] = { records: await seedScope(scopeNames[name], count, make), targetMiB: sizesMb[name], seedMs: Math.round(performance.now() - start) };
+ }
+ const start = performance.now();
+ seeded.sessions = { records: await seedScope(scopeNames.sessions, sessionCount, sessionRecord), seedMs: Math.round(performance.now() - start) };
+ return seeded;
+}
+async function response(path, body) {
+ return fetch(`http://127.0.0.1:${p.port}/agentmemory${path}`, {
+ method: body === undefined ? "GET" : "POST",
+ headers: { "content-type": "application/json", authorization: `Bearer ${p.secret}` },
+ ...(body === undefined ? {} : { body: JSON.stringify(body) }),
+ signal: AbortSignal.timeout(probeTimeoutMs),
+ });
+}
+async function probe(name, path, body) {
+ const started = performance.now();
+ const result = { name, method: body === undefined ? "GET" : "POST", path };
+ try {
+ const res = await response(path, body);
+ result.status = res.status;
+ let bytes = 0;
+ const captured = [];
+ const reader = res.body?.getReader();
+ if (reader) {
+ for (;;) {
+ const { done, value } = await reader.read();
+ if (done) break;
+ bytes += value.byteLength;
+ if (captured.reduce((sum, chunk) => sum + chunk.byteLength, 0) < 4096) captured.push(value);
+ }
+ }
+ result.bytes = bytes;
+ const text = Buffer.concat(captured.map((chunk) => Buffer.from(chunk))).toString("utf8").slice(0, 4096);
+ try {
+ const json = JSON.parse(text);
+ result.json = json;
+ if (json && typeof json === "object" && json.oversized === true) result.refused = true;
+ const detail = json && typeof json === "object" ? json.error ?? json.message : undefined;
+ if (detail) result.error = String(typeof detail === "string" ? detail : JSON.stringify(detail)).slice(0, 500);
+ else if (json && typeof json === "object" && json.success === false) result.error = "success:false";
+ } catch {}
+ if (!result.error && res.status >= 400) result.error = `HTTP ${res.status}`;
+ } catch (cause) {
+ result.error = String(cause?.message ?? cause).slice(0, 500);
+ }
+ result.latencyMs = Math.round(performance.now() - started);
+ result.ok = (result.status >= 200 && result.status < 300 && !result.error) || result.refused === true;
+ delete result.json;
+ probes.push(result);
+ console.log(JSON.stringify(result));
+ return result;
+}
+async function agentmemoryWorkers() {
+ try {
+ const listed = await state("engine::workers::list", {});
+ return (listed?.workers ?? []).filter((worker) => (worker.name ?? "").includes("agentmemory")).map((worker) => ({ id: worker.id, name: worker.name, status: worker.status }));
+ } catch (cause) {
+ return [{ error: String(cause?.message ?? cause) }];
+ }
+}
+function scanLogs() {
+ const findings = { payload_too_large: 0, WS_ERR_UNSUPPORTED_MESSAGE_LENGTH: 0, files: [] };
+ const candidates = [join(p.dir, "compose.log"), join(p.dir, "worker.log")];
+ const walk = (dir) => {
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
+ const full = join(dir, entry.name);
+ if (entry.isDirectory()) walk(full);
+ else if (entry.isFile() && entry.name.endsWith(".log")) candidates.push(full);
+ }
+ };
+ try { walk(join(p.dir, ".iii")); } catch {}
+ try { walk(join(p.data, "compose-state")); } catch {}
+ try { walk(join(p.data, "compose", "logs")); } catch {}
+ for (const file of new Set(candidates)) {
+ let text;
+ try { text = readFileSync(file, "utf8"); } catch { continue; }
+ const hits = {
+ payload_too_large: (text.match(/payload_too_large/g) ?? []).length,
+ WS_ERR_UNSUPPORTED_MESSAGE_LENGTH: (text.match(/WS_ERR_UNSUPPORTED_MESSAGE_LENGTH/g) ?? []).length,
+ };
+ if (hits.payload_too_large || hits.WS_ERR_UNSUPPORTED_MESSAGE_LENGTH) findings.files.push({ file, ...hits });
+ findings.payload_too_large += hits.payload_too_large;
+ findings.WS_ERR_UNSUPPORTED_MESSAGE_LENGTH += hits.WS_ERR_UNSUPPORTED_MESSAGE_LENGTH;
+ }
+ return findings;
+}
+
+let seeded = {}, workersBefore = [], workersAfter = [], workerReregistered = false, logFindings = {}, migrateFinal;
+try {
+ await install();
+ engine = await ensureEngine();
+ const dir = join(root, "instance"), home = join(dir, "home"), data = join(dir, "data"), runtime = join(home, ".agentmemory");
+ Object.assign(p, { dir, home, data, runtime });
+ for (const path of [runtime, data]) mkdirSync(path, { recursive: true });
+ for (let i = 0; i < 100 && p.port === undefined; i++) {
+ const candidate = 12_000 + Math.floor(Math.random() * 7_000);
+ const block = [0, 1, 2, 3, 6353, 46023].map((n) => candidate + n);
+ if ((await Promise.all(block.map(free))).every(Boolean)) p.port = candidate;
+ }
+ assert(p.port, "No free port block");
+ p.enginePort = p.port + 46023;
+ writeWorkerCompose();
+ await startEngine();
+ const seedStart = performance.now();
+ seeded = await seed();
+ console.log(JSON.stringify({ name: "seeded", scopes: seeded, totalMs: Math.round(performance.now() - seedStart) }));
+ await startWorker();
+ workersBefore = await agentmemoryWorkers();
+
+ await probe("semantic", "/semantic?limit=50");
+ await probe("insights", "/insights?limit=50");
+ await probe("sessions", "/sessions");
+ await probe("counts", "/counts");
+
+ const migrate = await probe("graph-index-migrate", "/graph/index/migrate", { allowLegacyScan: true });
+ const migrateDeadline = Date.now() + migrateTimeoutMs;
+ let terminal;
+ if (migrate.ok) {
+ do {
+ await sleep(3000);
+ const res = await response("/graph/index");
+ terminal = res.ok ? await res.json() : { state: `http-${res.status}` };
+ } while (!terminal.ready && !terminal.error && !["paused", "unavailable"].includes(terminal.state) && Date.now() < migrateDeadline);
+ }
+ migrateFinal = {
+ name: "graph-index-final",
+ accepted: migrate.ok,
+ state: terminal?.state ?? "not-started",
+ ready: Boolean(terminal?.ready),
+ processed: terminal?.processed,
+ total: terminal?.total,
+ error: terminal?.error ? String(terminal.error).slice(0, 500) : terminal === undefined ? migrate.error : undefined,
+ elapsedMs: migrate.latencyMs,
+ };
+ probes.push(migrateFinal);
+ console.log(JSON.stringify(migrateFinal));
+
+ await probe("export", "/export");
+ await probe("mesh-export", "/mesh/export");
+
+ workersAfter = await agentmemoryWorkers();
+ const ids = (list) => list.filter((worker) => worker.id).map((worker) => worker.id);
+ const before = ids(workersBefore), after = ids(workersAfter);
+ workerReregistered = before.length !== after.length || before.some((id) => !after.includes(id)) || after.some((id) => !before.includes(id));
+ logFindings = scanLogs();
+} catch (error) {
+ fatal = error.stack ?? String(error);
+ console.error(fatal);
+} finally {
+ if (p.worker) { kill(p.worker); await Promise.race([p.worker.done, sleep(3000)]); }
+ if (p.client) { try { await p.client.shutdown(); } catch {} }
+ for (const socket of p.sockets) socket.terminate();
+ if (p.engine) { kill(p.engine); await Promise.race([p.engine.done, sleep(3000)]); }
+ for (const child of [...children]) kill(child);
+}
+
+const probeFailed = probes.filter((entry) => !entry.ok && entry.name !== "graph-index-final");
+const migrateOk = migrateFinal ? migrateFinal.accepted === true && migrateFinal.ready === true : false;
+const summary = {
+ ok: !fatal,
+ root,
+ tarball: options.tarball,
+ engine,
+ engineVersion: manifest?.dependencies?.["iii-sdk"],
+ workerVersions,
+ sizes: seeded,
+ sessions: sessionCount,
+ probes,
+ failedProbes: probeFailed.map((entry) => entry.name),
+ migrate: migrateFinal,
+ stability: { workersBefore, workersAfter, workerReregistered },
+ logFindings,
+ fatal,
+};
+writeFileSync(join(root, "results.json"), JSON.stringify(summary, null, 2) + "\n");
+console.log("\nprobe status ms MiB error");
+for (const entry of probes) {
+ const mib = entry.bytes !== undefined ? (entry.bytes / (1024 * 1024)).toFixed(1) : "-";
+ console.log(`${entry.name.padEnd(24)} ${String(entry.status ?? entry.state ?? "-").padEnd(8)} ${String(entry.latencyMs ?? entry.elapsedMs ?? "-").padEnd(9)} ${mib.padEnd(8)} ${entry.error ?? ""}`);
+}
+console.log(`workerReregistered: ${workerReregistered} payload_too_large hits: ${logFindings.payload_too_large ?? 0} WS_ERR hits: ${logFindings.WS_ERR_UNSUPPORTED_MESSAGE_LENGTH ?? 0}`);
+console.log(`Results: ${join(root, "results.json")}`);
+const assertFailed = options.assert && (fatal || probeFailed.length > 0 || (migrateFinal && !migrateOk) || workerReregistered);
+process.exit(fatal ? 1 : assertFailed ? 1 : 0);
diff --git a/scripts/release-gate/startup.mjs b/scripts/release-gate/startup.mjs
index 317b10119d..ed0e9e3a62 100644
--- a/scripts/release-gate/startup.mjs
+++ b/scripts/release-gate/startup.mjs
@@ -9,25 +9,53 @@ import net from "node:net";
import { arch, homedir, platform, tmpdir } from "node:os";
import { dirname, join, resolve, delimiter } from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
+import { runCommand } from "./command.mjs";
const repo = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
-const options = { tarball: null, out: null, only: null, keep: false, delayMs: 48_000, skipBuild: false, workerBinDir: process.env.AGENTMEMORY_WORKER_BIN_DIR ?? null };
+const options = { tarball: null, out: null, only: null, keep: false, delayMs: 48_000, skipBuild: false, workerBinDir: process.env.AGENTMEMORY_WORKER_BIN_DIR ?? null, repeat: null };
for (let i = 2; i < process.argv.length; i++) {
const arg = process.argv[i];
if (arg === "--tarball") options.tarball = resolve(process.argv[++i]);
else if (arg === "--out") options.out = resolve(process.argv[++i]);
else if (arg === "--only") options.only = new Set(process.argv[++i].split(","));
else if (arg === "--delay-ms") options.delayMs = Number(process.argv[++i]);
+ else if (arg === "--repeat") options.repeat = Number(process.argv[++i]);
else if (arg === "--keep") options.keep = true;
else if (arg === "--skip-build") options.skipBuild = true;
else if (arg === "--worker-bin-dir") options.workerBinDir = resolve(process.argv[++i]);
else if (arg === "--worker-bin-dir") options.workerBinDir = resolve(process.argv[++i]);
else if (arg === "--help") {
- console.log("Usage: node scripts/release-gate/startup.mjs [--tarball file.tgz] [--out dir] [--only names] [--delay-ms 48000] [--skip-build] [--worker-bin-dir directory] [--keep]");
+ console.log("Usage: node scripts/release-gate/startup.mjs [--tarball file.tgz] [--out dir] [--only names] [--delay-ms 48000] [--skip-build] [--worker-bin-dir directory] [--keep] [--repeat N]");
process.exit(0);
} else throw new Error(`Unknown argument ${arg}`);
}
assert(Number.isSafeInteger(options.delayMs) && options.delayMs > 0 && options.delayMs <= 300_000, "--delay-ms must be 1..300000");
+assert(options.repeat === null || (Number.isSafeInteger(options.repeat) && options.repeat > 0), "--repeat must be a positive integer");
+if (options.repeat) {
+ const self = fileURLToPath(import.meta.url);
+ const childArgs = process.argv.slice(2).flatMap((arg, index, argv) =>
+ arg === "--repeat" ? [] : argv[index - 1] === "--repeat" ? [] : arg === "--out" ? [] : argv[index - 1] === "--out" ? [] : [arg]);
+ const repeatOut = options.out ?? mkdtempSync(join(tmpdir(), "agentmemory-startup-repeat-"));
+ mkdirSync(repeatOut, { recursive: true });
+ console.log(`Repeat runs: ${repeatOut}`);
+ const runs = [];
+ for (let run = 1; run <= options.repeat; run++) {
+ const runOut = join(repeatOut, `run-${run}`);
+ console.log(`\n=== run ${run}/${options.repeat}: ${runOut} ===`);
+ const result = await runCommand(process.execPath, [self, ...childArgs, "--out", runOut], { env: process.env, cwd: repo, timeoutMs: 3_600_000 });
+ process.stdout.write(result.output);
+ let summary;
+ try { summary = JSON.parse(readFileSync(join(runOut, "summary.json"), "utf8")); } catch {}
+ const passed = summary?.scenarios?.filter((s) => s.status === "pass").length ?? 0;
+ const total = summary?.scenarios?.length ?? 0;
+ const ok = result.code === 0 && Boolean(summary?.ok);
+ runs.push({ run, ok, code: result.code, passed, total, out: runOut, timedOut: result.timedOut });
+ }
+ console.log("\nrun result passed out");
+ for (const r of runs) console.log(`${String(r.run).padEnd(5)} ${(r.ok ? "pass" : "fail").padEnd(7)} ${`${r.passed}/${r.total}`.padEnd(7)} ${r.out}`);
+ writeFileSync(join(repeatOut, "repeat-summary.json"), JSON.stringify({ repeat: options.repeat, runs }, null, 2) + "\n");
+ process.exit(runs.every((r) => r.ok) ? 0 : 1);
+}
const root = mkdtempSync(join(tmpdir(), "am-startup-"));
const out = options.out ?? mkdtempSync(join(tmpdir(), "agentmemory-startup-gate-"));
mkdirSync(out, { recursive: true });
@@ -189,7 +217,7 @@ class Instance {
"containers:",
" state:",
` worker: ${quote(localWorkers ? `path://${join(this.data, "local-workers/state")}` : "package://api.workers.iii.dev/state")}`,
- ...(!localWorkers ? [" version: '0.22.20'"] : []),
+ ...(!localWorkers ? [" version: '0.22.22'"] : []),
" config_name: state",
...(localWorkers ? [" scripts:", ` run: ${quote(join(localWorkers, "state"))}`] : []),
" config_override:",
@@ -201,7 +229,7 @@ class Instance {
` file_path: ${quote(join(this.data, "state_store.db"))}`,
" http:",
` worker: ${quote(localWorkers ? `path://${join(this.data, "local-workers/http")}` : "package://api.workers.iii.dev/http")}`,
- ...(!localWorkers ? [" version: '0.22.7'"] : []),
+ ...(!localWorkers ? [" version: '0.22.8'"] : []),
" config_name: http",
...(localWorkers ? [" scripts:", ` run: ${quote(join(localWorkers, "http"))}`] : []),
" config_override:",
diff --git a/scripts/release-gate/vector-recovery.mjs b/scripts/release-gate/vector-recovery.mjs
index 40691181ee..49dd5af199 100644
--- a/scripts/release-gate/vector-recovery.mjs
+++ b/scripts/release-gate/vector-recovery.mjs
@@ -103,7 +103,7 @@ const config = [
"containers:",
" state:",
" worker: 'package://api.workers.iii.dev/state'",
- " version: '0.22.20'",
+ " version: '0.22.22'",
" config_name: state",
" config_override:",
" adapter:",
@@ -114,7 +114,7 @@ const config = [
" save_interval_ms: 2000",
" http:",
" worker: 'package://api.workers.iii.dev/http'",
- " version: '0.22.7'",
+ " version: '0.22.8'",
" config_name: http",
" config_override:",
" host: 127.0.0.1",
diff --git a/src/cli/compose-project.ts b/src/cli/compose-project.ts
index b84896aa10..066c661d57 100644
--- a/src/cli/compose-project.ts
+++ b/src/cli/compose-project.ts
@@ -17,8 +17,8 @@ export interface StateBackendOptions {
/** Registry versions are pinned here so every generated project uses one reviewed set. */
export const COMPOSE_WORKER_VERSIONS = {
- state: "0.22.20",
- http: "0.22.7",
+ state: "0.22.22",
+ http: "0.22.8",
} as const;
export function composeNamespace(restPort: number): string {
@@ -80,6 +80,7 @@ const AGENTMEMORY_WORKER_ENV_ALLOWLIST = new Set([
"AGENTMEMORY_VECTOR_BACKFILL", "AGENTMEMORY_SLOTS", "AGENTMEMORY_PROVIDER", "AGENTMEMORY_VERBOSE",
"OBSIDIAN_AUTO_EXPORT", "AUTO_FORGET_ENABLED", "AUTO_FORGET_INTERVAL_MS", "LESSON_DECAY_ENABLED",
"INSIGHT_DECAY_ENABLED", "REBUILD_EMBED_BATCH_SIZE", "RERANK_ENABLED",
+ "AGENTMEMORY_LOCAL_DISPATCH",
]);
const COMPOSE_RESERVED_ENV = new Set([
diff --git a/src/functions/export-import.ts b/src/functions/export-import.ts
index 05d7ff78fa..a36e57c46d 100644
--- a/src/functions/export-import.ts
+++ b/src/functions/export-import.ts
@@ -163,7 +163,7 @@ export function registerExportImportFunction(sdk: IIIClient, state: StateKV): vo
const budget = new ExportBudget();
const refuse = (collection: string) => {
- logger.warn("Export exceeds transport frame limit", {
+ logger.warn("Export exceeds transport message limit", {
bytesSoFar: budget.bytes,
collection,
});
@@ -271,7 +271,7 @@ export function registerExportImportFunction(sdk: IIIClient, state: StateKV): vo
const oversized = checkPayloadFrameSize(exportData, EXPORT_OVERSIZE_HINT);
if (oversized) {
- logger.warn("Export exceeds transport frame limit", {
+ logger.warn("Export exceeds transport message limit", {
bytes: oversized.bytes,
});
return oversized;
diff --git a/src/index.ts b/src/index.ts
index 9727dcc911..fa28bcae44 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -36,6 +36,7 @@ import { HybridSearch } from "./state/hybrid-search.js";
import { IndexPersistence } from "./state/index-persistence.js";
import { SHUTDOWN_FLUSH_TIMEOUT_MS, SHUTDOWN_HARD_EXIT_MS, runStartupCleanup, settleWithin } from "./shutdown.js";
import { registerPrivacyFunction, withWriteScrubbing } from "./functions/privacy.js";
+import { withRegistrationDefaults } from "./runtime/registration.js";
import { registerObserveFunction } from "./functions/observe.js";
import { registerCaptureFunctions } from "./functions/capture.js";
import { registerImageQuotaCleanup } from "./functions/image-quota-cleanup.js";
@@ -230,7 +231,7 @@ async function main() {
`REST API: http://localhost:${config.restPort}/agentmemory/*`,
);
- const sdk = withWriteScrubbing(registerWorker(config.engineUrl, {
+ const sdk = withWriteScrubbing(withRegistrationDefaults(registerWorker(config.engineUrl, {
workerName: "agentmemory",
invocationTimeoutMs: 180000,
otel: {
@@ -250,7 +251,7 @@ async function main() {
language: "node",
framework: "iii-sdk",
},
- }));
+ })));
writeWorkerPidfile();
diff --git a/src/runtime/registration.ts b/src/runtime/registration.ts
new file mode 100644
index 0000000000..9b6cbbca1e
--- /dev/null
+++ b/src/runtime/registration.ts
@@ -0,0 +1,19 @@
+type RegisterFunction = (id: string, handler: unknown, ...rest: unknown[]) => unknown;
+
+export function withRegistrationDefaults(sdk: T): T {
+ return new Proxy(sdk, {
+ get(target, prop) {
+ const value = Reflect.get(target, prop, target);
+ if (typeof value !== "function") return value;
+ if (prop !== "registerFunction" || process.env.AGENTMEMORY_LOCAL_DISPATCH !== "false") {
+ return value.bind(target);
+ }
+ const register = value as RegisterFunction;
+ return (id: string, handler: unknown, ...rest: unknown[]) => {
+ const [options, ...extra] = rest;
+ const merged = { ...((options ?? {}) as object), localDispatch: false };
+ return register.call(target, id, handler, merged, ...extra);
+ };
+ },
+ });
+}
diff --git a/src/state/frame-guard.ts b/src/state/frame-guard.ts
index 8651b384d3..8836c107ef 100644
--- a/src/state/frame-guard.ts
+++ b/src/state/frame-guard.ts
@@ -1,9 +1,5 @@
-// The pinned engine rejects WebSocket frames over 16 MiB; an oversized
-// function result drops the worker and 404s every endpoint. Refuse the
-// payload as one clean error instead. The cap sits under the frame limit
-// to leave headroom for the SDK's framing overhead.
-const FRAME_LIMIT_BYTES = 16 * 1024 * 1024;
-export const SAFE_PAYLOAD_BYTES = 15 * 1024 * 1024;
+const FRAME_LIMIT_BYTES = 64 * 1024 * 1024;
+export const SAFE_PAYLOAD_BYTES = 60 * 1024 * 1024;
export type OversizedPayload = {
success: false;
@@ -24,7 +20,7 @@ export function oversizedPayloadError(
const mib = (bytes / (1024 * 1024)).toFixed(1);
return {
success: false,
- error: `Response is ${mib} MiB, over the ~${SAFE_PAYLOAD_BYTES / (1024 * 1024)} MiB engine transport frame limit; ${hint}`,
+ error: `Response is ${mib} MiB, over the ~${SAFE_PAYLOAD_BYTES / (1024 * 1024)} MiB engine transport message limit; ${hint}`,
oversized: true,
bytes,
limitBytes: SAFE_PAYLOAD_BYTES,
diff --git a/src/state/graph-index-migration.ts b/src/state/graph-index-migration.ts
index 51bed3eed2..ef47e74a63 100644
--- a/src/state/graph-index-migration.ts
+++ b/src/state/graph-index-migration.ts
@@ -129,9 +129,13 @@ function readPage(value: unknown, job: GraphIndexMigration): GraphIndexManifestP
}
function errorMessage(error: unknown): string {
- return error instanceof GraphIndexMigrationError || error instanceof GraphIndexError
- ? error.message
- : "Graph index migration stopped after a storage failure. Check the server and resume when storage is available.";
+ if (error instanceof GraphIndexMigrationError || error instanceof GraphIndexError) return error.message;
+ const base = "Graph index migration stopped after a storage failure. Check the server and resume when storage is available.";
+ const record = error as { code?: unknown; message?: unknown };
+ const detail = typeof record?.code === "string"
+ ? `${record.code}: ${typeof record.message === "string" ? record.message : String(error)}`
+ : typeof record?.message === "string" ? record.message : String(error);
+ return `${base} (${detail.slice(0, 300)})`;
}
export async function getGraphIndexMigrationStatus(kv: StateKV): Promise {
diff --git a/test/engine-config.test.ts b/test/engine-config.test.ts
index c1dd680ba5..f70aa418eb 100644
--- a/test/engine-config.test.ts
+++ b/test/engine-config.test.ts
@@ -3,7 +3,7 @@ import { COMPOSE_WORKER_VERSIONS, renderWorkerCompose } from "../src/cli/compose
describe("native Worker Compose runtime configuration", () => {
it("pins state/http workers at the reviewed registry versions", () => {
- expect(COMPOSE_WORKER_VERSIONS).toEqual({ state: "0.22.20", http: "0.22.7" });
+ expect(COMPOSE_WORKER_VERSIONS).toEqual({ state: "0.22.22", http: "0.22.8" });
});
it("renders instance-specific worker ports and persistent state storage", () => {
@@ -16,9 +16,9 @@ describe("native Worker Compose runtime configuration", () => {
linux: false,
});
expect(rendered).toContain("worker: 'package://api.workers.iii.dev/state'");
- expect(rendered).toContain("version: '0.22.20'");
+ expect(rendered).toContain("version: '0.22.22'");
expect(rendered).toContain("worker: 'package://api.workers.iii.dev/http'");
- expect(rendered).toContain("version: '0.22.7'");
+ expect(rendered).toContain("version: '0.22.8'");
expect(rendered).toContain("port: 3211");
expect(rendered).toContain("port: 49234");
expect(rendered).toContain("file_path: '/tmp/agentmemory/state_store.db'");
diff --git a/test/engine-launch-hardening.test.ts b/test/engine-launch-hardening.test.ts
index fd4e56e4ff..207ffa15be 100644
--- a/test/engine-launch-hardening.test.ts
+++ b/test/engine-launch-hardening.test.ts
@@ -30,8 +30,8 @@ describe("Worker Compose runtime configuration", () => {
homeDir: "/home/u",
linux: false,
});
- expect(rendered).toContain("version: '0.22.20'");
- expect(rendered).toContain("version: '0.22.7'");
+ expect(rendered).toContain("version: '0.22.22'");
+ expect(rendered).toContain("version: '0.22.8'");
expect(rendered).toContain("save_interval_ms: 2000");
expect(rendered).toContain("file_path: '/var/lib/agentmemory/state_store.db'");
expect(rendered).not.toContain("iii-config.yaml");
diff --git a/test/export-incremental-budget.test.ts b/test/export-incremental-budget.test.ts
index aeb71f19ad..2c8644b08e 100644
--- a/test/export-incremental-budget.test.ts
+++ b/test/export-incremental-budget.test.ts
@@ -87,7 +87,7 @@ describe("mem::export stops assembling once the frame budget is exceeded", () =>
const kv = countingKV();
const sdk = mockSdk();
registerExportImportFunction(sdk as never, kv as never);
- seedSessions(kv, 10, 6 * MIB);
+ seedSessions(kv, 10, 25 * MIB);
kv.seed(KV.graphNodes, "n_1", { id: "n_1" });
const result = (await sdk.trigger({ function_id: "mem::export", payload: {} })) as {
@@ -102,14 +102,14 @@ describe("mem::export stops assembling once the frame budget is exceeded", () =>
expect(obsLists).toHaveLength(3);
expect(kv.listCalls).not.toContain(KV.graphNodes);
expect(result.bytes).toBeGreaterThan(SAFE_PAYLOAD_BYTES);
- expect(result.bytes).toBeLessThan(19 * MIB);
+ expect(result.bytes).toBeLessThan(80 * MIB);
});
it("never lists later collections once the graph exceeds the limit", async () => {
const kv = countingKV();
const sdk = mockSdk();
registerExportImportFunction(sdk as never, kv as never);
- for (let i = 0; i < 20; i++) {
+ for (let i = 0; i < 70; i++) {
kv.seed(KV.graphNodes, `n_${i}`, { id: `n_${i}`, name: "g".repeat(MIB) });
}
@@ -147,7 +147,7 @@ describe("mem::export stops assembling once the frame budget is exceeded", () =>
const sdk = mockSdk();
registerExportImportFunction(sdk as never, kv as never);
registerApiTriggers(sdk as never, kv as never, BEARER);
- seedSessions(kv, 10, 6 * MIB);
+ seedSessions(kv, 10, 25 * MIB);
const resp = (await sdk.fns.get("api::export")!({
headers: { authorization: `Bearer ${BEARER}` },
@@ -168,7 +168,7 @@ describe("mem::export pages a collection that alone exceeds the frame limit", ()
registerApiTriggers(sdk as never, kv as never, BEARER);
seedSessions(kv, 3, 10);
const ids: string[] = [];
- for (let i = 0; i < 24; i++) {
+ for (let i = 0; i < 65; i++) {
ids.push(`ses_${i}`);
kv.seed(KV.summaries, `ses_${i}`, { sessionId: `ses_${i}`, narrative: "s".repeat(MIB) });
}
@@ -192,7 +192,7 @@ describe("mem::export pages a collection that alone exceeds the frame limit", ()
const exported: string[] = [];
let last: Page | undefined;
- for (const collectionOffset of ["0", "10", "20"]) {
+ for (const collectionOffset of ["0", "10", "20", "30", "40", "50", "60"]) {
last = await get({ collections: "summaries", collectionLimit: "10", collectionOffset });
expect(last.status_code).toBe(200);
expect(payloadByteLength(last.body)).toBeLessThanOrEqual(SAFE_PAYLOAD_BYTES);
diff --git a/test/frame-guard.test.ts b/test/frame-guard.test.ts
index fbb73461c1..d715adda29 100644
--- a/test/frame-guard.test.ts
+++ b/test/frame-guard.test.ts
@@ -19,7 +19,7 @@ import type { Session } from "../src/types.js";
// that would drop the worker is never shipped.
describe("frame-guard", () => {
- it("keeps the safe cap under the 16 MiB frame limit with headroom", () => {
+ it("keeps the safe cap under the 64 MiB frame limit with headroom", () => {
expect(SAFE_PAYLOAD_BYTES).toBeLessThan(FRAME_LIMIT_BYTES_FOR_TEST);
expect(FRAME_LIMIT_BYTES_FOR_TEST - SAFE_PAYLOAD_BYTES).toBeGreaterThanOrEqual(
1024 * 1024,
diff --git a/test/graph-index-migration.test.ts b/test/graph-index-migration.test.ts
index b1d90901da..9dbb46fc6d 100644
--- a/test/graph-index-migration.test.ts
+++ b/test/graph-index-migration.test.ts
@@ -333,7 +333,7 @@ describe("explicit graph index migration", () => {
intercept((fn, payload) => { if (fn === "state::get" && payload.scope === KV.graphRetrievalControl) throw new Error("storage offline"); });
expect(await controller.status()).toMatchObject({
state: "unavailable", ready: false,
- error: "Graph index migration stopped after a storage failure. Check the server and resume when storage is available.",
+ error: "Graph index migration stopped after a storage failure. Check the server and resume when storage is available. (storage offline)",
});
await expect(controller.start({ allowLegacyScan: true })).rejects.toThrow("storage offline");
expect(calls.some((call) => call.fn === "state::set" || call.fn === "state::list")).toBe(false);
@@ -343,6 +343,20 @@ describe("explicit graph index migration", () => {
expect((await controller.status()).jobId).not.toBe(old);
});
+ it("appends the underlying storage error code and message, truncated to 300 chars", async () => {
+ const { controller, intercept } = setup();
+ const transportError = Object.assign(new Error("Serialized JSON envelope is too large"), { code: "payload_too_large" });
+ intercept((fn, payload) => { if (fn === "state::get" && payload.scope === KV.graphRetrievalControl) throw transportError; });
+ const status = await controller.status();
+ expect(status).toMatchObject({ state: "unavailable", ready: false });
+ expect(status.error).toContain("resume when storage is available. (payload_too_large: Serialized JSON envelope is too large)");
+ intercept((fn, payload) => { if (fn === "state::get" && payload.scope === KV.graphRetrievalControl) throw Object.assign(new Error("x".repeat(500)), { code: "boom" }); });
+ const truncated = await controller.status();
+ expect(truncated.error).toContain("boom: ");
+ expect(truncated.error!.length).toBeLessThanOrEqual("Graph index migration stopped after a storage failure. Check the server and resume when storage is available. ()".length + 300);
+ expect(truncated.error).not.toContain("x".repeat(301));
+ });
+
it("fails closed for corrupt descriptors and oversized legacy IDs", async () => {
const { controller, rows, calls } = setup();
rows.set(KV.graphIndexMigration, new Map([[GRAPH_INDEX_MIGRATION_KEY, { schema: 999 }]]));
diff --git a/test/graph-ingestion.test.ts b/test/graph-ingestion.test.ts
index 73ea454a1a..9fcde2fdc2 100644
--- a/test/graph-ingestion.test.ts
+++ b/test/graph-ingestion.test.ts
@@ -561,7 +561,7 @@ describe("raw graph ingestion reconciliation", () => {
await persistGraphRecords(kv, [node("before")], [], { mode: "merge" });
let sentOversized = false;
intercept((id, p) => {
- if (id === "state::set" && Buffer.byteLength(JSON.stringify(p), "utf8") > 16 * 1024 * 1024) {
+ if (id === "state::set" && Buffer.byteLength(JSON.stringify(p), "utf8") > 64 * 1024 * 1024) {
sentOversized = true;
throw new Error("Engine transport disconnected");
}
diff --git a/test/mcp-standalone-proxy.test.ts b/test/mcp-standalone-proxy.test.ts
index 6101e9bda0..5653510fca 100644
--- a/test/mcp-standalone-proxy.test.ts
+++ b/test/mcp-standalone-proxy.test.ts
@@ -274,10 +274,10 @@ describe("@agentmemory/mcp standalone — server proxy", () => {
let probeCount = 0;
const refusal = {
success: false,
- error: "Response is 20.0 MiB, over the ~15 MiB engine transport frame limit; narrow the range",
+ error: "Response is 70.0 MiB, over the ~60 MiB engine transport message limit; narrow the range",
oversized: true,
- bytes: 20 * 1024 * 1024,
- limitBytes: 15 * 1024 * 1024,
+ bytes: 70 * 1024 * 1024,
+ limitBytes: 60 * 1024 * 1024,
};
installFetch((url) => {
if (url.endsWith("/agentmemory/livez")) {
diff --git a/test/observation-source.test.ts b/test/observation-source.test.ts
index db9ebbcbb1..79d2018de1 100644
--- a/test/observation-source.test.ts
+++ b/test/observation-source.test.ts
@@ -322,7 +322,7 @@ describe("retained observation source", () => {
it("refuses a replay result that expands beyond the transport frame", async () => {
const r = rig();
const template = buildSyntheticCompression(raw({ toolName: "tool".repeat(10000) }));
- for (let i = 0; i < 500; i++) {
+ for (let i = 0; i < 2000; i++) {
const row = { ...template, id: `large-label-${i}` };
await r.kv.set(KV.observations(row.sessionId), row.id, row);
}
diff --git a/test/registration-defaults.test.ts b/test/registration-defaults.test.ts
new file mode 100644
index 0000000000..49cf07bd6a
--- /dev/null
+++ b/test/registration-defaults.test.ts
@@ -0,0 +1,61 @@
+import { describe, it, expect, afterEach } from "vitest";
+import { withRegistrationDefaults } from "../src/runtime/registration.js";
+
+function fakeSdk() {
+ const calls: Array<{ id: string; handler: unknown; options: unknown }> = [];
+ return {
+ calls,
+ counter: 7,
+ registerFunction(id: string, handler: unknown, options?: unknown) {
+ calls.push({ id, handler, options });
+ return id;
+ },
+ trigger(input: { function_id: string }) {
+ return Promise.resolve({ echoed: input.function_id, counter: this.counter });
+ },
+ };
+}
+
+afterEach(() => {
+ delete process.env.AGENTMEMORY_LOCAL_DISPATCH;
+});
+
+describe("withRegistrationDefaults", () => {
+ it("passes registerFunction options through unchanged when the env is unset", () => {
+ const sdk = fakeSdk();
+ const wrapped = withRegistrationDefaults(sdk);
+ const handler = () => "ok";
+ wrapped.registerFunction("mem::a", handler);
+ wrapped.registerFunction("mem::b", handler, { observe: { onStart() {} } });
+ expect(sdk.calls[0].options).toBeUndefined();
+ expect(sdk.calls[1].options).toEqual({ observe: { onStart: expect.any(Function) } });
+ expect(sdk.calls[1].options).not.toHaveProperty("localDispatch");
+ });
+
+ it("merges localDispatch: false when AGENTMEMORY_LOCAL_DISPATCH is false", () => {
+ process.env.AGENTMEMORY_LOCAL_DISPATCH = "false";
+ const sdk = fakeSdk();
+ const wrapped = withRegistrationDefaults(sdk);
+ wrapped.registerFunction("mem::a", () => {}, { observe: { tag: "t" }, invocationTimeoutMs: 5000 });
+ expect(sdk.calls[0].options).toEqual({ observe: { tag: "t" }, invocationTimeoutMs: 5000, localDispatch: false });
+ wrapped.registerFunction("mem::b", () => {});
+ expect(sdk.calls[1].options).toEqual({ localDispatch: false });
+ });
+
+ it("honors an explicit localDispatch override request only through the env flag", () => {
+ process.env.AGENTMEMORY_LOCAL_DISPATCH = "false";
+ const sdk = fakeSdk();
+ const wrapped = withRegistrationDefaults(sdk);
+ wrapped.registerFunction("mem::a", () => {}, { localDispatch: true });
+ expect(sdk.calls[0].options).toEqual({ localDispatch: false });
+ });
+
+ it("keeps non-registerFunction methods bound to the target", async () => {
+ const sdk = fakeSdk();
+ const wrapped = withRegistrationDefaults(sdk);
+ await expect(wrapped.trigger({ function_id: "x::y" })).resolves.toEqual({ echoed: "x::y", counter: 7 });
+ process.env.AGENTMEMORY_LOCAL_DISPATCH = "false";
+ await expect(wrapped.trigger({ function_id: "x::z" })).resolves.toEqual({ echoed: "x::z", counter: 7 });
+ expect(wrapped.counter).toBe(7);
+ });
+});
diff --git a/website/app/security/page.tsx b/website/app/security/page.tsx
index 8094a6d28e..890112d35e 100644
--- a/website/app/security/page.tsx
+++ b/website/app/security/page.tsx
@@ -127,7 +127,7 @@ export default function SecurityPage() {
Supply chain
- The iii engine is pinned to one version (0.25.0) and runs workers under Worker Compose; registry workers state@0.22.20 and http@0.22.7 provide state and REST. The installer checks the downloaded archive
+ The iii engine is pinned to one version (0.25.0) and runs workers under Worker Compose; registry workers state@0.22.22 and http@0.22.8 provide state and REST. The installer checks the downloaded archive
against a SHA-256 recorded in the package before it extracts it.
From c626a3815869657385647b218b955933cb4e8bdc Mon Sep 17 00:00:00 2001
From: Rohit Ghumare
Date: Thu, 29 Oct 2026 16:03:45 +0530
Subject: [PATCH 02/36] fix(gates): fail closed on unobserved worker identity
and forward interrupts in repeat mode
The large-store gate now waits for the agentmemory worker to appear in
engine::workers::list before taking the baseline, and treats an empty or
failed observation as unstable instead of a pass. Repeat mode in the startup
gate forwards SIGINT/SIGTERM/SIGHUP to the active child's process group so
its teardown runs, escalating to SIGKILL on a second signal. The Docker
Compose environments forward AGENTMEMORY_LOCAL_DISPATCH, and the
registration-defaults tests no longer depend on the caller's environment.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Signed-off-by: Rohit Ghumare
---
deploy/coolify/docker-compose.yml | 1 +
deploy/runtime/worker-compose.yaml | 1 +
docker-compose.yml | 1 +
scripts/release-gate/large-store.mjs | 14 +++++++++-----
scripts/release-gate/startup.mjs | 20 ++++++++++++++++----
test/registration-defaults.test.ts | 11 +++++++++--
6 files changed, 37 insertions(+), 11 deletions(-)
diff --git a/deploy/coolify/docker-compose.yml b/deploy/coolify/docker-compose.yml
index a229cb7692..93d67ff713 100644
--- a/deploy/coolify/docker-compose.yml
+++ b/deploy/coolify/docker-compose.yml
@@ -59,6 +59,7 @@ services:
AGENTMEMORY_STATE_BACKEND: "${AGENTMEMORY_STATE_BACKEND:-}"
AGENTMEMORY_REDIS_URL: "${AGENTMEMORY_REDIS_URL:-}"
AGENTMEMORY_STATE_SAVE_INTERVAL_MS: "${AGENTMEMORY_STATE_SAVE_INTERVAL_MS:-}"
+ AGENTMEMORY_LOCAL_DISPATCH: "${AGENTMEMORY_LOCAL_DISPATCH:-}"
AGENTMEMORY_SECRET: "${AGENTMEMORY_SECRET:-}"
AGENT_ID: "${AGENT_ID:-}"
TEAM_ID: "${TEAM_ID:-}"
diff --git a/deploy/runtime/worker-compose.yaml b/deploy/runtime/worker-compose.yaml
index c1c1092887..3c72a41686 100644
--- a/deploy/runtime/worker-compose.yaml
+++ b/deploy/runtime/worker-compose.yaml
@@ -118,6 +118,7 @@ containers:
AGENTMEMORY_STATE_BACKEND: "${AGENTMEMORY_STATE_BACKEND:-}"
AGENTMEMORY_REDIS_URL: "${AGENTMEMORY_REDIS_URL:-}"
AGENTMEMORY_STATE_SAVE_INTERVAL_MS: "${AGENTMEMORY_STATE_SAVE_INTERVAL_MS:-}"
+ AGENTMEMORY_LOCAL_DISPATCH: "${AGENTMEMORY_LOCAL_DISPATCH:-}"
AGENTMEMORY_SECRET: "${AGENTMEMORY_SECRET:-}"
AGENT_ID: "${AGENT_ID:-}"
TEAM_ID: "${TEAM_ID:-}"
diff --git a/docker-compose.yml b/docker-compose.yml
index 7143f5a6f1..418e1544c0 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -63,6 +63,7 @@ services:
AGENTMEMORY_AUDIT_RETENTION_MONTHS: "${AGENTMEMORY_AUDIT_RETENTION_MONTHS:-}"
AGENTMEMORY_AUDIT_MIGRATE_MAX_BYTES: "${AGENTMEMORY_AUDIT_MIGRATE_MAX_BYTES:-}"
AGENTMEMORY_STATE_SAVE_INTERVAL_MS: "${AGENTMEMORY_STATE_SAVE_INTERVAL_MS:-}"
+ AGENTMEMORY_LOCAL_DISPATCH: "${AGENTMEMORY_LOCAL_DISPATCH:-}"
AGENTMEMORY_SECRET: "${AGENTMEMORY_SECRET:-}"
AGENT_ID: "${AGENT_ID:-}"
TEAM_ID: "${TEAM_ID:-}"
diff --git a/scripts/release-gate/large-store.mjs b/scripts/release-gate/large-store.mjs
index bd07990f5f..3818798aa2 100644
--- a/scripts/release-gate/large-store.mjs
+++ b/scripts/release-gate/large-store.mjs
@@ -364,7 +364,7 @@ function scanLogs() {
return findings;
}
-let seeded = {}, workersBefore = [], workersAfter = [], workerReregistered = false, logFindings = {}, migrateFinal;
+let seeded = {}, workersBefore = [], workersAfter = [], workerObserved = false, workerReregistered = false, logFindings = {}, migrateFinal;
try {
await install();
engine = await ensureEngine();
@@ -384,7 +384,10 @@ try {
seeded = await seed();
console.log(JSON.stringify({ name: "seeded", scopes: seeded, totalMs: Math.round(performance.now() - seedStart) }));
await startWorker();
- workersBefore = await agentmemoryWorkers();
+ workersBefore = await poll("agentmemory worker registration", async () => {
+ const listed = await agentmemoryWorkers();
+ return listed.some((worker) => worker.id) ? listed : false;
+ }, 60_000);
await probe("semantic", "/semantic?limit=50");
await probe("insights", "/insights?limit=50");
@@ -420,7 +423,8 @@ try {
workersAfter = await agentmemoryWorkers();
const ids = (list) => list.filter((worker) => worker.id).map((worker) => worker.id);
const before = ids(workersBefore), after = ids(workersAfter);
- workerReregistered = before.length !== after.length || before.some((id) => !after.includes(id)) || after.some((id) => !before.includes(id));
+ workerObserved = before.length > 0 && after.length > 0 && !workersAfter.some((worker) => worker.error);
+ workerReregistered = !workerObserved || before.length !== after.length || before.some((id) => !after.includes(id)) || after.some((id) => !before.includes(id));
logFindings = scanLogs();
} catch (error) {
fatal = error.stack ?? String(error);
@@ -447,7 +451,7 @@ const summary = {
probes,
failedProbes: probeFailed.map((entry) => entry.name),
migrate: migrateFinal,
- stability: { workersBefore, workersAfter, workerReregistered },
+ stability: { workersBefore, workersAfter, workerObserved, workerReregistered },
logFindings,
fatal,
};
@@ -457,7 +461,7 @@ for (const entry of probes) {
const mib = entry.bytes !== undefined ? (entry.bytes / (1024 * 1024)).toFixed(1) : "-";
console.log(`${entry.name.padEnd(24)} ${String(entry.status ?? entry.state ?? "-").padEnd(8)} ${String(entry.latencyMs ?? entry.elapsedMs ?? "-").padEnd(9)} ${mib.padEnd(8)} ${entry.error ?? ""}`);
}
-console.log(`workerReregistered: ${workerReregistered} payload_too_large hits: ${logFindings.payload_too_large ?? 0} WS_ERR hits: ${logFindings.WS_ERR_UNSUPPORTED_MESSAGE_LENGTH ?? 0}`);
+console.log(`workerObserved: ${workerObserved} workerReregistered: ${workerReregistered} payload_too_large hits: ${logFindings.payload_too_large ?? 0} WS_ERR hits: ${logFindings.WS_ERR_UNSUPPORTED_MESSAGE_LENGTH ?? 0}`);
console.log(`Results: ${join(root, "results.json")}`);
const assertFailed = options.assert && (fatal || probeFailed.length > 0 || (migrateFinal && !migrateOk) || workerReregistered);
process.exit(fatal ? 1 : assertFailed ? 1 : 0);
diff --git a/scripts/release-gate/startup.mjs b/scripts/release-gate/startup.mjs
index ed0e9e3a62..87c1956fe1 100644
--- a/scripts/release-gate/startup.mjs
+++ b/scripts/release-gate/startup.mjs
@@ -39,10 +39,22 @@ if (options.repeat) {
mkdirSync(repeatOut, { recursive: true });
console.log(`Repeat runs: ${repeatOut}`);
const runs = [];
- for (let run = 1; run <= options.repeat; run++) {
+ const active = new Set();
+ let interrupted = null;
+ const forward = (signal) => {
+ const escalate = interrupted !== null;
+ interrupted = signal;
+ for (const pid of active) {
+ try { process.kill(-pid, escalate ? "SIGKILL" : "SIGTERM"); } catch {}
+ }
+ };
+ process.on("SIGINT", () => forward("SIGINT"));
+ process.on("SIGTERM", () => forward("SIGTERM"));
+ process.on("SIGHUP", () => forward("SIGHUP"));
+ for (let run = 1; run <= options.repeat && !interrupted; run++) {
const runOut = join(repeatOut, `run-${run}`);
console.log(`\n=== run ${run}/${options.repeat}: ${runOut} ===`);
- const result = await runCommand(process.execPath, [self, ...childArgs, "--out", runOut], { env: process.env, cwd: repo, timeoutMs: 3_600_000 });
+ const result = await runCommand(process.execPath, [self, ...childArgs, "--out", runOut], { env: process.env, cwd: repo, timeoutMs: 3_600_000, children: active });
process.stdout.write(result.output);
let summary;
try { summary = JSON.parse(readFileSync(join(runOut, "summary.json"), "utf8")); } catch {}
@@ -53,8 +65,8 @@ if (options.repeat) {
}
console.log("\nrun result passed out");
for (const r of runs) console.log(`${String(r.run).padEnd(5)} ${(r.ok ? "pass" : "fail").padEnd(7)} ${`${r.passed}/${r.total}`.padEnd(7)} ${r.out}`);
- writeFileSync(join(repeatOut, "repeat-summary.json"), JSON.stringify({ repeat: options.repeat, runs }, null, 2) + "\n");
- process.exit(runs.every((r) => r.ok) ? 0 : 1);
+ writeFileSync(join(repeatOut, "repeat-summary.json"), JSON.stringify({ repeat: options.repeat, runs, interrupted }, null, 2) + "\n");
+ process.exit(interrupted ? 130 : runs.every((r) => r.ok) ? 0 : 1);
}
const root = mkdtempSync(join(tmpdir(), "am-startup-"));
const out = options.out ?? mkdtempSync(join(tmpdir(), "agentmemory-startup-gate-"));
diff --git a/test/registration-defaults.test.ts b/test/registration-defaults.test.ts
index 49cf07bd6a..7dedd00b78 100644
--- a/test/registration-defaults.test.ts
+++ b/test/registration-defaults.test.ts
@@ -1,4 +1,4 @@
-import { describe, it, expect, afterEach } from "vitest";
+import { describe, it, expect, afterEach, beforeEach } from "vitest";
import { withRegistrationDefaults } from "../src/runtime/registration.js";
function fakeSdk() {
@@ -16,11 +16,18 @@ function fakeSdk() {
};
}
+const originalLocalDispatch = process.env.AGENTMEMORY_LOCAL_DISPATCH;
+
afterEach(() => {
- delete process.env.AGENTMEMORY_LOCAL_DISPATCH;
+ if (originalLocalDispatch === undefined) delete process.env.AGENTMEMORY_LOCAL_DISPATCH;
+ else process.env.AGENTMEMORY_LOCAL_DISPATCH = originalLocalDispatch;
});
describe("withRegistrationDefaults", () => {
+ beforeEach(() => {
+ delete process.env.AGENTMEMORY_LOCAL_DISPATCH;
+ });
+
it("passes registerFunction options through unchanged when the env is unset", () => {
const sdk = fakeSdk();
const wrapped = withRegistrationDefaults(sdk);
From 4cc78d0d00e67b202c5f33f0a1aad2b53b4a1f0b Mon Sep 17 00:00:00 2001
From: Rohit Ghumare
Date: Thu, 29 Oct 2026 16:05:37 +0530
Subject: [PATCH 03/36] feat(state): page state reads so scopes above 64 MiB
keep working
Even with 64 MiB transport messages, a single state::list of the insights or
graph scopes can exceed the limit (524 MB insights, 73 MB graph nodes in the
large-store gate). StateKV gains listKeys, getMany, iterate and listPage built
on state::list_keys plus batched state::get, and switches to state::get_many
when the state worker provides it. Every reader of an unbounded scope now goes
through them, and a guard test blocks new whole-scope reads.
Mesh export pages with a stable id cursor and the sync client follows it to
the end, stamping lastSyncAt with the sync start time only after the final
page. Export no longer swallows collection read failures, which silently
dropped semantic and insight data when the read failed. Graph index migration
discovers ids through listKeys.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Signed-off-by: Rohit Ghumare
---
AGENTS.md | 4 +-
CHANGELOG.md | 3 +
README.md | 4 +-
READMEs/README.ar-SA.md | 4 +-
READMEs/README.bn-BD.md | 4 +-
READMEs/README.cs-CZ.md | 4 +-
READMEs/README.da-DK.md | 4 +-
READMEs/README.de-DE.md | 4 +-
READMEs/README.el-GR.md | 4 +-
READMEs/README.es-ES.md | 4 +-
READMEs/README.fi-FI.md | 4 +-
READMEs/README.fr-FR.md | 4 +-
READMEs/README.he-IL.md | 4 +-
READMEs/README.hi-IN.md | 4 +-
READMEs/README.hu-HU.md | 4 +-
READMEs/README.id-ID.md | 4 +-
READMEs/README.it-IT.md | 4 +-
READMEs/README.ja-JP.md | 4 +-
READMEs/README.ko-KR.md | 4 +-
READMEs/README.nb-NO.md | 4 +-
READMEs/README.nl-NL.md | 4 +-
READMEs/README.pl-PL.md | 4 +-
READMEs/README.pt-BR.md | 4 +-
READMEs/README.pt-PT.md | 4 +-
READMEs/README.ro-RO.md | 4 +-
READMEs/README.ru-RU.md | 4 +-
READMEs/README.sv-SE.md | 4 +-
READMEs/README.th-TH.md | 4 +-
READMEs/README.tl-PH.md | 4 +-
READMEs/README.tr-TR.md | 4 +-
READMEs/README.uk-UA.md | 4 +-
READMEs/README.ur-PK.md | 4 +-
READMEs/README.vi-VN.md | 4 +-
READMEs/README.zh-CN.md | 4 +-
READMEs/README.zh-TW.md | 4 +-
assets/tags/light/stat-tests.svg | 4 +-
assets/tags/stat-tests.svg | 4 +-
scripts/docs-sync.state.json | 2 +-
scripts/release-gate/large-store.mjs | 21 ++-
src/functions/audit.ts | 14 +-
src/functions/auto-forget.ts | 4 +-
src/functions/cascade.ts | 4 +-
src/functions/claude-bridge.ts | 4 +-
src/functions/consolidate.ts | 4 +-
src/functions/consolidation-pipeline.ts | 14 +-
src/functions/diagnostics.ts | 11 +-
src/functions/evict.ts | 4 +-
src/functions/export-import.ts | 49 +++----
src/functions/governance.ts | 4 +-
src/functions/graph.ts | 6 +-
src/functions/mesh.ts | 72 ++++++----
src/functions/migrate-vector-index.ts | 4 +-
src/functions/migrate.ts | 4 +-
src/functions/obsidian-export.ts | 4 +-
src/functions/reflect.ts | 10 +-
src/functions/remember.ts | 6 +-
src/functions/retention.ts | 6 +-
src/functions/search.ts | 6 +-
src/functions/skill-extract.ts | 6 +-
src/functions/snapshot.ts | 8 +-
src/functions/working-memory.ts | 4 +-
src/mcp/server.ts | 12 +-
src/state/graph-generation.ts | 20 ++-
src/state/graph-index-migration.ts | 10 +-
src/state/kv.ts | 153 ++++++++++++++++++++
src/triggers/api.ts | 123 +++++++++++-----
test/graph-generation-surfaces.test.ts | 8 ++
test/graph-generation.test.ts | 1 +
test/graph-index-migration.test.ts | 33 ++---
test/graph-ingestion-import-mesh.test.ts | 1 +
test/graph-ingestion-snapshot.test.ts | 1 +
test/graph-query.test.ts | 4 +
test/helpers/graph-index-state.ts | 1 +
test/kv-paged.test.ts | 170 +++++++++++++++++++++++
test/mesh-export-project-scope.test.ts | 44 +++++-
test/mesh.test.ts | 64 +++++++++
test/redis-state-backend.test.ts | 4 +
test/unbounded-list-guard.test.ts | 36 +++++
78 files changed, 851 insertions(+), 252 deletions(-)
create mode 100644 test/kv-paged.test.ts
create mode 100644 test/unbounded-list-guard.test.ts
diff --git a/AGENTS.md b/AGENTS.md
index 6c88f558e2..c53122c1e1 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -101,7 +101,7 @@ Hook scripts in `src/hooks/` are standalone Node.js scripts (no iii-sdk import).
## Testing
-- Before every commit run, in order: `npm run build`, `npm run skills:gen`, `npm run docs:sync`, `npm run skills:check`, `npm test` (4,000+ tests). Commit anything the generators changed. CI runs the same build, skills check and tests.
+- Before every commit run, in order: `npm run build`, `npm run skills:gen`, `npm run docs:sync`, `npm run skills:check`, `npm test` (4,100+ tests). Commit anything the generators changed. CI runs the same build, skills check and tests.
- Before any npm publish: `npm run release:gate` must pass. It installs the packed tarballs into a clean home and runs capture, recovery, restart, export/import, MCP and status checks against the installed CLI (see CONTRIBUTING.md, Release process)
- Mock pattern: `vi.mock("iii-sdk")` with mock `sdk.trigger`, `kv.get/set/list`
- Test files go in `test/` with `.test.ts` extension
@@ -114,4 +114,4 @@ Hook scripts in `src/hooks/` are standalone Node.js scripts (no iii-sdk import).
- 6 MCP resources, 3 MCP prompts
- 12 hooks, 17 skills
- 322+ iii functions
-- 4,000+ tests
+- 4,100+ tests
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c085383eda..3116902084 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
### Fixed
- **Graph index migration errors now include the underlying cause** (#1617). The friendly "storage failure" sentence is kept and the original `code: message` detail is appended (truncated to 300 chars), so a `payload_too_large` rejection or similar storage error is visible instead of hidden.
+- **Reads of scopes over 64 MiB no longer fail.** `StateKV` gains `listKeys`, `getMany`, `iterate` and `listPage` (key listing plus bounded-concurrency `state::get`, with automatic use of `state::get_many` when the state worker advertises it), and every reader of `mem:insights`, `mem:semantic`, `mem:procedural`, `mem:graph:nodes`, `mem:graph:edges`, `mem:memories`, `mem:audit*` and `mem:relations` now pages instead of issuing a single `state::list`. The graph index migration's legacy scan uses `listKeys`, so migration works above 64 MiB (#1585, #1617). A guard test forbids regressions.
+- **Mesh export pages by cursor** (#890). `GET /agentmemory/mesh/export` accepts `limit` (default 500) and `cursor`, returns `nextCursor` when more remains and shrinks the page rather than failing when it would exceed the transport cap. The sync client follows `nextCursor` until exhausted and only advances `lastSyncAt` after the final page; peers on older versions without `nextCursor` are treated as a single page.
+- **Export no longer drops collections whose read failed.** `mem::export`, `GET /agentmemory/export` and the import replace path no longer swallow `state::list` failures into empty collections; a failed read surfaces as an error instead of a silently truncated export.
## [0.9.31] — 2026-10-25
### Upgrade notes
diff --git a/README.md b/README.md
index 07d9286bb6..70c55815b0 100644
--- a/README.md
+++ b/README.md
@@ -69,7 +69,7 @@
-
+
@@ -1307,7 +1307,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.ar-SA.md b/READMEs/README.ar-SA.md
index b1361afeb6..39cbee5078 100644
--- a/READMEs/README.ar-SA.md
+++ b/READMEs/README.ar-SA.md
@@ -71,7 +71,7 @@
-
+
@@ -1242,7 +1242,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.bn-BD.md b/READMEs/README.bn-BD.md
index f484461278..8191f6fce0 100644
--- a/READMEs/README.bn-BD.md
+++ b/READMEs/README.bn-BD.md
@@ -69,7 +69,7 @@
-
+
@@ -1255,7 +1255,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.cs-CZ.md b/READMEs/README.cs-CZ.md
index fde107dac8..95643702c4 100644
--- a/READMEs/README.cs-CZ.md
+++ b/READMEs/README.cs-CZ.md
@@ -69,7 +69,7 @@
-
+
@@ -1241,7 +1241,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.da-DK.md b/READMEs/README.da-DK.md
index 5eac7f2f04..5400a8bbb6 100644
--- a/READMEs/README.da-DK.md
+++ b/READMEs/README.da-DK.md
@@ -69,7 +69,7 @@
-
+
@@ -1249,7 +1249,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.de-DE.md b/READMEs/README.de-DE.md
index 311e1459ee..ecc23dc20b 100644
--- a/READMEs/README.de-DE.md
+++ b/READMEs/README.de-DE.md
@@ -69,7 +69,7 @@
-
+
@@ -1247,7 +1247,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.el-GR.md b/READMEs/README.el-GR.md
index a021d9cfa9..92c2a983c3 100644
--- a/READMEs/README.el-GR.md
+++ b/READMEs/README.el-GR.md
@@ -69,7 +69,7 @@
-
+
@@ -1241,7 +1241,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.es-ES.md b/READMEs/README.es-ES.md
index a66ef720a8..53877c65d8 100644
--- a/READMEs/README.es-ES.md
+++ b/READMEs/README.es-ES.md
@@ -69,7 +69,7 @@
-
+
@@ -1243,7 +1243,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.fi-FI.md b/READMEs/README.fi-FI.md
index 24c7d17060..104f014411 100644
--- a/READMEs/README.fi-FI.md
+++ b/READMEs/README.fi-FI.md
@@ -69,7 +69,7 @@
-
+
@@ -1241,7 +1241,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.fr-FR.md b/READMEs/README.fr-FR.md
index e7172efac7..9c28bfc099 100644
--- a/READMEs/README.fr-FR.md
+++ b/READMEs/README.fr-FR.md
@@ -69,7 +69,7 @@
-
+
@@ -1250,7 +1250,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.he-IL.md b/READMEs/README.he-IL.md
index e18522b845..f6ae713d1c 100644
--- a/READMEs/README.he-IL.md
+++ b/READMEs/README.he-IL.md
@@ -71,7 +71,7 @@
-
+
@@ -1242,7 +1242,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.hi-IN.md b/READMEs/README.hi-IN.md
index efee2e6e5c..951e70b4a1 100644
--- a/READMEs/README.hi-IN.md
+++ b/READMEs/README.hi-IN.md
@@ -69,7 +69,7 @@
-
+
@@ -1256,7 +1256,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.hu-HU.md b/READMEs/README.hu-HU.md
index a5e23b1e78..3eecfe8a17 100644
--- a/READMEs/README.hu-HU.md
+++ b/READMEs/README.hu-HU.md
@@ -69,7 +69,7 @@
-
+
@@ -1239,7 +1239,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.id-ID.md b/READMEs/README.id-ID.md
index 06a24851a6..72af6568e4 100644
--- a/READMEs/README.id-ID.md
+++ b/READMEs/README.id-ID.md
@@ -69,7 +69,7 @@
-
+
@@ -1256,7 +1256,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.it-IT.md b/READMEs/README.it-IT.md
index 871d409347..1d22859a76 100644
--- a/READMEs/README.it-IT.md
+++ b/READMEs/README.it-IT.md
@@ -69,7 +69,7 @@
-
+
@@ -1249,7 +1249,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.ja-JP.md b/READMEs/README.ja-JP.md
index 050f4dbb8e..9bd4258572 100644
--- a/READMEs/README.ja-JP.md
+++ b/READMEs/README.ja-JP.md
@@ -69,7 +69,7 @@
-
+
@@ -1255,7 +1255,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.ko-KR.md b/READMEs/README.ko-KR.md
index 2ba26f74fb..d55b2ddd8c 100644
--- a/READMEs/README.ko-KR.md
+++ b/READMEs/README.ko-KR.md
@@ -69,7 +69,7 @@
-
+
@@ -1254,7 +1254,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.nb-NO.md b/READMEs/README.nb-NO.md
index 620048b461..48aed965d3 100644
--- a/READMEs/README.nb-NO.md
+++ b/READMEs/README.nb-NO.md
@@ -69,7 +69,7 @@
-
+
@@ -1247,7 +1247,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.nl-NL.md b/READMEs/README.nl-NL.md
index 835d336cdd..20afd87bfc 100644
--- a/READMEs/README.nl-NL.md
+++ b/READMEs/README.nl-NL.md
@@ -69,7 +69,7 @@
-
+
@@ -1243,7 +1243,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.pl-PL.md b/READMEs/README.pl-PL.md
index b19867232a..c54a35e553 100644
--- a/READMEs/README.pl-PL.md
+++ b/READMEs/README.pl-PL.md
@@ -69,7 +69,7 @@
-
+
@@ -1239,7 +1239,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.pt-BR.md b/READMEs/README.pt-BR.md
index 8630533003..c7fb221532 100644
--- a/READMEs/README.pt-BR.md
+++ b/READMEs/README.pt-BR.md
@@ -69,7 +69,7 @@
-
+
@@ -1247,7 +1247,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.pt-PT.md b/READMEs/README.pt-PT.md
index 94b2335b88..3e88fa6862 100644
--- a/READMEs/README.pt-PT.md
+++ b/READMEs/README.pt-PT.md
@@ -69,7 +69,7 @@
-
+
@@ -1243,7 +1243,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.ro-RO.md b/READMEs/README.ro-RO.md
index 1cefbf8672..27c5e61e76 100644
--- a/READMEs/README.ro-RO.md
+++ b/READMEs/README.ro-RO.md
@@ -69,7 +69,7 @@
-
+
@@ -1235,7 +1235,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.ru-RU.md b/READMEs/README.ru-RU.md
index 33558b5880..7394d19387 100644
--- a/READMEs/README.ru-RU.md
+++ b/READMEs/README.ru-RU.md
@@ -69,7 +69,7 @@
-
+
@@ -1241,7 +1241,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.sv-SE.md b/READMEs/README.sv-SE.md
index 760ca65053..ec85019c36 100644
--- a/READMEs/README.sv-SE.md
+++ b/READMEs/README.sv-SE.md
@@ -69,7 +69,7 @@
-
+
@@ -1249,7 +1249,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.th-TH.md b/READMEs/README.th-TH.md
index d67522366c..f124673c50 100644
--- a/READMEs/README.th-TH.md
+++ b/READMEs/README.th-TH.md
@@ -69,7 +69,7 @@
-
+
@@ -1242,7 +1242,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.tl-PH.md b/READMEs/README.tl-PH.md
index acc9b243b6..3a16f54a69 100644
--- a/READMEs/README.tl-PH.md
+++ b/READMEs/README.tl-PH.md
@@ -69,7 +69,7 @@
-
+
@@ -1251,7 +1251,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.tr-TR.md b/READMEs/README.tr-TR.md
index 0f8aa10db7..6d3528939e 100644
--- a/READMEs/README.tr-TR.md
+++ b/READMEs/README.tr-TR.md
@@ -69,7 +69,7 @@
-
+
@@ -1241,7 +1241,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.uk-UA.md b/READMEs/README.uk-UA.md
index 2c67111fe3..efeb059754 100644
--- a/READMEs/README.uk-UA.md
+++ b/READMEs/README.uk-UA.md
@@ -69,7 +69,7 @@
-
+
@@ -1242,7 +1242,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.ur-PK.md b/READMEs/README.ur-PK.md
index fd79b858af..a9fe15de30 100644
--- a/READMEs/README.ur-PK.md
+++ b/READMEs/README.ur-PK.md
@@ -71,7 +71,7 @@
-
+
@@ -1246,7 +1246,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.vi-VN.md b/READMEs/README.vi-VN.md
index 6a80a5fe14..3c40e0c478 100644
--- a/READMEs/README.vi-VN.md
+++ b/READMEs/README.vi-VN.md
@@ -69,7 +69,7 @@
-
+
@@ -1251,7 +1251,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.zh-CN.md b/READMEs/README.zh-CN.md
index 17a2acd713..6581598e70 100644
--- a/READMEs/README.zh-CN.md
+++ b/READMEs/README.zh-CN.md
@@ -69,7 +69,7 @@
-
+
@@ -1252,7 +1252,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.zh-TW.md b/READMEs/README.zh-TW.md
index cd1a905320..f909522aa2 100644
--- a/READMEs/README.zh-TW.md
+++ b/READMEs/README.zh-TW.md
@@ -69,7 +69,7 @@
-
+
@@ -1244,7 +1244,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization:
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 4,000+ tests
+npm test # 4,100+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/assets/tags/light/stat-tests.svg b/assets/tags/light/stat-tests.svg
index 915e1bab9d..7248bfad00 100644
--- a/assets/tags/light/stat-tests.svg
+++ b/assets/tags/light/stat-tests.svg
@@ -1,5 +1,5 @@
-