Skip to content

Commit 3a038a1

Browse files
committed
docs: v0.21.7 release notes + refresh stale CHANGELOG.md
The CHANGELOG.md was stuck on a single '[Unreleased] - v3.3.1' entry using an internal version codename (the public release was v0.17.0, shipped mid-May) with implementation jargon users could not contextualize. Replace it with a thin pointer to the GitHub Releases page (which is the canonical user-facing changelog) plus a per-release-line highlights map that summarizes themes without duplicating the full release notes. Add v0.21.7 release notes covering: - Compressor cross-process safety (GH #91 fix) - Unified disable: true agent off-switch - Startup release announcement dialog - Auto-search filter for ignored plugin-internal messages - TUI execute-threshold display fixes (GH #90) - Migration warning silenced for no-op enabled=true legacy keys Both files target a release; no runtime change.
1 parent 3f47002 commit 3a038a1

2 files changed

Lines changed: 87 additions & 31 deletions

File tree

.alfonso/release-notes/v0.21.7.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# v0.21.7 — Compressor finally fires on busy sessions, cleaner agent disable, startup release announcements
2+
3+
## What's New
4+
5+
- **Startup release announcement.** On the first session after upgrading, Magic Context now shows a short "what's new" dialog in the OpenCode TUI, an ignored startup message on Desktop/web, and a Pi notification — so you don't have to dig through release notes to learn what changed. The dialog is one-shot per version and includes a persistent Discord invite footer below the version-specific bullets.
6+
7+
- **Single, unified off-switch for hidden agents.** Disabling historian, dreamer, or sidekick is now a single field: `disable: true` on the agent block in `magic-context.jsonc`. The legacy `dreamer.enabled` and `sidekick.enabled` fields are gone — they were confusing because `disable: true` and `enabled: false` would have been duplicate inverse meanings of the same intent, and only one (`disable`) actually unregistered the OpenCode agent.
8+
9+
- Manual `/ctx-dream` still works as long as `dreamer.disable` is not `true`. To get the old "scheduled dreaming off, manual dreaming still on" behavior, leave `disable` unset and set `schedule: ""`.
10+
- Existing configs auto-migrate. `dreamer.enabled: false``dreamer.disable: true` (this changes manual `/ctx-dream` from working to disabled — see migration below). `enabled: true` is silently stripped because it was already the default. The dashboard Config Editor renders the new field directly; legacy values are cleaned when you save.
11+
- Running `npx @cortexkit/magic-context@latest doctor --force` rewrites your config on disk to the new shape with comments preserved.
12+
13+
This change unblocks issue #50: previously, having a stray `enabled: true` in your `historian` block triggered a confusing schema error because `historian` never accepted that field.
14+
15+
- **TUI execute-threshold display: shorter, cleaner.** Percentages over 100 (when using token-based thresholds with large windows) and very long fractional formats now round cleanly (`14.099783%``14.1%`) and the sidebar context bar resizes itself to fit narrower terminal widths instead of wrapping. (Fixes GH #90.)
16+
17+
## What's Fixed
18+
19+
- **Compressor no longer underfires on busy sessions.** Per GH #91, with low `execute_threshold_tokens` or low overall context pressure, the compressor could go indefinitely without running even while the compartment block grew far past its budget — because the previous gate suppressed the compressor on the exact cache-busting passes when it was structurally safe to fire. The new design:
20+
21+
- Adds a database-backed cross-process lease (`compartment_state_lease`) that serializes compartment-state mutators across OpenCode instances, Pi instances, and `/ctx-recomp` runs. No more silent overwrites when two harnesses share a project.
22+
- Snapshots cache-busting signals at the start of each transform pass, so a compressor that finishes mid-pass writes its "history needs refresh" signal to the *next* pass's set — preventing the previous race where the same-pass drain would consume the compressor's own signal and make the compressed state invisible until some unrelated future refresh.
23+
- Atomicizes compressor publish — compartment writes, fact writes, depth bumps, and cache invalidation all commit in a single `BEGIN IMMEDIATE` transaction. Holder identity is verified as the first statement inside the transaction, so a stale lease holder can never overwrite a fresh historian publish.
24+
- Removes the old suppression gate entirely. The compressor now fires on the same execute/cache-busting passes that historian fires on, and the lease keeps them safely serialized.
25+
26+
Practical effect: sessions with `execute_threshold_tokens=30000` and low usage that previously accumulated 70+ compartments before any compression now get compressed on the very next execute pass, with no manual `/ctx-flush` needed.
27+
28+
- **Auto-search no longer embeds plugin-internal notification messages.** The startup-announcement message, conflict warnings, "preparing augmentation" notifications, and other `ignored: true` plugin messages were being sent to the embedding provider as if they were real user prompts, wasting embedding throughput and polluting the auto-search budget. The latest-meaningful-user-message detection now uses the canonical helper that filters ignored parts, system reminders, and OMO internal markers — matching how every other part of Magic Context already counted "real" user messages.
29+
30+
- **Migration warnings only fire for meaningful changes.** If your `magic-context.jsonc` had `dreamer.enabled: true` or `sidekick.enabled: true` (the no-op alias for the new default `disable: false`), the unified-disable migration in v0.21.7 initially showed a "config warning" suggesting you had something to fix. That warning is now silent for `enabled: true` (nothing semantically changes — the key is just obsolete) and only fires for `enabled: false`, which is the case where the migration triggers a real behavior change.
31+
32+
- **Pi parity hardening.** Drain-signal correctness, historian parity mirror, and runner/entry anchors received targeted fixes from the 2026-05-20 Pi audit pass, closing the last batch of pre-release Pi-specific findings.
33+
34+
## Upgrade
35+
36+
```bash
37+
npx @cortexkit/magic-context@latest doctor --force
38+
```
39+
40+
The `--force` flag clears OpenCode's cached plugin install so v0.21.7 takes effect on next launch.
41+
42+
### Heads up for users with `dreamer.enabled: false`
43+
44+
The auto-migration rewrites `dreamer.enabled: false` to `dreamer.disable: true`, which **also disables manual `/ctx-dream`** (the old `enabled: false` only stopped scheduled dreaming). If you want scheduling off but manual dreaming on, edit `magic-context.jsonc` after running `doctor`:
45+
46+
```jsonc
47+
"dreamer": {
48+
// remove "disable": true
49+
"schedule": "" // empty schedule = no scheduled runs, manual /ctx-dream still works
50+
}
51+
```
52+
53+
This is the only behavior-changing migration in v0.21.7.

CHANGELOG.md

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,58 @@
11
# Changelog
22

3-
All notable changes to `opencode-magic-context` are documented here.
4-
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
3+
Magic Context ships three npm packages from this repo (`@cortexkit/magic-context`, `@cortexkit/opencode-magic-context`, `@cortexkit/pi-magic-context`) and a Tauri dashboard. All three plugin packages share a single version line and ship together. The dashboard tracks its own `dashboard-vX.Y.Z` tag line.
54

6-
## [Unreleased] — v3.3.1: Tag-Owner Identity Fix
5+
## Source of truth
76

8-
### Fixed
7+
Full per-release notes live in GitHub Releases — that's the canonical, user-facing changelog:
98

10-
- **Tool-call collision bug**: when two assistant turns within a single session reused the same OpenCode-generated tool callID (e.g. both invoked `read:32`), the runtime keyed both invocations to the SAME tag row by `messageId == callId`. Dropping the first turn's tag silently propagated to the second turn's content, corrupting the conversation. The fix adds **composite identity** for tool tags: each row is now uniquely identified by `(session_id, message_id, tool_owner_message_id)` where `tool_owner_message_id` is the assistant message hosting the invocation.
9+
- **Plugin/CLI releases:** https://github.com/cortexkit/magic-context/releases (filtered to `v0.*` tags)
10+
- **Dashboard releases:** same page, filtered to `dashboard-v0.*` tags
1111

12-
This was the bug class behind several user-visible symptoms:
13-
- "My recent search results just disappeared after I edited a file."
14-
- Reasoning preservation reverting on a fresh assistant turn even though no `ctx_reduce` was issued.
15-
- Heuristic dedup silently merging two semantically distinct tool invocations.
12+
This file exists as a quick navigation map. Working drafts that became those release notes are kept under `.alfonso/release-notes/` for reference.
1613

17-
- **Drop queue cross-compartment matching**: `compartment-runner-drop-queue` no longer queues drops for tool tags whose owner lies outside the compartment range. Pre-fix it matched by bare callId, so a callId reused outside the compartment matched an in-compartment tag by string equality and got wrongly dropped.
14+
## Versioning
1815

19-
- **Heuristic dedup cross-owner false positives**: `applyHeuristicCleanup` now keys both the tag-side index AND the fingerprint-side map by composite `(ownerMsgId, callId)`, with the fingerprint VALUE also including ownerMsgId. Cross-owner pairs with same `(toolName, args)` now produce DISTINCT fingerprints and are NOT merged. Within-same-owner duplicates (Pi parallel-tool-calls shape) still group correctly.
16+
This project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). While the public surface is pre-1.0:
2017

21-
- **`message.removed` cleanup cascade**: `deleteTagsByMessageId` now also deletes tool tags whose `tool_owner_message_id` matches the removed message id. Pre-fix, removing an assistant message left its tool tag rows orphaned in the DB.
18+
- `MINOR` bumps (`0.21.0``0.22.0`) carry user-visible feature additions or breaking config migrations.
19+
- `PATCH` bumps (`0.21.6``0.21.7`) carry bug fixes and small enhancements that don't change config shape or break existing setups.
20+
- Migrations that change config shape always ship with an in-memory shim so existing configs keep working until you run `doctor` to rewrite them on disk.
2221

23-
### Added
22+
## Highlights by release line
2423

25-
- **Schema migration v10** (`migrations.ts`): adds `tool_owner_message_id` (`TEXT NULL`) column, partial UNIQUE index `idx_tags_tool_composite`, and partial lookup index `idx_tags_tool_null_owner` to back lazy adoption.
24+
### 0.21.x (current)
2625

27-
- **Layer B backfill** (`tool-owner-backfill.ts`): one-shot lease-based backfill that reads OpenCode's session DB and populates `tool_owner_message_id` on legacy NULL-owner rows. Validated against the user's real 370MB DB (17.86s for 3,284 sessions).
26+
The most recent release line. Notable themes:
2827

29-
- **Tagger composite identity API** (`tagger.ts`):
30-
- `assignToolTag(sessionId, callId, ownerMsgId, ...)` — allocate or reuse a tool tag scoped by composite identity.
31-
- `getToolTag(sessionId, callId, ownerMsgId)` — composite-identity lookup.
32-
- `bindToolTag(sessionId, callId, ownerMsgId, tagNumber)` — recovery binding.
33-
- `assignTag` / `getTag` are narrowed to non-tool types (`message` / `file`) — TS forbids passing `"tool"` to them.
28+
- **0.21.7** — Compressor cross-process safety (fixes GH #91), unified agent disable semantics, startup release announcements, auto-search ignores plugin-internal messages.
29+
- **0.21.6** — Hidden subagent permission lock-down, TUI execute-threshold display, `doctor --issue` 64KB cap.
30+
- **0.21.5** — Pi audit fixes wave 1.
31+
- **0.21.4** — Issue #85 emergency-recovery loop fix, compaction markers graduated from experimental.
32+
- **0.21.2** — Pi reference-identity boundary resolution, Pi subagent spawning.
33+
- **0.21.1** — Pi parity sweep (44 audit findings), Pi multi-turn RPC harness, key-files plan v6 implementation.
34+
- **0.21.0** — Sticky-injection multi-anchor persistence, per-project embedding resolution, project-local historian artifacts.
3435

35-
- **Lazy adoption fallback**: when a transform pass observes a tool call whose composite key has no match in the in-memory map, the tagger queries `getNullOwnerToolTag` for legacy orphans and atomically claims one via `adoptNullOwnerToolTag` (NULL guard ensures first claim wins). This handles unbackfilled NULL-owner rows incrementally.
36+
### 0.20.x
3637

37-
- **End-to-end collision-repro test** (`packages/e2e-tests/tests/tag-owner-collision.test.ts`): drives a real OpenCode + magic-context plugin pair through the bug-class scenario and verifies the schema, indexes, and DB-level invariants hold.
38+
- Boundary-execution v8 (defer execute decisions out of mid-turn passes), short-context overflow recovery, Pi audit fixes batch.
3839

39-
- **Microbenchmark for nearest-prior owner derivation** (`packages/plugin/scripts/benchmark-nearest-prior.ts`): documents plan Test #45's exit criterion (0.0455 ms avg on a 30k-tag session — 10× under the 0.5 ms budget).
40+
### 0.19.x
4041

41-
### Changed
42+
- Deferred compaction-marker movement, JSONC parser resilience, doctor migration framework.
4243

43-
- **Tag-transcript Pi pipeline** (`tag-transcript.ts`): removed the outer `db.transaction()` wrapper. Per-tag SAVEPOINTs inside `assignToolTag` / `assignTag` already provide the atomicity needed; the outer wrapper was a cache-bust amplifier that rolled back ALL tag inserts in a pass on a single late UNIQUE collision while leaving in-memory message mutations and `§N§` prefixes already applied.
44+
### 0.18.x
4445

45-
- **Drop queue API** (`read-session-chunk.ts: getRawSessionTagKeysThrough`): now returns `RawSessionTagKeys` with `messageFileKeys: Set<string>` and `toolObservations: Map<string, Set<string>>` instead of one collapsed `Set<string>`. The split allows tool tags to be matched by composite identity while message/file tags continue using globally-unique content ids.
46+
- OpenCode fallback-chain support, dreamer circuit breaker, structured failure reporting.
4647

47-
### Compatibility
48+
### 0.17.x
4849

49-
- **Pre-v3.3.1 sessions**: rows written before this version have `tool_owner_message_id = NULL`. The Layer B backfill populates them from OpenCode's session DB on plugin upgrade. Sessions for which OpenCode's DB is unavailable (foreign-harness sessions, deleted DB) fall back to lazy adoption — orphans are converted to non-NULL on the next observation. Drop queue and heuristic cleanup gracefully degrade to bare-callId match for unbackfilled rows (plan §Risk #20).
50+
- Tag-owner composite identity overhaul (fixed cross-turn callID collisions corrupting conversation tags), schema migration v10, runtime-detected SQLite backend selector.
5051

51-
- **Cache stability**: composite-key migration deterministically produces the same `§N§` prefix across passes for the same observation. Anthropic prompt-cache prefix stability is preserved on defer passes (verified via existing `cache-stability.test.ts` and the new collision-repro tests).
52+
### 0.16.x
5253

53-
---
54+
- Unified `@cortexkit/magic-context` CLI replacing per-plugin bins, harness adapters for OpenCode and Pi, doctor/setup/migrate flows, Electron `nativeBinding` for OpenCode Desktop.
5455

55-
For prior versions, see git history.
56+
### 0.15.x and earlier
57+
58+
See GitHub Releases. Older lines are kept for archival reference but should not be used — upgrade with `npx @cortexkit/magic-context@latest doctor --force` to refresh OpenCode's cached plugin.

0 commit comments

Comments
 (0)