CodeNomad/dev-docs
Pascal André b937256378
fix(memory): hide the native memory tool while agent memory is disabled (#1479)
Closes #1477

## Why
With agent memory off, `codenomad_memory` was still registered for every
session (subagents included), so every request carried a tool that could
only fail with "Memory is disabled".

## What changes
- The backend writes `server.memoryEnabled` into its memory presence
leases (`{"version":1,"memory":true}` or empty) at startup and on each
server config change (`opencode/memory/preference.ts`), the same
lease-request mechanism as the Design agent.
- The plugin registers its tool transform only while a live lease
requests memory, rereads the request at each presence interval and calls
`ctx.tool.reload()` only on a change. Running sessions gain or lose the
tool within seconds, with no restart.
- The prompt hook stays registered, so disabling memory still clears
stale `codenomad.memory` instructions; execution still rejects disabled
use. Runtimes without `ctx.tool.reload` keep the tool registered.
- The lease request format is shared with Design
(`opencode/lease-request.ts`) and produces identical output.

## Validation
- Server typecheck, `test:help`, and unit tests for the memory plugin,
the preference sync, Design activation and the memory service (37 pass).
- `scripts/test-memory-tool-native.mjs` against a private OpenCode 2.2.7
daemon: the tool is absent while memory is disabled, appears when
enabled, disappears on disable and comes back on re-enable.
- Help updated in all ten locales.
2026-11-12 23:10:25 +01:00
..
AGENT_MEMORY.md fix(memory): hide the native memory tool while agent memory is disabled (#1479) 2026-11-12 23:10:25 +01:00
architecture.md fix(tauri): drain backend output before confirming shutdown 2026-11-12 07:51:11 +01:00
BROWSER_AUTOMATION.md fix(electron): remove global preview GPU readiness heuristic (#1345) 2026-11-10 12:53:02 +01:00
BROWSER_DEVICE_EMULATION.md feat(tauri): embed native WebKit previews on macOS and Linux (#1301) 2026-11-08 23:46:06 +01:00
BROWSER_TESTING.md build(deps): qualify Vite 7 with merged Zod 4 and stable fixture graphs 2026-11-10 15:47:42 +01:00
CACHE_REFRESH_CONVENTIONS.md fix(opencode): prepare cold Location RPCs before one-shot dispatch (#1448) 2026-11-10 16:25:51 +01:00
COMPOSER.md feat(ui): consolidate diagnostics in non-modal output windows (#1467) 2026-11-11 16:24:26 +01:00
DESKTOP_DATA_PROFILES.md feat(tauri): embed native WebKit previews on macOS and Linux (#1301) 2026-11-08 23:46:06 +01:00
FILES_PANEL.md feat(ui): render Mermaid diagrams with Tiny (#1469) 2026-11-11 19:43:26 +01:00
HOTKEYS.md fix(tauri): stop F11 from freezing the Linux app (#1143) 2026-10-25 21:25:16 +01:00
INDEX.md ci: serve release downloads from verified dev-seeded caches (#1390) 2026-11-08 18:03:18 +01:00
MISSIONS.md fix(missions): prevent pointer-driven scrolling and match title case (#1446) 2026-11-10 14:21:26 +01:00
MISSIONS_AUTONOMY.md fix(missions): disconnect Missions from service supervision so Play and Resume always run (#1285) 2026-11-04 00:12:04 +01:00
MISSIONS_NATIVE_CONTRACTS.md feat(missions): GitHub triggers and existing coordinator sessions (#1461) 2026-11-11 10:00:21 +01:00
MISSIONS_NATIVE_SCHEDULE_TRANSPORT.md fix(missions): resolve scheduled wakes from native message records (OpenCode 2.2.6) (#1350) 2026-11-07 22:01:03 +01:00
MISSIONS_RECURRING.md fix(missions): one repository activity criterion across detected forges (#1466) 2026-11-11 18:03:32 +01:00
MISSIONS_RECURRING_QUALIFICATION.md build(deps): migrate bounded application validation to Zod 4 2026-11-10 15:27:00 +01:00
NATIVE_INTERRUPTION_UX.md fix(worktrees): keep checkouts lacking the opened nested folder out of recovery (#1299) 2026-11-06 01:35:49 +01:00
OPENCODE_COMPATIBILITY.md fix(memory): hide the native memory tool while agent memory is disabled (#1479) 2026-11-12 23:10:25 +01:00
OPENCODE_INTEGRATIONS.md fix(opencode): prepare cold Location RPCs before one-shot dispatch (#1448) 2026-11-10 16:25:51 +01:00
OPENCODE_RUNTIME_SETUP.md feat(ui): consolidate diagnostics in non-modal output windows (#1467) 2026-11-11 16:24:26 +01:00
PALETTE_SOURCES.md docs(agents): keep AGENTS.md to universal rules and agent docs to the current state (#1082) 2026-10-21 16:59:43 +02:00
PANEL_EXTENSIONS.md fix(missions): one repository activity criterion across detected forges (#1466) 2026-11-11 18:03:32 +01:00
PLUGIN_CONTROLS.md chore(pruning): remove the unused TUI companion plugin (#1316) 2026-11-06 16:21:00 +01:00
PROJECTS.md feat(memory): add opt-in persistent agent memory (#1313) 2026-11-06 15:29:24 +01:00
PROVIDER_ACCOUNTS.md fix(usage): count free requests from Console against an 800 reference (#1439) 2026-11-10 12:36:32 +01:00
REMOTE_CONTROL.md fix(server): align direct listener access checks (#1412) 2026-11-10 11:08:52 +01:00
RUNTIME_MAINTENANCE.md ci: serve release downloads from verified dev-seeded caches (#1390) 2026-11-08 18:03:18 +01:00
SESSION_ENVIRONMENT.md feat(missions): resume recurring Missions after OpenCode restarts with native schedules (#1259) 2026-11-01 14:40:24 +01:00
SESSION_HISTORY_NAVIGATION.md fix(transcript): hold the top after an immediate jump to the first message (#1302) 2026-11-05 21:14:21 +01:00
SESSION_HISTORY_QUERIES.md fix(missions): resolve scheduled wakes from native message records (OpenCode 2.2.6) (#1350) 2026-11-07 22:01:03 +01:00
SESSION_PRUNING_RPC.md fix(plugins): isolate readiness capacity from historical backend leases (#1453) 2026-11-10 18:55:18 +01:00
SESSION_PRUNING_SAFETY.md fix(storage): support native split assistant parts across history and pruning (#1359) 2026-11-07 15:34:22 +01:00
SESSION_RECOVERY.md fix(sessions): restore the collapsed parent chevron (#1292) 2026-11-04 19:01:41 +01:00
SETTINGS.md feat(ui): consolidate diagnostics in non-modal output windows (#1467) 2026-11-11 16:24:26 +01:00
solidjs-llms.txt update blank session cleanup code for now session store logic 2025-11-27 20:18:22 -05:00
TAURI_UPDATER.md fix(tauri): drain backend output before confirming shutdown 2026-11-12 07:51:11 +01:00
TEXT_DISPLAY_BOUNDS.md fix(transcript): keep streaming reasoning rendering past the display bound (#1106) 2026-10-23 11:48:13 +02:00
TRANSCRIPT.md feat(ui): render Mermaid diagrams with Tiny (#1469) 2026-11-11 19:43:26 +01:00
UI_CONVENTIONS.md feat(ui): consolidate diagnostics in non-modal output windows (#1467) 2026-11-11 16:24:26 +01:00
UI_SHELL.md feat(ui): consolidate diagnostics in non-modal output windows (#1467) 2026-11-11 16:24:26 +01:00
USER_HELP.md feat(help): open localized guide sections from contextual info icons (#1404) 2026-11-09 00:22:03 +01:00
WORKTREE_SESSION_PLACEMENT.md fix(missions): apply Missions profile preferences to agent preparations 2026-11-09 05:16:03 +01:00