OpenCode desktop sessions now resolve from desktop env markers
(`OPENCODE_CLIENT=desktop`, `OPENCODE_TERMINAL=1`) instead of falling
through to `~/.claude/` and being misclassified as Claude Code.
Verified upstream against sst/opencode:
- packages/desktop/src/main/server.ts:64 sets OPENCODE_CLIENT=desktop
- packages/opencode/src/pty/index.ts:191 sets OPENCODE_TERMINAL=1
Also threads CONTEXT_MODE_PLATFORM into the doctor child spawned by
`upgrade()` so the verification step does not rediscover Claude Code
after upgrade() has already resolved OpenCode.
Adapter parity preserved across detect.ts, hooks/core/platform-detect.mjs,
and scripts/ctx-debug.sh. Fork-before-parent ordering (kilo > opencode)
intact.
Tests: tests/adapters/detect.test.ts (+2 desktop env tests),
tests/adapters/detect-config-dir.test.ts (+1 OPENCODE_CLIENT test),
tests/util/ctx-upgrade-platform-threading.test.ts (+1 threading test).
107 tests pass locally.
Co-authored-by: Michael <mlalpho@users.noreply.github.com>
* Fix Windows path compatibility in ctx-debug.sh
* Fix NODE_PATH MSYS2→Windows conversion in ctx-debug.sh
NODE_PATH was set to an MSYS2-style path (/d/Coding/...) that native
Node.js could not resolve, causing all better-sqlite3 and server
resolution checks to fail silently. Added PLUGIN_ROOT to the Windows
path bridge block so its cygpath -m conversion feeds NODE_PATH.
Rejected: hardcode PLUGIN_ROOT to Windows path | brittle, breaks
portable runs
Rejected: remove NODE_PATH override entirely | would break non-local
node_module resolution in adapters
Rejected: delay NODE_PATH export until after path bridge | same end
result, less visible
Constraint: Git Bash's /d/ paths are invisible to native Windows Node.js
Constraint: Node.js on Windows silently treats unknown paths in
NODE_PATH as no-ops — no error, just module not found
Confidence: high
Scope-risk: narrow
Directive: Any future MSYS2 path stored in a variable and passed to
node must be cygpath -m converted first.
Directive: NODE_PATH export happens before the bridge block — the
bridge re-exports it with the converted PLUGIN_ROOT value.
Tested: diagnostic now passes 27/30 (was 22/30), stderr clean
* Remove accidentally committed pnpm-lock.yaml
pnpm-lock.yaml was auto-generated by pnpm install during debugging
and committed by accident in a32bd37. The project uses npm, not
pnpm — this file is irrelevant and should not be tracked.
* Fix comment
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Fix indentation
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Mert Köseoğlu <bm.ksglu@gmail.com>
- mysql/redis/https patterns had \3 but only 2 capture groups → \2
- Session DB count: use wc -l instead of grep -c (avoid multiline parse)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Redaction: add postgres/mongodb/mysql/redis/https connection string patterns
(was leaking Supabase passwords in Cursor mcp.json)
- CWD: use git root instead of pwd for project-level config detection
- Adapter detection: scan config dirs (~/.claude, ~/.cursor, etc.) in addition
to env vars — script now works from terminal outside a session
- Process check: exclude context-mode-dashboard, esbuild, wrangler, workerd
- Hook registration: verify PreToolUse/PostToolUse/PreCompact/SessionStart
are all registered (not just file existence)
- Session DBs: check all adapter session dirs, not just ~/.claude/
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>