@khalilgharbaoui/opencode-claude-code-plugin 0.60.2 → 0.61.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/dist/index.d.ts +15 -0
- package/dist/index.js +28 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/claude-code-plugin/SKILL.md +4 -1
package/package.json
CHANGED
|
@@ -155,6 +155,7 @@ Defaults below describe normal headless opencode use when the key is absent.
|
|
|
155
155
|
| `compactionModel` | string | `"claude-haiku-4-5"` | `/compact` uses a fresh short-lived process on the selected transport without the usual bridge/proxy/skill wiring. On the PTY it disables built-in tools, uses an empty strict MCP config, submits summary instructions with the transcript as text, and closes the TUI after its answer. Nonblank `CLAUDE_CODE_COMPACTION_MODEL` wins. This is inference and can be billed. |
|
|
156
156
|
| `ignoreAnthropicApiKey` | boolean | `false` | Strip `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` from headless/interactive spawn env, allowing stored auth to be used. Does not log in, change the parent env, or guarantee subscription billing if other CLI/cloud auth is configured. Warns at startup when either nonempty variable is present, regardless of the flag. |
|
|
157
157
|
| `idleProcessTimeoutMs` | number | unset | Kill a conversation's idle `claude` worker this many ms after a finished turn. The timer starts when a turn completes, reuse cancels it, and a worker found mid-turn when it fires is re-timed rather than killed. The session id is kept, so the next message resumes transparently. Unset or `0` keeps workers until LRU eviction (16 processes, oldest idle first). Values above `2147483647` are ignored. Applies to the interactive transport too (the TUI is closed; the next message resumes it). Deleting a chat in opencode releases its workers and session ids immediately regardless. |
|
|
158
|
+
| `enableTodoTools` | boolean | `false` | Set `CLAUDE_CODE_ENABLE_TODO_TOOLS=1` on every `claude` spawn (both transports, never compaction), so the CLI offers `TaskCreate`/`TaskUpdate`/`TaskGet`/`TaskList` on every model. Claude Code 2.1.280 to 2.1.293 offers them on its own only to Claude 3.x, Opus 4.0-4.7, Sonnet 4.0-4.6 and Haiku 4.5; on Opus 4.8, Opus 5/5.5, Sonnet 5/5.5, Fable and Haiku 5.5 no todos reach opencode's `todowrite` (or the sidebar's todo fraction) without it. Fills a gap only: a `CLAUDE_CODE_ENABLE_TODO_TOOLS` already in opencode's environment, `0` included, is passed through and decides. Off by default because the CLI turned the tools off for those models deliberately. Doctor row: `enableTodoTools`, with a note when the environment overrides it. Spawn log: `enableTodoTools: true` on `spawning new claude process`. Subagents still need `permission.todowrite: "allow"`. |
|
|
158
159
|
| `turnStats` | boolean | `false` | Append one `▌ **stats:**` line to each finished turn: cost, wall duration, CLI turn count, input/output/cache-read/cache-write tokens, and a permission-denial count when the turn had any, taken from the CLI's own `result`. Never on a compaction turn or a turn that ended in error. Its own text part, stripped from transcripts rebuilt for the CLI, so the model never sees it. The same numbers are logged at INFO regardless, and `modelUsage` plus `permission_denials` always reach `providerMetadata`. The cost is THIS turn's: the CLI reports the Claude session's running total, and the footer prints the difference from that session's previous total (the INFO line carries both, `costUsd` and `turnCostUsd`). The first turn of a session resumed after an opencode restart, or of a fork, prints no cost, because `--resume` restores the running total and there is nothing to subtract; the next turn has it again. Not a billing guarantee. |
|
|
159
160
|
| `forkSessions` | boolean | `false` | When a new opencode session turns out to be a fork of one this provider already served, branch the parent's Claude conversation with `claude --resume <parent> --fork-session` instead of re-rendering the whole thread as text into the first message. Measured on CLI 2.1.280 with haiku 4.5 over a ~13k-token thread: 814 cache tokens written and 39,710 read, against 22,355 written and 17,385 read for the replay, so $0.0058 against $0.0467 for that turn; the parent's transcript is byte-identical afterwards. Neither opencode major tells a provider that a session is a fork, so the parent is found by matching this prompt's history against what each sibling session key was last asked to continue. Off by default because a resumed Claude conversation reuses the system prompt recorded on its FIRST request (`--system-prompt-snapshot`, default `on`), so a forked session answers under the parent's appended system prompt rather than this turn's; measured directly, a parent seeded with codename ZEBRA and forked while passing QUAIL answered ZEBRA. Falls back to the replay, unchanged, for: another account, an unknown or released parent session id, a busy parent (live process, proxied call in flight, unanswered plan-mode question), a fork cut mid-conversation, a fork taken mid tool round trip, a different cwd / model / agent / effort / prompt-cache TTL, compaction, an account-failover switch, and a `claude` whose `--help` does not advertise `--fork-session`. Recording costs nothing while the option is off. |
|
|
160
161
|
| `resumeAfterRestart` | boolean | `true` | After an opencode restart, resume the conversation's Claude session (`--resume`) instead of replaying the thread as text. Persists session id + conversation digest per session key in `$XDG_STATE_HOME/opencode-claude-code-plugin/claude-sessions.json` (0600, 256 entries, 30 days) after each successful turn. Resumes only on the same session key and binary, with the transcript on disk and the history equal to the recorded conversation plus Claude's reply; anything else (edit, revert, compaction, account switch, open tool round trip) replays. opencode-dcp's `<dcp-message-id>` references (and its `@12@` compact form) are not part of the digest: dcp renumbers them on every opencode restart, so after an undo the same message came back under another number and the conversation was refused as `conversation-changed`. Records carry a digest `version`; one without it (written by an older plugin) is compared the old way. Not on compaction. Log: `resuming the claude session from before the restart` (NOTICE) or `not resuming ...` with a reason (INFO). `false` disables reading and writing. |
|
|
@@ -686,7 +687,8 @@ both come out of the same usage limit; leave a long-lived main session at the de
|
|
|
686
687
|
|
|
687
688
|
Only grant `permission.task` for approved target agents if delegation is wanted.
|
|
688
689
|
`permission.todowrite: "allow"` is needed for subagent todos; opencode otherwise denies
|
|
689
|
-
them by default.
|
|
690
|
+
them by default. On models newer than the 4.x line the CLI offers no todo tool at all
|
|
691
|
+
unless `enableTodoTools` is on. Ask before broadening permissions. Use the singular `agent` config
|
|
690
692
|
object for inline definitions, with `forceModel`/`reasoningEffort` under `options` if
|
|
691
693
|
the opencode schema requires it. Markdown fallback reads top-level scalar fields only.
|
|
692
694
|
|
|
@@ -1474,6 +1476,7 @@ Prefer the doctor: it needs no logging change and no restart.
|
|
|
1474
1476
|
| A question form never renders and the turn hangs | Blocking notification/tool hooks, or a pending request not reaching the visible session | Check `GET /question` on the same server/workspace: absent means investigate pre-tool hooks or replacement tools; present means inspect session ownership, permission priority and event delivery. On the maintainer's Mac, awaiting `alerter` dismissal in `tool.execute.before` blocked the tool itself. Native providers load global plugins too. The separate detach/reattach issue #36604 remains open; #36603 closed unmerged. |
|
|
1475
1477
|
| No thinking summary | CLI version, explicit disable/summary env, or no thinking text emitted | Check version and nonsecret flag presence; do not override deliberate user suppression |
|
|
1476
1478
|
| `⚙ invalid` rows for `todowrite` inside a subagent | Subagent lacks `permission.todowrite: "allow"` | Grant it on the agent definition with approval |
|
|
1479
|
+
| No todos at all, no todo fraction in the sidebar | Claude Code offers `TaskCreate`/`TaskUpdate`/`TaskGet`/`TaskList` only to Claude 3.x, Opus 4.0-4.7, Sonnet 4.0-4.6 and Haiku 4.5 (2.1.293); Opus 4.8, Opus 5/5.5, Sonnet 5/5.5, Fable and Haiku 5.5 get none | Set `enableTodoTools: true` (or export `CLAUDE_CODE_ENABLE_TODO_TOOLS=1` before starting opencode; spawns inherit it, and a value set there wins); measured on Haiku 5.5, opencode's todo list fills |
|
|
1477
1480
|
| Other `⚙ invalid` or `⚙ unknown` tool rows | A Claude tool the plugin does not map for this version | Note plugin version, CLI version and the tool name; upgrade or report |
|
|
1478
1481
|
| `AGENTS.md` appears twice in Claude's system prompt | Plugin older than 0.16.0 | Upgrade |
|
|
1479
1482
|
| "What does the plugin actually think is going on?" | Startup diagnostics go to a log that is off by default | Run `/claude-code-doctor` in the session; paste that instead of the log |
|