@khalilgharbaoui/opencode-claude-code-plugin 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khalilgharbaoui/opencode-claude-code-plugin",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "Claude Code CLI provider plugin for opencode",
5
5
  "author": "Khalil Gharbaoui",
6
6
  "type": "module",
@@ -95,7 +95,9 @@ Defaults below describe normal headless opencode use when the key is absent.
95
95
  | `mcpConfig` | string or string[] | unset | Extra `--mcp-config` paths or inline JSON passed alongside the bridged config. |
96
96
  | `strictMcpConfig` | boolean | `false` | Headless `--strict-mcp-config`: use only explicitly supplied MCP configs, ignoring other MCP sources, not all settings/credentials/hooks. The interactive wrapper adds it whenever it passes MCP paths, independently of this option. |
97
97
  | `hotReloadMcp` | boolean | `true` | With bridging on, compare merged MCP config/status at turn start and respawn on drift after pending proxy calls resolve. Keeps the session via headless `--resume`. Does not reload arbitrary provider options or watch explicit `mcpConfig` contents. |
98
- | `proxyOpencodeMcpTools` | boolean | `true` | When bridge and live tool discovery succeed, route discovered MCP tools through opencode's executor. Disabled/unavailable discovery falls back to direct CLI bridging. Do not promise exactly-once side effects across failures/retries or opencode versions; verify routing before using write-capable tools. |
98
+ | `proxyOpencodeMcpTools` | boolean | `true` | Measured inert on opencode 1.18.31: discovery returns no MCP-backed tools (only built-ins and plugin-declared ones) even with servers connected, so nothing is routed and MCP calls reach Claude through the direct bridge instead. Do not tell a user this option gives them opencode permission prompts for MCP tools until it is re-verified on their version. Intended behaviour, when discovery succeeds: route discovered MCP tools through opencode's executor. Disabled/unavailable discovery falls back to direct CLI bridging. Do not promise exactly-once side effects across failures/retries or opencode versions; verify routing before using write-capable tools. |
99
+ | `proxyOpencodeTools` | string[] | `[]` | Forward named opencode tools through the proxy by registry id (`client.tool.list()`, matched case-insensitively). Covers tools another opencode plugin declares directly, which belong to no MCP server and so are invisible to `proxyOpencodeMcpTools`: opencode-dcp's `compress` is the motivating case. Same broker as every other proxy tool, so the same events release the call. Unknown name is skipped with a warning; a name a proxy def already holds is dropped with a warning and the existing tool keeps it. Explicit allowlist only, because a forwarded tool runs in opencode with the calling agent's permissions. |
100
+ | `stripContextReminders` | boolean | `false` | Strip opencode-dcp `<dcp-system-reminder>` blocks from user/assistant message text, including the fresh-session rebuild. Only when no `compress` is proxied via `proxyTools` or `proxyOpencodeTools`; reachable compress makes it inert. Resolved from config, so a configured-but-unregistered name still counts as reachable. Leaves opencode's own `<system-reminder>` blocks alone. |
99
101
  | `multiStepContinuation` | boolean | `true` | Append a system-prompt hint to chain tool calls in one turn instead of stopping between subtasks. |
100
102
  | `autoContinueIncompleteTurns` | boolean or `"smart"` | `"smart"` | `true`/`"smart"` continue a turn truncated at `max_tokens`, bounded by 8 attempts and 10 minutes, and otherwise run the keyword heuristic only when stop reason is missing. Every other stop reason, plus error, abort or latched question, stops it. Current measured CLIs always report a reason, so truncation is the only case that resumes in practice. |
101
103
  | `compactionModel` | string | `"claude-haiku-4-5"` | `/compact` uses a fresh short-lived headless process without the usual bridge/proxy/skill wiring. Nonblank `CLAUDE_CODE_COMPACTION_MODEL` wins. This is inference and can be billed. |
@@ -251,6 +253,29 @@ The proxy's loopback endpoint has bearer, Host, Origin and Content-Type guards.
251
253
  Never weaken them, publish its token or relax the generated MCP file's `0600` mode.
252
254
  Restart all old processes after a security upgrade; changing files cannot patch them.
