context-mode v1.0.146 Shows How One Wrong Path Breaks Agent Memory
context-mode v1.0.146 is a one-bug release with a production-sized lesson: an agent’s memory is only as trustworthy as the path resolution behind it. If an adapter writes session history to one database file and the MCP server reads another, nothing has to crash for the system to be wrong. The agent did work. The tool wrote state. The observability layer looks empty. Everyone starts debugging the model.
That is why this tiny OpenClaw SessionDB fix is worth more attention than its changelog footprint suggests. v1.0.146 routes the OpenClaw adapter through the same canonical resolveSessionDbPath({ projectDir, sessionsDir }) function used by the MCP server, instead of using raw sha256(projectDir).slice(0,16) logic directly in src/adapters/openclaw/plugin.ts. The earlier v1.0.145 release fixed the same bug family for Pi and OMP. v1.0.146 closes the loop for OpenClaw, completing what the maintainer calls “Family A” adapter coverage across opencode, Pi, OMP, and OpenClaw.
This is not just housekeeping. Session databases are becoming part of the agent control plane. They answer the questions operators ask after an agent has been running for an hour: what tools did it call, what context did it save, which session edited this file, why did timeline search miss an event, and what happened before the run got stuck? If that data is split across canonical, legacy, case-sensitive, worktree-suffixed, or hardcoded database paths, the runtime’s memory of work becomes nondeterministic.
The bug does not need to be loud to be dangerous
The release notes describe the pattern clearly. Pi and OMP adapters wrote SessionDB to a hardcoded path while the MCP server read from a different canonical <hash>.db. OpenClaw had the same bug class. Its adapter used raw hashing instead of the canonical resolver, missing case-folding, worktree suffixes, legacy migration behavior, and singleton re-keying when the resolved path changes. The fix is to make the adapter and server use byte-symmetric resolution.
The dangerous part is the failure mode. This kind of bug rarely announces itself with a stack trace. Instead, ctx_stats can fall back to a minimal report with zero tool-call history, zero savings figures, and no useful timeline. ctx_search(sort: "timeline") can silently degrade because the expected database file is absent. The developer sees a weak observability tool. The agent sees less useful memory. The actual cause is a path mismatch.
That matters because the whole pitch of context tooling is that agents should not drag giant transcripts around forever. context-mode positions itself as “the other half of the context problem,” and its README has claimed reductions like 315 KB of raw tool output down to 5.4 KB, a 98% cut. The HN launch discussion around the broader idea reached more than 570 points. There is real demand here. But compressed context only helps if the runtime can reliably find the compressed state.
During research capture, the context-mode repo showed 15,211 stars, 1,091 forks, eight open issues, a May 20 publish timestamp for v1.0.146, and same-day pushes. The release reports 96/96 OpenClaw tests, 38/38 adapter tests, and 3415/3415 full-suite tests passing. Compatibility remains 15 adapters across three operating systems, with no schema migration and engines.node >= 22.5.0 preserved.
Path canonicalization is a shared runtime concern
The most useful part of the release is the list of gotchas. macOS can resolve /var/... into /private/var/..., which changes the string you hash unless you call realpathSync first. Worktrees can require suffixes. Case-folding matters when paths move between filesystems with different case semantics. Legacy migrations can rename old database files into canonical locations. Any adapter that reimplements this logic locally becomes a future observability incident.
That is the real takeaway for agent-infra teams: path resolution belongs in shared code, not in copied snippets. The adapter should not have its own interpretation of “project directory.” The MCP server should not have a slightly different one. The UI should not make a third guess. If the database path is the rendezvous point for memory, stats, and timeline search, then every component must derive it the same way or the system is eventually going to lie.
The test note is also better than most release-note filler. The new OpenClaw test asserts that the adapter’s resolved path equals the MCP server’s canonical resolver output. But the maintainer calls out a trap: calling resolveSessionDbPath inside the assertion could trigger a one-shot legacy-to-canonical rename and mask the bug being tested. The assertion instead uses canonical hash/join behavior directly. That is a small testing pattern worth stealing. Verification code that mutates the state it is verifying can turn a real regression into a passing test with a guilty conscience.
For OpenClaw users, the action is straightforward: upgrade context-mode, restart OpenClaw, then re-check ctx_stats and timeline search on repositories that use worktrees, have moved across macOS path aliases, or have older context-mode state. If your stats suddenly recover tool history or savings numbers, the model did not get smarter. The runtime finally agreed with itself about where memory lived.
The practitioner checklist is boring because the failure is boring
If you are building an adapter for Claude Code, Codex, OpenCode, Pi, KiloCode, OpenClaw, or any host with MCP-backed context, this release should change your review checklist. Centralize session-path resolution. Normalize with realpath before hashing. Treat case-folding as a product decision, not an accident. Test worktree suffixes. Keep legacy migration tests separate from steady-state path tests. Assert that writers and readers rendezvous on the same file. Surface missing observability as a correctness failure, not a “no data yet” shrug.
The larger point is that agent memory is infrastructure now. It is not a nice-to-have transcript cache. It is what lets a human audit the run, what lets a tool summarize savings, what lets another agent resume work, and what lets an operator distinguish “the agent forgot” from “the runtime lost the evidence.” If adapters and servers disagree about the SessionDB path, your review trail is already compromised.
The editorial take: context-mode v1.0.146 is a boring path-resolution patch with a governance punchline. The agent can only be as reliable as the boring substrate beneath it. One wrong hash, one uncaught /var versus /private/var, one adapter with local path logic, and suddenly the system’s memory of work is split-brained. No benchmark will catch that. A good runtime test will.
Sources: GitHub — context-mode v1.0.146, Issue #645 — SessionDB path mismatch, context-mode v1.0.145 release, context-mode README, HN launch discussion.