Skip to content

Releases: ericjuta/omp-optchat

v0.7.0

Choose a tag to compare

@ericjuta ericjuta released this 11 Oct 19:51
v0.7.0
12a3464

OptChat can now find what its summaries forgot. Until now the model could only reach old detail by zooming through summary lines, one level per call, and only while some summary still named it. This release adds three retrieval primitives: exact-word chat_search over the original log, zoom depth to open several levels at once, and chat_recall, a System One gate that lets the judge pick the branch at every level down to the message that answers a question. All are on by default.

Signed tag v0.7.0 (commit 12a3464). CI is green on the pinned (18.9.1) and latest SDK cohorts; see "Verified" for the installed-host checks.

New memory tools

Tool What it does Cost
chat_search(text, kind?, limit?, before?) Finds stored messages containing every word of text, case-insensitively, newest first, each with its id, kind and a ~240-byte snippet. Reads the original messages, not summaries, so names, paths, numbers and errors a summary dropped are still found. kind filters (user, talk, tool, echo, note, work), limit is 1–50 (default 10), and before=<id> pages to older hits. Open a hit with zoom(id, 1). No model call
zoom(id, n, depth) Opens depth levels at once (1–4, at most log₂ n): the 2^depth lines under a range. depth 1 is the old zoom(id, n), byte for byte. No model call
chat_recall(question) The judge scores the view lines against the question, the best line at or above --optchat-recall-min (0.5) is opened, and one two-way choice per level ("which half holds the answer?") leads to a single message. Returns the descent path with each step's probability and the message's first 8 KB, with a zoom hint for the rest. ⌈lines/64⌉ + log₂ n judge calls, only when called; 20 s overall, 5 s per call

Example chat_recall result:

[optchat recall] why did the staging deploy fail?
64+32|user: deploy to staging; echo: deploy failed … (p=0.91)
80+16|… (p=0.84)
97+1|echo: Error: DATABASE_URL is not set … (p=0.77)
message 97:
Error: DATABASE_URL is not set in environment "staging" …
[end of 1840 bytes]

Upgrading: what changes for you

  • New tools in every OptChat session. chat_search and zoom depth come with memory, like zoom; an enabled session refuses inference if chat_search is not active, as it already did for zoom, date and work.
  • The recall gate is a fifth System One gate, on by default. Opt out with --no-optchat-recall: no chat_recall tool is registered and no judge call is made for it. With all five opt-outs, OptChat is memory-only: 0.5.0's behavior plus chat_search and zoom depth.
  • Why chat_. OMP canonicalizes a tool named search to grep, so it never appears active, and recall is an OMP builtin. The prefix avoids both.
  • Unchanged costs elsewhere. The tool gate never screens chat_search or chat_recall. chat_recall spends judge calls only when the model calls it. The memory guide in the system prompt grows to document both tools, a one-time change to the cached prefix.
  • Failures are explicit. A missing judge makes chat_recall return a tool error; a judge failure or timeout returns [optchat recall] recall failed (…); no answer was found. Use zoom or chat_search. and is shown as the last System One failure in /optchat status. Recall never guesses.

How the tools compare (ticket 10, synthetic)

bun run evidence:retrieval is a new offline, deterministic harness. It builds a real memory over a synthetic 256-message chat with 12 planted facts, using a rule-based summariser that always drops values and drops topics as summaries merge, and a fake judge that scores word overlap. No provider calls, $0.

Strategy Found (seed 1 / seed 2) Agent steps Judge calls Zoom calls Bytes returned
zoom, one level per call 3/12 / 5/12 230 / 193 0 230 / 193 76,575 / 63,251
zoom with depth ≤ 4 3/12 / 5/12 223 / 181 0 223 / 181 101,629 / 92,068
chat_search 12/12 / 12/12 24 / 24 0 12 / 12 8,704 / 8,393
prefetch top-8 3/12 / 5/12 227 / 188 12 235 / 195 79,234 / 64,713
chat_recall 3/12 / 5/12 12 / 12 42 / 37 8 / 8 9,807 / 8,818
beam descent (script) 3/12 / 5/12 12 / 12 42 / 34 39 / 30 3,540 / 2,883

What it shows: every strategy that navigates summaries found only the facts whose topic still appeared in the view. chat_search was the only way to reach the others. When the topic survives, chat_recall gets there in one agent step instead of about 200 zoom calls.

What it does not show: real summary quality, Jev's judgement (the judge here is lexical overlap), the words a real agent would search for, or cost and latency. Treat it as a mechanics check, not a quality or savings claim. Details: .scratch/optchat-jev/issues/10-codemode-retrieval.md.

