Skip to content

Latest commit

 

History

History
123 lines (89 loc) · 5.9 KB

File metadata and controls

123 lines (89 loc) · 5.9 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

This project is a fork of 13rac1/openclaw-plugin-claude-code. Versions 1.x.x are from the upstream project. Version 2.0.0 marks the fork divergence.

2.0.0 - 2026-03-17

Breaking Changes

This is a full architectural rewrite replacing Claude Code with OpenCode. The tool interface (6 tools, same parameter shapes) is preserved, but tool names and internal behavior have changed.

  • Tool names renamed: claude_code_* -> opencode_*
  • Authentication changed: No longer uses ~/.claude/.credentials.json or ANTHROPIC_API_KEY. Requires opencode auth login which stores credentials at ~/.local/share/opencode/auth.json.
  • Config field renamed: startupTimeout -> serverReadyTimeout
  • Sessions directory default: ~/.openclaw/claude-sessions -> ~/.openclaw/opencode-sessions
  • Plugin ID changed: claude-code -> opencode
  • Package renamed: @13rac1/openclaw-plugin-claude-code -> @13rac1/openclaw-plugin-opencode
  • Webhook session key prefix: hook:claude-code: -> hook:opencode:

Added

  • OpenCode SDK integration: Communicates with OpenCode via HTTP API (@opencode-ai/sdk) instead of parsing CLI stdout
  • Provider-agnostic: Works with any of 75+ LLM providers OpenCode supports (Anthropic, OpenAI, Google, Groq, local models, etc.)
  • Long-lived server containers: One OpenCode server per session, reused across multiple jobs (no cold-start on subsequent jobs)
  • Dynamic port mapping: podman run -p 0:4096 with automatic port readback via podman port
  • Server health checks: GET /global/health with exponential backoff before sending first prompt
  • Smart orphan recovery: Reconnects to orphaned but healthy servers by reading their port mappings, instead of killing them
  • Session-level server port tracking: serverPort field in session state for server reuse
  • New opencode-client.ts module: waitForServerReady, createContainerClient, createSession, sendPrompt, abortSession, checkHealth, getSessionMessages
  • Baked-in opencode.json config in Dockerfile with "permission": "allow" for headless use

Changed

  • Container image: Installs opencode-ai instead of @anthropic-ai/claude-code
  • Container user: claude (UID 1000) -> opencode (UID 1000)
  • Container entrypoint: opencode serve --port 4096 --hostname 0.0.0.0 instead of bash -c 'claude -p "..." --output-format stream-json'
  • Container prefix: claude- -> opencode-
  • Volume mounts: ~/.claude replaced by ~/.config/opencode and ~/.local/share/opencode
  • updateSession() now takes an object { opencodeSessionId?, serverPort? } instead of a single string
  • Cancel tool: attempts API abort before killing container

Removed

  • Stream-json stdout parser (stream-parser.ts) — replaced by SDK-based HTTP client
  • Claude Code CLI invocation and --dangerously-skip-permissions flag
  • ANTHROPIC_API_KEY environment variable support (use opencode auth login instead)
  • OAuth/Claude Max credential file detection
  • Rate limit and auth-expired error detection via stdout regex
  • rate_limit and auth_expired error types

Upstream History (13rac1/openclaw-plugin-claude-code)

1.0.12 - 2026-02-23

Added

  • Inject host git identity into containers via GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL env vars
  • Refuse to start if host git identity (user.name, user.email) is not configured
  • delete_workspaces parameter on claude_code_cleanup for explicit workspace deletion

Fixed

  • claude_code_cleanup no longer destroys workspace data (code, files, git history) — only session metadata is removed by default

1.0.11 - 2026-02-20

Added

  • Detect Claude Code authentication errors (expired OAuth tokens) and report to agent
  • Detect Claude Code rate limit errors and report wait time to agent
  • Real-time streaming output via streamContainerLogs (replaces polling)
  • Job completion notifications via webhook (no polling required)
  • claude_code_sessions tool for listing all active sessions

Fixed

  • Mount host ~/.claude directly so OAuth token refreshes persist across jobs
  • Prevent race condition in concurrent job output streaming
  • Rootless Podman UID mapping with --userns=keep-id:uid=1000,gid=1000

Changed

  • npm test now runs formatter and linter checks before tests
  • Extracted shared formatting utilities (formatDuration, formatBytes)
  • Improved type safety, error handling, and code clarity

1.0.0 - 2026-02-12

Added

  • Initial public release
  • claude_code tool for executing prompts in isolated containers
  • claude_code_cleanup tool for cleaning up idle sessions
  • Session persistence with automatic state tracking
  • Dual authentication support (API key and OAuth/Claude Max)
  • Configurable resource limits (memory, CPU, PIDs)
  • AppArmor profile support for additional security
  • Startup and idle timeout detection
  • Multi-arch container image (arm64, amd64)
  • Comprehensive test suite (unit and integration)

Security

  • Rootless container execution via Podman
  • All Linux capabilities dropped (--cap-drop ALL)
  • tmpfs with noexec for /tmp
  • Configurable network isolation
  • Optional AppArmor MAC enforcement