253
255
 
256
+ ### Let the model satisfy an opencode-dcp compress nudge
257
+
258
+ DCP injects "MAX CONTEXT LIMIT REACHED ... You MUST use the `compress` tool now"
259
+ reminders. DCP declares `compress` directly rather than through an MCP server, so
260
+ automatic MCP routing never offers it and the model cannot obey. Two choices, and
261
+ they are different tools, so choose one rather than both:
262
+
263
+ ```json
264
+ { "proxyOpencodeTools": ["compress"] }
265
+ ```
266
+
267
+ forwards DCP's real tool, which compresses opencode's transcript with DCP's
268
+ strategies. The live `claude` process keeps its own context until it restarts.
269
+
270
+ ```json
271
+ { "proxyTools": ["Bash", "Edit", "Write", "WebFetch", "Task", "Compress"] }
272
+ ```
273
+
274
+ uses this plugin's tool instead, which resets the Claude session and carries a
275
+ summary forward. Setting both leaves this one holding the `compress` name and logs
276
+ `proxyOpencodeTools entry dropped`. If neither is wanted, `stripContextReminders: true`
277
+ removes the reminders the model cannot act on.
278
+
254
279
  ### Proxy tool names
255
280
 
256
281
  Names below become `mcp__opencode_proxy__<name>`; input config is case-insensitive.
@@ -264,7 +289,7 @@ Names below become `mcp__opencode_proxy__<name>`; input config is case-insensiti
264
289
  | `task` | `"Task"`, default; disables CLI Agent and dispatches opencode subagents under its permissions. No proxy deadline by default; a positive `proxyToolTimeoutMs` entry adds one. |
265
290
  | `task_batch` | Included with Task; one MCP call fans out two or more independent task inputs concurrently. Separate task calls were measured serial on CLI 2.1.258. |
266
291
  | `question` | `"Question"`, opt-in; replaces AskUserQuestion only if the live opencode registry has question. Round-trip verified on plugin 0.18.0 / CLI 2.1.258 / opencode 1.18.29, headless and as a real TUI form, with no `permission` block; grant `permission.question` only if a subagent's form is refused. Opt-in because it disables Claude's own AskUserQuestion. |
267
- | `compress` | `"Compress"`, opt-in; in-process summary/reset interceptor, no opencode permission prompt and no built-in replacement. Discards prior CLI detail on a later eligible turn, retaining the summary, not the full transcript. Keep off unless explicitly requested; end-to-end reset remains unverified live. |
292
+ | `compress` | `"Compress"`, opt-in; in-process summary/reset interceptor, no opencode permission prompt and no built-in replacement. Discards prior CLI detail on a later eligible turn, retaining the summary, not the full transcript. Keep off unless explicitly requested. Reset round-trip verified live on CLI 2.1.263 / opencode 1.18.31. Not the same tool as a forwarded opencode `compress` (see `proxyOpencodeTools`): this one resets the Claude session, that one compresses opencode's transcript. Enabling both leaves this one holding the name. |
268
293
 
269
294
  A proxied call is held open until an event ends it, and the plugin listens to the
270
295
  `claude` process, the stream and the control protocol for those events rather than
@@ -279,7 +304,12 @@ inactivity watchdogs (for a process that is alive but silent, which emits nothin
279
304
  listen to; a CLI parked in a proxied call is exempt), and the connection keepalives
280
305
  (SSE comments or JSON whitespace every 15 s, so the CLI's HTTP client does not give up
281
306
  on a long call; they never extend a deadline). Do not present a raised deadline as the
282
- fix for a long subagent; the default already waits for it.
307
+ fix for a long subagent; the default already waits for it. A deadline-free call is not
308
+ silent while it waits: it logs `proxy call still waiting, no deadline` at WARN after
309
+ five minutes and every five minutes after, with tool, call id and elapsed time. That
310
+ line is a status report, never a failure; it does not end the call and a call with a
311
+ deadline never emits it. Use it, or `/claude-code-doctor`, to tell a working subagent
312
+ from a wedged one before suggesting any timeout change.
283
313
 
284
314
  ### Let Claude load the user's opencode skills
285
315