Verified

  • 1425 tests pass, including tests/search.test.ts (AND terms, case, kind filter, paging, exclusions, child bounds, input limits), tests/recall.test.ts (scoring threshold, descent, ties, missing children, judge failures, timeouts, aborts, call counts, UTF-8 page cuts) and three chat_recall cases through OptChat in tests/system1-e2e.test.ts (planted message reached with its original text, opt-out leaves no tool, a judge failure surfaces in status).
  • The real-host smoke passes and asserts chat_search is registered.
  • The plugin installed from this tag matches the repository byte for byte. Live on OMP 18.9.1 (main anthropic/claude-haiku-5-5, the real judge, print mode, a fresh store, five prompts): chat_search("staging port") returned the planted note (message 0) and the searching prompt itself, which is stored before the tool runs; chat_recall("What is the staging database port?") picked message 0 at p=0.97 and returned its text; and rm -rf build was still blocked by the tool gate ("danger 0.97 is at or above 0.30; no UI to confirm"). The session journaled optchat-rules ×4, optchat-recall, optchat-tool-gate and optchat-value judgments.

Not verified yet

Jev's accuracy on real descents, chat_recall on a long live chat with deep merged lines, and whether agents choose chat_search and chat_recall on their own in real work. These need paired runs with a stated budget.

Also in this release

The README has a new "At a glance" overview with an example view, and the System One section now covers choosing the judge, turning gates off, and what each gate shows. The v0.6.0 release notes were rewritten in the same style.

Install: omp plugin install 'git+https://github.com/ericjuta/omp-optchat.git#v0.7.0'.

v0.6.0

Choose a tag to compare

@ericjuta ericjuta released this 11 Oct 18:53
v0.6.0
a774b2c

OptChat now has a fast second opinion. Four System One gates ask a small typed judge model, reached through OMP's judge role, to keep your standing instructions, pull relevant history into a turn before the model asks for it, tell the compressor what matters, and stop risky tool calls. All four are on by default, and each can be turned off on its own.

Signed tag v0.6.0 (commit a774b2c, with the planning kit in a56de50). CI is green on the pinned (18.9.1) and latest SDK cohorts, the plugin installed from the tag matches the repository byte for byte, and the installed-artifact smoke passes.

Upgrading: what changes for you

  • Behavior change: judge calls are on by default. With the defaults, each user message costs up to two judge requests (rules, then prefetch once the view has merged lines), each long compacted message one, and each screened tool call one, before it runs.
  • Privacy. Enabled gates send the text they judge to the judge role's provider: user messages, view lines, tool names and inputs, and record text for the value hint. Opt out of any gate you do not want.
  • Pick a judge. Set modelRoles.judge in OMP's config.yml (or assign it in /models), for example judge: openrouter/~typesafe/jev-latest. Tiny and chat models also work through OMP's prompted judge. With no credentialed candidate the gates do not run, and OptChat keeps working as before.
  • Opting out. --no-optchat-rules, --no-optchat-prefetch, --no-optchat-value-score, --no-optchat-tool-gate. An opt-out wins over the gate's own flag. With all four, OptChat resolves no judge, registers no tool hook, and its context and /optchat status are the same as 0.5.0. --no-optchat still gives plain OMP.

The gates

Gate What it does Threshold (default)
Standing rules Judges each user message for a lasting instruction ("from now on…", "never…") and stores it in ledger.jsonl beside the chat log, or replaces the rule it overrides. Active rules follow the view in a <rules> block every turn. /optchat rules lists them; /optchat rules remove r1 removes one. --optchat-rule-add (0.8)
Prefetch Scores the view's merged lines against the new message and opens the best ones into a <prefetch> block, so the model starts the turn with the relevant detail. Bounded to 5 s. --optchat-prefetch-k (8), --optchat-prefetch-min (0.5)
Value hint Rates each long message's importance and adds one fixed sentence to its compaction instruction. The sentence never carries record text or ids, and never changes which summaries are built or when. —
Tool gate Screens every tool call except read-only and OptChat's own tools for destructive, deleting, remote and shared effects. At or above the threshold it asks you in an interactive session, and blocks in print or JSON mode. A judge failure blocks. Bounded to 8 s. --optchat-tool-ask (0.3)

Details:

  • Rules keep only your rule. In a message with several sentences, each sentence is rated and only the ones that reach the threshold are stored. "From now on, answer in British English. Also run the tests." stores the first sentence only. Rule ids are never reused.
  • Frozen per turn. The rules and prefetch blocks are decided when the turn starts and reused unchanged across its tool loop, after the view, so the system prompt, tools and view stay cache-stable.
  • Fail open, except the tool gate. A judge failure, timeout or missing judge changes no rule and adds no prefetch block. /optchat status shows the gates, the judge model, the active rule count and the last failure.
  • Shutdown. Queued rule triage gets up to 1.5 s at session_shutdown, under the host's 2 s cap, then is abandoned without writing. In print mode a value hint still in flight is journaled as aborted; that is expected, and the message is retried on the next append.
  • Harnesses measure memory alone. The integration tests, smoke and evidence:recall runner opt their hosts out of the gates.

