You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to the cherry-picked PR #92 (toast_duration_ms, by Csaba Kertesz):
- toast_duration_ms now accepts 0 = disable Magic Context toasts entirely
(schema min 1000 → 0). showToast() skips when the effective duration is
non-positive, so a config of 0 suppresses routine toasts while explicit
positive per-call overrides (e.g. restart-required) still show. Both TUI
toast routes (direct + server-pushed drain) funnel through showToast, so the
one gate covers both. Regenerated assets/magic-context.schema.json + the docs
config reference; updated CONFIGURATION.md.
- Replaced PR #92's module-level `mock.module("../../hooks/magic-context")` in
create-session-hooks.test.ts — Bun's mock.module is process-global and
mock.restore() does not undo it, so it leaked into hook.test.ts and failed 12
of its hook-shape assertions in the full suite (the file passed alone). Fixed
by extracting the pure buildMagicContextHookConfig() mapping and testing that
directly — no mock, no leak (also a cleaner unit, portable to the future Rust
MC module). +1 toast=0 passthrough test.
- README: added Docs (docs.cortexkit.io/magic-context) and Configuration links
to the nav row, and pointed the Configuration section at both CONFIGURATION.md
and the docs-site configuration reference.
Gate: plugin 2240/0, schema/config-parity green, dashboard config-parity 10/0.
Co-authored-by: Alfonso [Magic Context] <288211368+alfonso-magic-context@users.noreply.github.com>
Copy file name to clipboardExpand all lines: CONFIGURATION.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ Higher-tier models with longer cache windows benefit from a longer TTL. Setting
113
113
|`ctx_reduce_enabled`|`boolean`|`true`| When `false`, hides `ctx_reduce` tool, disables all nudges/reminders, and strips reduction guidance from prompts. Heuristic cleanup, compartments, memory, and search still work. Useful for testing whether automatic cleanup alone is sufficient. |
114
114
|`cache_ttl`|`string` or `object`|`"5m"`| Time after a response before applying pending ops. String or per-model map. |
115
115
|`protected_tags`|`number` (1–100) |`20`| Last N active tags immune from immediate dropping. |
116
-
|`toast_duration_ms`|`number` (1000–60000) |`5000`| TUI toast lifetime for Magic Context notifications in milliseconds. Increase this if toasts disappear too quickly. |
116
+
|`toast_duration_ms`|`number` (0–60000) |`5000`| TUI toast lifetime for Magic Context notifications in milliseconds. Increase this if toasts disappear too quickly, or set to `0` to disable Magic Context toasts entirely. |
117
117
|`execute_threshold_percentage`|`number` (20–80) or `object`|`65`| Context usage that forces queued ops to execute. Capped at 80% max for cache safety. Supports per-model map. |
118
118
|`execute_threshold_tokens`|`object` (per-model map) | — |**Optional absolute-tokens variant of `execute_threshold_percentage`.** Per-model map (e.g. `{ "default": 150000, "github-copilot/gpt-5.2-codex": 40000 }`). When set for a model, overrides the percentage-based threshold for that model. Clamped to `80% × context_limit` with a warn log. Requires a resolvable context limit — falls through to percentage if unavailable. See below. |
119
119
|`clear_reasoning_age`|`number`|`50`| Clear thinking/reasoning blocks older than N tags. |
@@ -239,7 +241,7 @@ It reads directly from Magic Context's SQLite database. No extra server, no API.
239
241
240
242
## Configuration
241
243
242
-
Settings live in `magic-context.jsonc`. Everything has sensible defaults; project config merges on top of user-wide settings. See **[CONFIGURATION.md](./CONFIGURATION.md)** for the full reference: cache TTL tuning, per-model execute thresholds, historian and dreamer model selection, embedding providers, and memory settings.
244
+
Settings live in `magic-context.jsonc`. Everything has sensible defaults; project config merges on top of user-wide settings. For the full reference — cache TTL tuning, per-model execute thresholds, historian and dreamer model selection, embedding providers, and memory settings — see **[CONFIGURATION.md](./CONFIGURATION.md)** or the **[configuration reference on docs.cortexkit.io](https://docs.cortexkit.io/magic-context/reference/configuration/)**.
243
245
244
246
**Config locations** (merged in order, project overrides user):
Copy file name to clipboardExpand all lines: assets/magic-context.schema.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -478,9 +478,9 @@
478
478
},
479
479
"toast_duration_ms": {
480
480
"default": 5000,
481
-
"description": "TUI toast lifetime in milliseconds for Magic Context notifications(min: 1000, max: 60000, default: 5000)",
481
+
"description": "TUI toast lifetime in milliseconds for Magic Context notifications. Set to 0 to disable Magic Context toasts entirely (min: 0, max: 60000, default: 5000)",
Copy file name to clipboardExpand all lines: packages/docs/src/content/docs/reference/configuration.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -192,3 +192,9 @@ Behavior tuning most installs never need to touch.
192
192
|`sqlite`| object | — | SQLite connection tuning for Magic Context's own context.db. These are per-connection PRAGMAs applied at open; they do not change the schema or what is stored. |
193
193
|`sqlite.cache_size_mb`| number (2–2048) |`64`| Page-cache size in MiB per connection (PRAGMA cache_size). Larger keeps more hot pages resident, cutting re-reads on repeated full-table scans. (min 2, max 2048, default 64) |
194
194
|`sqlite.mmap_size_mb`| number (0–8192) |`0`| Memory-mapped I/O size in MiB (PRAGMA mmap_size). 0 disables mmap (SQLite default). Raising it can cut read overhead on large DBs at the cost of address space. (min 0, max 8192, default 0) |
195
+
196
+
## Other
197
+
198
+
| Key | Type | Default | Description |
199
+
|---|---|---|---|
200
+
|`toast_duration_ms`| number (0–60000) |`5000`| TUI toast lifetime in milliseconds for Magic Context notifications. Set to 0 to disable Magic Context toasts entirely (min: 0, max: 60000, default: 5000) |
Copy file name to clipboardExpand all lines: packages/plugin/src/config/schema/magic-context.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -392,11 +392,11 @@ export const MagicContextConfigSchema = z
392
392
),
393
393
toast_duration_ms: z
394
394
.number()
395
-
.min(1_000)
395
+
.min(0)
396
396
.max(60_000)
397
397
.default(5_000)
398
398
.describe(
399
-
"TUI toast lifetime in milliseconds for Magic Context notifications(min: 1000, max: 60000, default: 5000)",
399
+
"TUI toast lifetime in milliseconds for Magic Context notifications. Set to 0 to disable Magic Context toasts entirely (min: 0, max: 60000, default: 5000)",
0 commit comments