github mksglu/context-mode v1.0.56

latest release: v1.0.57
6 hours ago

v1.0.56

48 files changed, +908 / −3,121 lines — a cleanup-heavy release that removes dead code, hardens the sandbox, and fixes real bugs reported by the community.

Bug Fixes

  • fix: shell TMPDIR pointed to project rootos.tmpdir() reads the TMPDIR env var, which some shells set to the project root. Shell commands wrote temp/cache dirs (node-compile-cache/, nx-native-file-cache-*/, tsx-*/) into the working tree. Now resolves the real OS temp dir via getconf DARWIN_USER_TEMP_DIR (macOS) / mktemp (Linux) / TEMP (Windows). Based on PR #209 by @vytautas-petrikas.

  • fix: ctx_execute used as file-writing bypass — When users deny Bash(python:*), the routing block's guidance pushed the model toward ctx_execute(python, "Path(...).write_text(...)"), bypassing the deny rule. Added <file_writing_policy> block to the routing template, strengthened <forbidden_actions> and <artifact_policy>. Based on PR #202 by @shauneccles. Closes #201.

  • fix(opencode): remove stale AGENTS.md auto-write — The OpenCode plugin was writing AGENTS.md to the project root on every startup, contradicting docs that said "no routing file is written". Routing enforcement happens via tool.execute.before/tool.execute.after hooks — the file write was redundant and dirtied project trees. Based on PR #196 by @rich-jojo. Closes #195.

  • fix(claude-code): skip settings.json hook registration when plugin hooks.json exists — Prevents duplicate hook entries when the plugin already provides its own hook configuration. (#211)

  • fix: auto-rebuild better-sqlite3 when native binary missing — Detects ABI mismatch at startup and triggers automatic rebuild instead of crashing with MODULE_NOT_FOUND. Closes #206.

  • fix: remove CONTEXT_MODE_NODE env var — Auto ABI compatibility is now sufficient; the manual override was unnecessary complexity. (#203)

Features

  • feat(opencode): JSONC config support — OpenCode/KiloCode configs can now contain comments (//, /* */) and trailing commas, parsed without external dependencies. Based on PR #205 by @FloSchl8.

  • feat: CONTEXT_MODE_NODE env var for custom Node.js path — Allows overriding the Node.js binary used by hook scripts (later removed in favor of auto ABI detection). (#214)

Refactoring

  • refactor: remove writeRoutingInstructions from all adapters — Removed the writeRoutingInstructions method, getRoutingInstructionsConfig, and RoutingInstructionsConfig type from the HookAdapter interface and all 11 adapter implementations. Removed call sites in opencode-plugin.ts, openclaw-plugin.ts, and server.ts. Users who want routing awareness can manually copy the template: cp node_modules/context-mode/configs/opencode/AGENTS.md AGENTS.md. Closes #195, #207.

  • refactor: auto ABI protection for hooks via ensure-deps.mjs — Hooks now auto-detect and rebuild native binaries when the Node.js ABI version changes, eliminating manual rebuild steps. (#215)

  • refactor: remove smartTruncate and maxOutputBytes completely — Large executor outputs are now auto-indexed into FTS5 instead of being truncated. This simplifies the executor and improves data preservation.

Documentation

  • README: Updated OpenCode/KiloCode install sections with optional AGENTS.md copy step and config file links.
  • Continuity table: OpenCode correctly listed as "High" (not "Full") — SessionStart not yet available.

Tests

  • Added ensure-deps native binary detection tests (#206)
  • Added routing block content tests for <file_writing_policy> (3 tests)
  • Added shell TMPDIR sandbox verification tests (2 tests)
  • Added OpenCode JSONC config parsing tests
  • Added Claude Code plugin hook detection tests
  • Removed obsolete writeRoutingInstructions test suites (−220 lines)

Contributors

Thanks to the community contributors who reported issues and submitted PRs:


Full changelog: v1.0.54...v1.0.56

Don't miss a new context-mode release

NewReleases is sending notifications on new releases.