Skip to content

#1 Persistent memory for AI coding agents based on real-world benchmarks

chore(release): v0.9.20 — hotfix Codex Stop revert (#501)

Rohit Ghumare08d781d43150
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 627384a2..3c73c185 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
## [Unreleased]
+## [0.9.20] — 2026-05-18
+
+Hotfix: revert the Codex Stop → session-end chain shipped in v0.9.19.
+
+### Fixed
+
+- **Revert Codex Stop hook session-end chain** ([PR #501](https://github.com/rohitg00/agentmemory/pull/501) by [@Rex57](https://github.com/Rex57), reverts v0.9.19's [#495](https://github.com/rohitg00/agentmemory/pull/495), re-opens [#493](https://github.com/rohitg00/agentmemory/issues/493)). Post-merge field-testing surfaced the underlying issue: Codex `Stop` fires before the overall conversation is truly finished — multiple Stops bracket each assistant turn within one session. Chaining `session-end.mjs` from Stop marked sessions completed too early, with later observations still arriving against an `endedAt`-stamped record. Restored to summarize-only Stop; the SessionEnd-shaped solution stays open as [#493](https://github.com/rohitg00/agentmemory/issues/493).
+
+[0.9.20]: https://github.com/rohitg00/agentmemory/compare/v0.9.19...v0.9.20
+
## [0.9.19] — 2026-05-18
Feature + hardening wave. Sessions now link to the git commits they shipped (forward + reverse lookup, REST + MCP surfaces). OpenAI provider transport collapses into one shared module with auto-detected Azure URL style (legacy `/openai/deployments/<dep>` and v1 `/openai/v1` both supported). Graph retrieval switches from BFS to Dijkstra over the weighted edge graph. Codex Stop hook chains session-end. Plugin MCP server inherits `AGENTMEMORY_URL` / `AGENTMEMORY_SECRET` from the shell. Point fix routes the bundled iii-console installer around an upstream tag-prefix bug. 1007+ tests pass.
diff --git a/package.json b/package.json
index b82e2b5d..820fc8f7 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@agentmemory/agentmemory",
- "version": "0.9.19",
+ "version": "0.9.20",
"description": "Persistent memory for AI coding agents, powered by iii-engine's three primitives",
"type": "module",
"main": "dist/index.mjs",
diff --git a/packages/mcp/package.json b/packages/mcp/package.json
index 4cc8df90..403295dd 100644
--- a/packages/mcp/package.json
+++ b/packages/mcp/package.json
@@ -1,6 +1,6 @@
{
"name": "@agentmemory/mcp",
- "version": "0.9.19",
+ "version": "0.9.20",
"description": "Standalone MCP server for agentmemory — thin shim that re-exposes @agentmemory/agentmemory's MCP entrypoint",
"type": "module",
"bin": {
diff --git a/plugin/.claude-plugin/plugin.json b/plugin/.claude-plugin/plugin.json
index 645d71bf..a18860e4 100644
--- a/plugin/.claude-plugin/plugin.json
+++ b/plugin/.claude-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "agentmemory",
- "version": "0.9.19",
+ "version": "0.9.20",
"description": "Persistent memory for AI coding agents -- captures tool usage, compresses via LLM, injects context into future sessions. 12 hooks, 51 MCP tools, 4 skills, real-time viewer.",
"author": {
"name": "Rohit Ghumare",
diff --git a/plugin/.codex-plugin/plugin.json b/plugin/.codex-plugin/plugin.json
index 038eda53..f8d676f6 100644
--- a/plugin/.codex-plugin/plugin.json
+++ b/plugin/.codex-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "agentmemory",
- "version": "0.9.19",
+ "version": "0.9.20",
"description": "Persistent memory for AI coding agents -- captures tool usage, compresses via LLM, injects context into future sessions. 6 hooks, 51 MCP tools, 4 skills, real-time viewer.",
"author": {
"name": "Rohit Ghumare",
diff --git a/plugin/scripts/post-commit.mjs b/plugin/scripts/post-commit.mjs
new file mode 100755
index 00000000..8552cd61
--- /dev/null
+++ b/plugin/scripts/post-commit.mjs
@@ -0,0 +1,102 @@
+#!/usr/bin/env node
+import { execFile } from "node:child_process";
+import { promisify } from "node:util";
+
+//#region src/hooks/post-commit.ts
+const exec = promisify(execFile);
+function isSdkChildContext(payload) {
+ if (process.env["AGENTMEMORY_SDK_CHILD"] === "1") return true;
+ if (!payload || typeof payload !== "object") return false;
+ return payload.entrypoint === "sdk-ts";
+}
+const REST_URL = process.env["AGENTMEMORY_URL"] || "http://localhost:3111";
+const SECRET = process.env["AGENTMEMORY_SECRET"] || "";
+const TIMEOUT_MS = 1500;
+function authHeaders() {
+ const h = { "Content-Type": "application/json" };
+ if (SECRET) h["Authorization"] = `Bearer ${SECRET}`;
+ return h;
+}
+async function git(args, cwd) {
+ try {
+ const { stdout } = await exec("git", args, {
+ cwd,
+ timeout: 1500
+ });
+ return stdout.trim();
+ } catch {
+ return null;
+ }
+}
+async function main() {
+ let input = "";
+ for await (const chunk of process.stdin) input += chunk;
+ let data = {};
+ if (input.trim()) try {
+ data = JSON.parse(input);
+ } catch {}
+ if (isSdkChildContext(data)) return;
+ const cwd = data.cwd || process.env["AGENTMEMORY_CWD"] || process.cwd();
+ const sessionId = data.session_id || process.env["AGENTMEMORY_SESSION_ID"] || void 0;
+ const sha = process.env["AGENTMEMORY_COMMIT_SHA"] || await git(["rev-parse", "HEAD"], cwd);
+ if (!sha) return;
+ const branch = await git([
+ "rev-parse",
+ "--abbrev-ref",
+ "HEAD"
+ ], cwd);
+ const repo = await git([
+ "config",
+ "--get",
+ "remote.origin.url"
+ ], cwd);
+ const message = await git([
+ "log",
+ "-1",
+ "--pretty=%B",
+ sha
+ ], cwd);
+ const author = await git([
+ "log",
+ "-1",
+ "--pretty=%an <%ae>",
+ sha
+ ], cwd);
+ const authoredAt = await git([
+ "log",
+ "-1",
+ "--pretty=%aI",
+ sha
+ ], cwd);
+ const filesRaw = await git([
+ "diff-tree",
+ "--no-commit-id",
+ "--name-only",
+ "-r",
+ sha
+ ], cwd);
+ const files = filesRaw ? filesRaw.split("\n").filter(Boolean) : void 0;
+ const body = {
+ sessionId,
+ sha,
+ branch: branch || void 0,
+ repo: repo || void 0,
+ message: message || void 0,
+ author: author || void 0,
+ authoredAt: authoredAt || void 0,
+ files
+ };
+ try {
+ await fetch(`${REST_URL}/agentmemory/session/commit`, {
+ method: "POST",
+ headers: authHeaders(),
+ body: JSON.stringify(body),
+ signal: AbortSignal.timeout(TIMEOUT_MS)
+ });
+ } catch {}
+}
+main();
+
+//#endregion
+export { };
+//# sourceMappingURL=post-commit.mjs.map
\ No newline at end of file
diff --git a/src/functions/export-import.ts b/src/functions/export-import.ts
index a178ef18..674b14da 100644
--- a/src/functions/export-import.ts
+++ b/src/functions/export-import.ts
@@ -176,7 +176,7 @@ export function registerExportImportFunction(sdk: ISdk, kv: StateKV): void {
const strategy = data.strategy || "merge";
const importData = data.exportData;
- const supportedVersions = new Set(["0.3.0", "0.4.0", "0.5.0", "0.6.0", "0.6.1", "0.7.0", "0.7.2", "0.7.3", "0.7.4", "0.7.5", "0.7.6", "0.7.7", "0.7.9", "0.8.0", "0.8.1", "0.8.2", "0.8.3", "0.8.4", "0.8.5", "0.8.6", "0.8.7", "0.8.8", "0.8.9", "0.8.10", "0.8.11", "0.8.12", "0.8.13", "0.9.0", "0.9.1", "0.9.2", "0.9.3", "0.9.4", "0.9.5", "0.9.6", "0.9.7", "0.9.8", "0.9.9", "0.9.10", "0.9.11", "0.9.12", "0.9.13", "0.9.14", "0.9.15", "0.9.16", "0.9.17", "0.9.18", "0.9.19"]);
+ const supportedVersions = new Set(["0.3.0", "0.4.0", "0.5.0", "0.6.0", "0.6.1", "0.7.0", "0.7.2", "0.7.3", "0.7.4", "0.7.5", "0.7.6", "0.7.7", "0.7.9", "0.8.0", "0.8.1", "0.8.2", "0.8.3", "0.8.4", "0.8.5", "0.8.6", "0.8.7", "0.8.8", "0.8.9", "0.8.10", "0.8.11", "0.8.12", "0.8.13", "0.9.0", "0.9.1", "0.9.2", "0.9.3", "0.9.4", "0.9.5", "0.9.6", "0.9.7", "0.9.8", "0.9.9", "0.9.10", "0.9.11", "0.9.12", "0.9.13", "0.9.14", "0.9.15", "0.9.16", "0.9.17", "0.9.18", "0.9.19", "0.9.20"]);
if (!supportedVersions.has(importData.version)) {
return {
success: false,
diff --git a/src/types.ts b/src/types.ts
index e885b947..bc38a058 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -293,7 +293,7 @@ export interface ExportPagination {
}
export interface ExportData {
- version: "0.3.0" | "0.4.0" | "0.5.0" | "0.6.0" | "0.6.1" | "0.7.0" | "0.7.2" | "0.7.3" | "0.7.4" | "0.7.5" | "0.7.6" | "0.7.7" | "0.7.9" | "0.8.0" | "0.8.1" | "0.8.2" | "0.8.3" | "0.8.4" | "0.8.5" | "0.8.6" | "0.8.7" | "0.8.8" | "0.8.9" | "0.8.10" | "0.8.11" | "0.8.12" | "0.8.13" | "0.9.0" | "0.9.1" | "0.9.2" | "0.9.3" | "0.9.4" | "0.9.5" | "0.9.6" | "0.9.7" | "0.9.8" | "0.9.9" | "0.9.10" | "0.9.11" | "0.9.12" | "0.9.13" | "0.9.14" | "0.9.15" | "0.9.16" | "0.9.17" | "0.9.18" | "0.9.19";
+ version: "0.3.0" | "0.4.0" | "0.5.0" | "0.6.0" | "0.6.1" | "0.7.0" | "0.7.2" | "0.7.3" | "0.7.4" | "0.7.5" | "0.7.6" | "0.7.7" | "0.7.9" | "0.8.0" | "0.8.1" | "0.8.2" | "0.8.3" | "0.8.4" | "0.8.5" | "0.8.6" | "0.8.7" | "0.8.8" | "0.8.9" | "0.8.10" | "0.8.11" | "0.8.12" | "0.8.13" | "0.9.0" | "0.9.1" | "0.9.2" | "0.9.3" | "0.9.4" | "0.9.5" | "0.9.6" | "0.9.7" | "0.9.8" | "0.9.9" | "0.9.10" | "0.9.11" | "0.9.12" | "0.9.13" | "0.9.14" | "0.9.15" | "0.9.16" | "0.9.17" | "0.9.18" | "0.9.19" | "0.9.20";
exportedAt: string;
sessions: Session[];
observations: Record<string, CompressedObservation[]>;
diff --git a/src/version.ts b/src/version.ts
index 150a39a7..35bfcbb0 100644
--- a/src/version.ts
+++ b/src/version.ts
@@ -1 +1 @@
-export const VERSION = "0.9.19";
+export const VERSION = "0.9.20";
diff --git a/test/export-import.test.ts b/test/export-import.test.ts
index 30cf8464..4426ce8e 100644
--- a/test/export-import.test.ts
+++ b/test/export-import.test.ts
@@ -119,7 +119,7 @@ describe("Export/Import Functions", () => {
it("export produces valid ExportData structure", async () => {
const result = (await sdk.trigger("mem::export", {})) as ExportData;
- expect(result.version).toBe("0.9.19");
+ expect(result.version).toBe("0.9.20");
expect(result.exportedAt).toBeDefined();
expect(result.sessions.length).toBe(1);
expect(result.sessions[0].id).toBe("ses_1");