Verified

  • 1379 tests pass, including new end-to-end gate tests (tests/system1-e2e.test.ts: prefetch ordering, value-hint equality, tool-gate decline and safe-call paths) and a cache test showing the encoded Anthropic system prompt, tools and view text are unchanged when the rules and prefetch blocks follow the view.
  • A 12-turn conversation produced byte-identical context and status against 0.5.0 with every gate opted out.
  • Live, on OMP 18.9.1 with the plugin installed from this tag and the real judge: rm -rf build in print mode was blocked (build/keep survived, one optchat-tool-gate judgment journaled), and a two-sentence message stored only its rule sentence.

Not verified yet

The judge's accuracy beyond those runs, prefetch on a long live chat with a merged view, and the confirm dialog in an interactive session. These are samples, not quality or savings claims.

Also in this release

The OptChat+Jev planning kit now lives in the repository: AGENTS.md, the ExecPlan plans/optchat-jev.md, the design docs/design/optchat-jev.md, GLOSSARY.md, research and eval references under docs/, the Wayfinder draft under .scratch/, and project skills in .omp/skills/. Documentation only.

Install: omp plugin install 'git+https://github.com/ericjuta/omp-optchat.git#v0.6.0'. Full details in the README's "System One gates (Jev)" section and the CHANGELOG.

OptChat v0.5.0

Choose a tag to compare

@ericjuta ericjuta released this 11 Oct 16:31
v0.5.0
bc633ac

Tracks Wayfinder map #9. Signed tag v0.5.0 (commit bc633ac). CI is green on the pinned (18.9.1) and latest SDK cohorts, the installed plugin matches the tag, and the installed-artifact smoke passes against OMP 18.9.1.

Changes

  • Per-worktree memory (behavior change). Inside a git repo, each worktree gets its own store under ~/.omp/agent/optchat-worktrees/<name>-<hash>. Outside git, the global store is still used. --optchat-dir ~/.omp/agent/optchat restores the old single memory. If another session holds the store, OptChat is inactive for that session instead of refusing every prompt.
  • Compressor refusal fallback. A provider refusal is retried once on the main model, with a 30 s bound. If that also fails, OptChat stores a labeled [unsummarized: compressor refused] excerpt so memory keeps settling.
  • Crash durability (#11). A real-process kill matrix covers 27 write stages: no acknowledged record was lost. HTML export is now atomic.
  • Orphan GC (#12). Unreferenced image blobs and abandoned staging files are reclaimed at open.
  • Benchmark (#10, #13). Paired on/off arms, compressor comparison, adversarial and long corpora, a subagent-memory experiment, and a hard dollar cap.
  • Upstream (#14). Host API proposals posted, including can1357/oh-my-pi#15365.

Measured (Sonnet 5.5 main, Haiku 5.5 compressor; samples, not savings claims)

Setting OptChat Plain OMP
History fits context (n=3) 24/24 correct; $0.45–0.52 per run 24/24 correct; $0.32 per run
History past a 200k window (n=3) 24/24 correct and quoted; $1.10–1.18 per run 16/24 correct values, 10/24 quoted; $0.05–0.56 per run
Subagent tasks (n=4 each) 4/4 with child view 0/4 blind

Haiku 4.5 as compressor needed 3× the calls (230 shortening retries) at 22× the cost of Haiku 5.5, and did not settle within the run window. Claude 5.x sometimes refuses benign summarization with Refusal (bio); the fallback covers it.

See README "0.5.0 measurements" and CHANGELOG for details.

OptChat v0.4.1

Choose a tag to compare

@ericjuta ericjuta released this 11 Oct 12:31
v0.4.1
012baf7

Fix the evidence credential-routing boundary: parse models.yml, models.yaml, and legacy models.json rather than substring-matching provider names. Selected-provider overrides, escaped or aliased keys, read failures, parse errors, and invalid root/provider-map shapes block before credential copying or host discovery. Diagnostics do not expose configuration contents; unrelated provider settings remain usable.

Verification: 1,042 local tests and typecheck passed; offline CLI boundary smoke and security re-review passed without live provider calls. CI passed on both pinned and latest SDK cohorts. Tagged plugin installed and verified with the real OMP 18.9.0 host and a synthetic provider.

Commit: 012baf7

OptChat v0.1.0

Choose a tag to compare

@ericjuta ericjuta released this 05 Oct 22:18
65f28fc

Initial OptChat OMP plugin release: durable history, binary summary-tree memory, fresh-turn context, zoom/date tools, and import/export. Verified with 405 passing tests, TypeScript checks, and real OMP end-to-end smoke. See README for installation and host limitations.