10 Commits
Author SHA1 Message Date
Jefferson Santos b70498a70a feat(pi): fix adapter routing, MCP bridge, startup diet, and pricing (#741) 2026-05-31 16:30:58 +03:00
Michael e63271b212 fix(opencode): detect desktop sessions via OPENCODE_CLIENT/OPENCODE_TERMINAL (#581)
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>
2026-05-15 10:03:21 +03:00
a510c37eca Fix Windows path compatibility in ctx-debug.sh (#553)
* 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>
2026-05-13 18:12:56 +03:00
Mert KoseogluandClaude Opus 4.6 6c4dd7a939 docs: pin Codex ≤0.116.0 for exec-mode MCP, add version check to debug script
- README + platform-support.md: document exec-mode regression (v0.118.0),
  pin workaround, link to openai/codex#16685
- ctx-debug.sh: detect Codex CLI version, warn if ≥0.118.0
- Issue #45: murataslan1 promoted to QA Lead (Codex CLI), added Known
  Platform Issues table, added k1lgor (Windows)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 19:50:46 +03:00
Mert KoseogluandClaude Opus 4.6 e5002c08c6 refactor(debug): JSON-only output, no markdown file
- Output is now a single JSON file at /tmp/ctx-debug-<ts>.json
- JSONL accumulator replaces markdown generation (check/kv/warn/detail → JSONL)
- Config file contents properly JSON-escaped via node (was broken tr pipe)
- Terminal shows only: pass/fail summary + JSON path + copy hint
- Converted remaining printf checks to check()/warn() calls
- No flags needed — runs all 18 sections by default

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 19:00:44 +03:00
Mert KoseogluandClaude Opus 4.6 bc219da04f fix(debug): fix 6 failing sections in ctx-debug.sh v2
- Set NODE_PATH to plugin node_modules (require('better-sqlite3') now works)
- Set CLAUDE_PLUGIN_ROOT for hook execution tests
- Replace server import with dep resolution (import starts MCP transport, hangs)
- Fix grep -c integer parse: tr -d whitespace, fallback defaults
- Replace bare timeout with timed() helper (macOS gtimeout fallback)
- Fix WARN_N grep pattern (unicode emoji → text patterns)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 17:59:29 +03:00
Mert KoseogluandClaude Opus 4.6 949e0b849f feat(debug): ctx-debug.sh v2 — 18 sections, temp file output, JSON
Major DX overhaul:
- No flags — runs all 18 sections automatically
- Output goes to temp files (/tmp/ctx-debug-<ts>.md + .json)
- Terminal shows compact summary: pass/fail counts + failed items only
- Copy hint per platform (pbcopy/xclip/clip)

New sections (65% → 90% issue coverage):
- Section 13: Hook execution — PreToolUse deny/passthrough, SessionStart routing
- Section 14: MCP server startup — module import test
- Section 15: SQLite concurrency — WAL mode, orphaned journals, concurrent writes
- Section 16: Adapter validation — detectPlatform + validateHooks + checkPluginRegistration
- Section 17: Sandbox environment — env denylist, CA certs, TMPDIR writable
- Section 18: Network/TLS — HTTPS connectivity, proxy detection, Snap confinement, disk space

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 17:53:39 +03:00
Mert KoseogluandClaude Opus 4.6 9dd788e583 fix(debug): fix BSD sed backreference + integer parse on macOS
- 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>
2026-04-03 17:40:07 +03:00
Mert KoseogluandClaude Opus 4.6 04182a3f88 fix(debug): fix 6 critical issues in ctx-debug.sh
- 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>
2026-04-03 17:35:56 +03:00
Mert KoseogluandClaude Opus 4.6 4eba5aaf0a feat: add cross-platform debug script + update issue/PR templates
- Add scripts/ctx-debug.sh: 609-line diagnostic script covering 12 sections
  (system info, runtimes, better-sqlite3 ABI, adapter detection, config files
  for all 12 adapters with redaction, hook validation with stale path detection,
  FTS5 test, executor test, process check, session DBs, env vars)
- Update bug_report.yml: require debug script output, 12 adapter dropdown,
  9 OS options (Apple Silicon/Intel, Ubuntu/Debian/Fedora/Arch, Git Bash/WSL/PowerShell)
- Add feature_request.yml: new feature request template
- Update PULL_REQUEST_TEMPLATE.md: 112 → 47 lines, all 12 adapters, Windows path notes
- Update CONTRIBUTING.md: reference debug script, fix stale slash command names
- Update README.md: add debug script to utility commands
- Fix #223: include stderr in doctor server test FAIL output

Based on analysis of 90 issues + 100 PRs by 20 parallel agents.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 17:29:20 +03:00