* Refactor: shared server package with PLANNOTATOR_REMOTE env var - Create packages/server/ with shared server implementation - Add PLANNOTATOR_REMOTE=1 env var for devcontainer/SSH mode - Deprecate SSH_CONNECTION detection (still works with warning) - Both Claude Code and OpenCode now use identical server logic - OpenCode gains Obsidian/Bear integrations and remote detection - Update documentation with environment variables section Fixes #27 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Remove PLANNOTATOR_ORIGIN env var, fix onReady callback timing - Remove PLANNOTATOR_ORIGIN hack from Claude Code hook (hardcode "claude-code") - Fix onReady callback to pass port directly (was referencing undefined server) - Create tests/manual/test-server.ts for testing either origin - Update test-hook-2.sh to use new test server with opencode origin 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add devcontainer test setup, reduce logging verbosity - Add tests/devcontainer/ with devcontainer.json for testing remote mode - Add tests/opencode-local/ for local OpenCode testing - Update package.json build script for proper bundling - Remove verbose multi-line error messages, keep useful errors - Clean up unused deprecationWarned variable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add devcontainer support and documentation - Add PLANNOTATOR_REMOTE env var for container/remote detection - Remove console logging (silent operation) - Add devcontainer.md with full setup instructions - Add devcontainer section to OpenCode plugin README - Add port-only test setup to reproduce common misconfiguration - Update test devcontainers to forward port 4096 for opencode web - Bump version to 0.4.1 Fixes #27 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Update CLAUDE.md: legacy SSH detection, not deprecated Removed incorrect mention of deprecation warning - SSH_TTY/SSH_CONNECTION detection is silent by design. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix OpenCode agent switching after plan approval After approving a plan, the conversation context stayed in "plan" mode even though the TUI showed "build". This caused edits to fail because the plan agent has edit permissions denied. The fix uses session.prompt() to inject a message with agent: "build", which triggers a new agentic loop with proper build agent permissions. Fixes #29 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Plannotator Devcontainer Test
This directory contains a devcontainer setup for testing Plannotator with OpenCode in a containerized environment.
Prerequisites
- Docker installed and running
- VS Code with Dev Containers extension
- OpenCode auth configured on your host machine (
~/.local/share/opencode/auth.json)
Setup
-
Create auth symlink (one-time setup on host):
mkdir -p .opencode ln ~/.local/share/opencode/auth.json .opencode/auth.json -
Open in VS Code:
code tests/devcontainer -
Reopen in Container: When prompted, click "Reopen in Container" or use Command Palette:
Dev Containers: Reopen in Container
Testing Plannotator
The devcontainer is pre-configured with:
PLANNOTATOR_REMOTE=1- enables remote modePLANNOTATOR_PORT=9999- fixed port for the UI- Port 9999 forwarded to host
Test Steps
-
Inside the container terminal, run OpenCode:
opencodeOr for web interface:
opencode webThen access http://localhost:4096 in your browser.
-
Ask OpenCode to create a plan (e.g., "Create a plan to add user authentication")
-
When OpenCode calls
submit_plan, Plannotator should:- Start server on port 9999 (not random)
- Not try to open browser (remote mode)
-
Open
http://localhost:9999in your host browser -
Approve or deny the plan
Expected Behavior
Before fix (v0.4.0): Plugin hangs trying to open browser, random port unusable
After fix:
- Server uses fixed port 9999
- No browser open attempt
- Works via port forwarding
Troubleshooting
Plugin not updating?
rm -rf ~/.cache/opencode/node_modules/@plannotator
OpenCode crashes/aborts on startup?
rm -rf ~/.cache/opencode
Port not forwarding? Check VS Code "Ports" tab, ensure 9999 is listed and forwarded.
Auth issues?
Ensure .opencode/auth.json exists and contains valid credentials.