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
{{ message }}
This repository was archived by the owner on Jul 13, 2026. It is now read-only.
feat: MAGIC_CONTEXT_LOG_PATH env override for the diagnostic log (cortexkit#183)
Let users redirect the diagnostic log away from the harness temp-dir default,
which matters in sandboxed/ephemeral setups (Docker, CI) where TMPDIR is
disposable or the plugin and dashboard need to agree on a shared path. The
override is read at the single chokepoint getMagicContextLogPath (TS) and its
Rust mirror resolve_log_path_for, so both the plugin logger and the dashboard
log tail honor it; blank/whitespace is treated as unset. Docs updated in three
places.
Reimplemented from @kecsap's PR cortexkit#183 onto current master (the PR branch
predated the v0.30.2 WebSocket migration and carried a large stale revert).
Co-authored-by: kecsap <kecsap@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.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
@@ -280,7 +280,7 @@ Magic Context also writes to a few other locations:
280
280
|---|---|---|
281
281
|`~/.local/share/cortexkit/magic-context/context.db`| SQLite database — tags, compartments, memories, all durable state (XDG-equivalent on Windows) |**Must persist.** Losing it loses your memory/history. |
282
282
|`~/.local/share/cortexkit/magic-context/models/`| Local embedding model cache (~90 MB `Xenova/all-MiniLM-L6-v2` ONNX), downloaded on first use when local embeddings are enabled | Should persist, else re-downloaded each run. Not used when `memory.enabled: false` or an `openai_compatible`/`ollama` embedding backend is configured. |
283
-
|`${TMPDIR}/opencode/magic-context/magic-context.log` (`pi/` for Pi) | Diagnostic log | Disposable. |
283
+
|`$MAGIC_CONTEXT_LOG_PATH` (default: `${TMPDIR}/opencode/magic-context/magic-context.log`, `pi/` for Pi) | Diagnostic log. Set `MAGIC_CONTEXT_LOG_PATH` to redirect it (e.g. to a persistent path in a container).| Disposable. |
284
284
285
285
**Sandboxed / ephemeral environments (Docker, CI, disposable containers):** mount the `~/.local/share/cortexkit/magic-context/` directory on a persistent volume so the database and model cache survive between runs. If only the model cache is ephemeral, the model is simply re-downloaded; if the database is ephemeral, memory and history don't accumulate. To avoid the ~90 MB model download entirely, set `memory.enabled: false` or point `embedding` at a remote `openai_compatible`/`ollama` backend.
-**Logs**: `${TMPDIR}/opencode/magic-context/magic-context.log` (`pi/` for Pi)
74
+
-**Logs**: `$MAGIC_CONTEXT_LOG_PATH` (default: `${TMPDIR}/opencode/magic-context/magic-context.log`, `pi/` for Pi)
75
75
76
76
Database access uses WAL mode for safe concurrent reads while the plugin writes. Write operations (memory edits, dream queue entries) use `busy_timeout` to handle contention.
Copy file name to clipboardExpand all lines: packages/docs/src/content/docs/reference/dashboard.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
@@ -148,4 +148,4 @@ Use [Configuration](/reference/configuration/) for the full generated key refere
148
148
149
149
## Logs
150
150
151
-
Optional **log tail** for `magic-context.log` with filtering, useful alongside Cache when correlating busts with plugin log lines.
151
+
Optional **log tail** for `magic-context.log` with filtering, useful alongside Cache when correlating busts with plugin log lines. The log path defaults to `${TMPDIR}/opencode/magic-context/magic-context.log` (`pi/` for Pi); set the `MAGIC_CONTEXT_LOG_PATH` environment variable to redirect it.
0 commit comments