Skip to content
This repository was archived by the owner on Apr 26, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
300 commits
Select commit Hold shift + click to select a range
4ba167e
Count image/file parts as new user content
khalilgharbaoui May 11, 2026
210bffe
Surface warn-level logs without DEBUG flag
khalilgharbaoui May 11, 2026
64b9b3c
Time out proxy MCP tool calls after 10 minutes
khalilgharbaoui May 11, 2026
73ce6eb
Update README to describe the wire-inactivity watchdog
khalilgharbaoui May 11, 2026
7002bca
Isolate plugin tmp files per pid and clean up on exit
khalilgharbaoui May 11, 2026
4c23e22
0.3.1
khalilgharbaoui May 11, 2026
e8f3453
Route MCP tools through proxy
khalilgharbaoui May 13, 2026
398f6d1
v0.4.1
khalilgharbaoui May 13, 2026
5251160
Support parallel proxy tool calls via batched drain
khalilgharbaoui May 13, 2026
248634b
v0.4.2
khalilgharbaoui May 13, 2026
0eb27cc
Substitute opencode {env:VAR} placeholders and guard drain race on re…
khalilgharbaoui May 13, 2026
082c90c
v0.4.3
khalilgharbaoui May 13, 2026
8f2a32a
Nudge model to chain tool calls within a single turn
khalilgharbaoui May 13, 2026
899616d
v0.4.4
khalilgharbaoui May 13, 2026
d178565
Smartly continue incomplete Claude CLI turns
khalilgharbaoui May 13, 2026
433603d
v0.4.5
khalilgharbaoui May 13, 2026
a39dff8
Narrow auto-continue final-answer check to last text block
khalilgharbaoui May 13, 2026
8904574
v0.4.6
khalilgharbaoui May 13, 2026
f8997e8
Treat tool-role tool-result as new user content
khalilgharbaoui May 14, 2026
9bba2b8
Extract tool-results from tool-role messages in getClaudeUserMessage
khalilgharbaoui May 14, 2026
0d33109
v0.4.8
khalilgharbaoui May 14, 2026
38cfb83
Stop log.notice from surfacing as UI warnings
khalilgharbaoui May 14, 2026
e8e670c
v0.4.9
khalilgharbaoui May 14, 2026
a7007f9
Tighten auto-continue heuristic (tweaks 2/3/4/5)
khalilgharbaoui May 14, 2026
2948e4a
v0.4.10
khalilgharbaoui May 14, 2026
d5a9879
Add 'ready when you are' / 'standing by' to question regex (tweak 6)
khalilgharbaoui May 14, 2026
28fb940
v0.4.11
khalilgharbaoui May 14, 2026
883c598
Defensive soft-proceed coverage (tweak 7)
khalilgharbaoui May 14, 2026
9baa271
v0.4.12
khalilgharbaoui May 14, 2026
42e33e9
Demote AFK-pending-timeout logs from WARN to NOTICE
khalilgharbaoui May 14, 2026
0ec6d63
v0.4.13
khalilgharbaoui May 14, 2026
65761cd
Make file logging opt-in via OPENCODE_CLAUDE_CODE_LOG_FILE
khalilgharbaoui May 14, 2026
d4b61cc
v0.4.14
khalilgharbaoui May 14, 2026
cda2ff8
Final-answer regex picks up deploy/ship verbs + strong phrases
khalilgharbaoui May 14, 2026
2a105a3
v0.4.15
khalilgharbaoui May 14, 2026
869b8e7
Trust Claude CLI stop_reason as authoritative; heuristic as null-fall…
khalilgharbaoui May 14, 2026
1cd7968
v0.4.16
khalilgharbaoui May 14, 2026
f995ae7
Rails-style logging config: file, dir, mode, level
khalilgharbaoui May 14, 2026
01e47b4
v0.4.17
khalilgharbaoui May 14, 2026
aa231e3
Dedup LogLevel/LogMode; types.ts re-exports from logger.ts
khalilgharbaoui May 14, 2026
2c5bceb
v0.4.18
khalilgharbaoui May 14, 2026
124894f
Demote orphan-rejection cascade from WARN to NOTICE
khalilgharbaoui May 14, 2026
f4f6b09
v0.4.19
khalilgharbaoui May 14, 2026
67a47d9
Fix /compact routing, gate thinking flag, skip Task* tools
khalilgharbaoui May 16, 2026
588d607
v0.4.20
khalilgharbaoui May 16, 2026
8173313
Bump actions/setup-node to v6 for Node 24 runtime
khalilgharbaoui May 16, 2026
f5035c1
Document missing src/ files and AGENTS.md in README
khalilgharbaoui May 16, 2026
96b8e8f
Fix workspace-switch cwd regression introduced in v0.2.4 (#4)
khalilgharbaoui May 16, 2026
2f59191
v0.4.21
khalilgharbaoui May 16, 2026
9a31ae8
feat(proxy): expose Task as a proxied tool
galvani May 16, 2026
b241d7d
v0.4.22
khalilgharbaoui May 16, 2026
79a4943
feat(todo): route Claude TaskCreate/TaskUpdate to opencode todowrite
khalilgharbaoui May 16, 2026
0f2c651
v0.4.23
khalilgharbaoui May 16, 2026
6c6079d
Document subagent todowrite permission requirement
khalilgharbaoui May 16, 2026
66556b9
Document roadmap priorities
khalilgharbaoui May 16, 2026
d5e1d28
fix(askuserquestion): render full question + options; never auto-allo…
galvani May 18, 2026
ca2f57c
Add star history
khalilgharbaoui May 18, 2026
d4e5088
0.5.0
khalilgharbaoui May 18, 2026
9ee19af
Fix session affinity fallback to opencodeSessionID
khalilgharbaoui May 18, 2026
614cbb1
Forward system-role messages to Claude CLI append-prompt
khalilgharbaoui May 18, 2026
866e333
Prepend Claude CLI runtime context note to system prompt
khalilgharbaoui May 18, 2026
422240d
Append AGENTS maintenance hint after AGENTS.md context
khalilgharbaoui May 18, 2026
948fd76
Fix doGenerate raw path: tool input JSON accumulation and proc cleanup
khalilgharbaoui May 18, 2026
6db92b9
0.5.1
khalilgharbaoui May 18, 2026
d3540cd
Document opencode-dcp compatibility in README
khalilgharbaoui May 18, 2026
d03e33f
fix(provider): inject full model definitions via config hook
May 25, 2026
fb9401f
Add Claude Opus 4.8 model support
khalilgharbaoui May 29, 2026
40e6958
0.6.0
khalilgharbaoui May 29, 2026
bc8205f
Fix Opus 4.8 release date
khalilgharbaoui May 29, 2026
dd62481
0.6.1
khalilgharbaoui May 29, 2026
6770845
Publish via npm OIDC trusted publishing
khalilgharbaoui May 29, 2026
98ae31a
0.6.2
khalilgharbaoui May 29, 2026
b5105f0
Document OIDC trusted publishing
khalilgharbaoui May 29, 2026
9d854bb
Document opencode plugin cache-clear step
khalilgharbaoui May 29, 2026
e129473
Merge pull request #7 from galvani/fix/provider-model-registration
khalilgharbaoui May 30, 2026
644559b
Drop dead variant merge; test config models
khalilgharbaoui May 30, 2026
e6993ea
0.6.3
khalilgharbaoui May 30, 2026
711e451
Stop turn on AskUserQuestion deny (#8)
khalilgharbaoui May 30, 2026
7002649
0.7.0
khalilgharbaoui May 30, 2026
bc73858
feat(transport): in-process Bun ConPTY claude session
Aptul9 Jun 8, 2026
6d76882
feat(transport): wire interactive Bun ConPTY transport into doStream
Aptul9 Jun 8, 2026
416bef0
fix(transport): sum output tokens across tool-loop records
Aptul9 Jun 8, 2026
e13846e
feat(transport): make interactive transport config-driven
Aptul9 Jun 8, 2026
e08bd3c
fix(transport): drain transcript before reacting to exit
Aptul9 Jun 8, 2026
af54105
fix: submit interactive-PTY turns reliably for large pasted prompts
Aptul9 Jun 8, 2026
861c361
Add Fable 5 and Mythos 5 models, fix Opus pricing
khalilgharbaoui Jun 10, 2026
d3c79c0
0.8.0
khalilgharbaoui Jun 10, 2026
35d3b6b
Fix invalid WebSearch rows, add billing docs
khalilgharbaoui Jun 10, 2026
5346d84
0.8.1
khalilgharbaoui Jun 10, 2026
ed13134
Fix unknown tool rows from skipped tool deltas
khalilgharbaoui Jun 10, 2026
44aa5ea
0.8.2
khalilgharbaoui Jun 10, 2026
197928f
Merge branch 'pr-10' into interactive-transport
khalilgharbaoui Jun 10, 2026
1b967ec
Harden interactive transport (PR #10)
khalilgharbaoui Jun 10, 2026
a492346
Omit forwarded opencode prompt in interactive mode
khalilgharbaoui Jun 10, 2026
0c75bfc
Merge interactive transport (v0.9.0)
khalilgharbaoui Jun 10, 2026
4b5e823
0.9.0
khalilgharbaoui Jun 10, 2026
debca89
Document interactive fresh-session hang for next session
khalilgharbaoui Jun 10, 2026
1a57e23
Note cwd-dependent interactive freeze (trust-prompt lead)
khalilgharbaoui Jun 10, 2026
d0c5342
Re-scope freeze: not interactive, opencode startup cwd hang
khalilgharbaoui Jun 10, 2026
a265efe
Drop local-setup freeze note from docs
khalilgharbaoui Jun 10, 2026
a5c99c5
Add npm badge to README
khalilgharbaoui Jun 10, 2026
e5ce4ed
Align Agent SDK credit table with Anthropic article
khalilgharbaoui Jun 10, 2026
432e465
Add ignoreAnthropicApiKey spawn-env guard (#9)
khalilgharbaoui Jun 10, 2026
99dac18
v0.9.1
khalilgharbaoui Jun 10, 2026
d80fb77
Stop self-proceeding after AskUserQuestion
khalilgharbaoui Jun 10, 2026
5e053d0
v0.9.2
khalilgharbaoui Jun 10, 2026
384cd19
Update README.md
khalilgharbaoui Jun 19, 2026
f116a81
Register Claude Sonnet 5 and Opus 5
broskees Jul 24, 2026
2ffee07
Document Sonnet 5 intro pricing and output convention
khalilgharbaoui Jul 25, 2026
e31ce47
0.9.3
khalilgharbaoui Jul 25, 2026
d802d94
Refresh roadmap after fork and PR sweep
khalilgharbaoui Jul 25, 2026
7339c56
Enable reliable OpenCode subagents
broskees Jul 15, 2026
10daacd
Parse OpenCode configs as JSONC
broskees Jul 16, 2026
8cd6b6c
Wait for Claude session handoff
broskees Jul 16, 2026
d3c397a
Resume Claude sessions with --resume instead of --session-id
broskees Jul 16, 2026
e049150
Demote 'proxy MCP server closed' rejections to notice-level logging
broskees Jul 16, 2026
e87b26d
Defer MCP reload while proxy calls are pending
broskees Jul 16, 2026
872bb16
Keep parallel Task results alive for 30 minutes
broskees Jul 21, 2026
eda83a0
Add per-tool proxy call timeouts
jknlsn Jul 5, 2026
2cd4e99
Return MCP results for tools/call failures
khalilgharbaoui Jul 26, 2026
621d561
Respawn reused claude process when silent after envelope write
jknlsn Jul 5, 2026
e40395d
0.10.0
khalilgharbaoui Jul 26, 2026
7e5b6a5
Add startup diagnostics block
khalilgharbaoui Jul 26, 2026
a35f299
0.11.0
khalilgharbaoui Jul 26, 2026
65fa398
Refresh roadmap recommendation
khalilgharbaoui Jul 26, 2026
9a51cce
Detect opencode version for startup diagnostics
khalilgharbaoui Jul 26, 2026
514911a
0.11.1
khalilgharbaoui Jul 26, 2026
98b7d4f
Narrow issue #21 scope in roadmap
khalilgharbaoui Jul 26, 2026
8777251
Steer models to the task proxy for subagent dispatch
jknlsn Jul 4, 2026
4043113
Front-load agent list in task proxy description
khalilgharbaoui Jul 26, 2026
8b6e448
0.11.2
khalilgharbaoui Jul 26, 2026
bc64a5f
Expose question proxy tool for structured operator questions
jknlsn Jul 5, 2026
a1bd6a1
Document question proxy opt-in and subagent todos
khalilgharbaoui Jul 26, 2026
7bb5476
Document upstream question-form breakage
khalilgharbaoui Jul 26, 2026
a4dcb43
Note headless CLI no longer offers AskUserQuestion
khalilgharbaoui Jul 26, 2026
7a742e5
Correct published context and output limits
khalilgharbaoui Jul 26, 2026
8eea128
0.12.0
khalilgharbaoui Jul 26, 2026
2201a4c
Record two deferred outward-facing actions
khalilgharbaoui Jul 26, 2026
5fc0814
Fix ExitPlanMode approval bridge
colliet5 May 26, 2026
0b899a4
Document the opt-in plan-mode approval bridge
khalilgharbaoui Aug 12, 2026
00465e2
Harden plan-mode approval bridge
khalilgharbaoui Aug 19, 2026
c7eeb51
fix(message-builder): read part.image for AI SDK v4 image parts
flupkede May 17, 2026
da48a8c
Cover v4 image parts, record compress verdict
khalilgharbaoui Aug 19, 2026
bedf977
0.12.1
khalilgharbaoui Aug 19, 2026
7a5e8c7
Add opt-in compress proxy tool
khalilgharbaoui Aug 19, 2026
00c783a
Record posted follow-ups and corrected upstream state
khalilgharbaoui Aug 19, 2026
a2e0082
0.13.0
khalilgharbaoui Aug 19, 2026
016efae
Stop TaskOutput from expanding in the shell
khalilgharbaoui Aug 19, 2026
2b4f080
Let operators disallow tools the proxy cannot replace
khalilgharbaoui Aug 19, 2026
c7fe8de
Fix model cost units: dollars per million tokens, not per token
CNQQC Aug 4, 2026
77f8da2
Record cost units, dead auto-continue, closed backlog
khalilgharbaoui Aug 19, 2026
aa4d56b
0.13.1
khalilgharbaoui Aug 19, 2026
037e4d2
Re-check opencode surface against 1.18.18
khalilgharbaoui Aug 19, 2026
515a221
Require a bearer token on the proxy MCP endpoint
Aug 10, 2026
6b4c865
Authenticate the proxy endpoint from the test harness
Aug 10, 2026
5905065
Close rejected connections, and scope the 0600 claim to POSIX
willmcginnis Aug 10, 2026
74c53bb
Log why the proxy rejects a request, and document the auth
khalilgharbaoui Aug 19, 2026
03c87a5
Document proxy endpoint authentication
khalilgharbaoui Aug 19, 2026
dd18f80
0.13.2
khalilgharbaoui Aug 19, 2026
f2d82f3
Note when a release needs written notes
khalilgharbaoui Aug 19, 2026
48d1794
Link the published advisory
khalilgharbaoui Aug 19, 2026
754d3d8
Track the pending CVE request
khalilgharbaoui Aug 20, 2026
63adbd7
Document the restart requirement after upgrade
khalilgharbaoui Aug 20, 2026
cdc1877
Star History
khalilgharbaoui Aug 21, 2026
d9a7376
Add Opus fast mode models
khalilgharbaoui Aug 29, 2026
628a2de
0.14.0
khalilgharbaoui Aug 29, 2026
313d004
Merge remote-tracking branch 'origin/master'
khalilgharbaoui Aug 29, 2026
87217a7
Bump Sonnet 5 to standard pricing
khalilgharbaoui Sep 1, 2026
e4e786d
Add Fable and Mythos 5.1
khalilgharbaoui Sep 1, 2026
affd536
0.14.1
khalilgharbaoui Sep 1, 2026
89d6d77
Let agents choose their model, keep the account
khalilgharbaoui Sep 3, 2026
a149b0b
Pass reasoning effort to the CLI as an env var
khalilgharbaoui Sep 3, 2026
3e28790
Let an agent state its own thinking budget
khalilgharbaoui Sep 3, 2026
173aacc
Recover proxy results and add native /btw
khalilgharbaoui Sep 5, 2026
ccd4ef4
v0.15.0
khalilgharbaoui Sep 5, 2026
54066fb
Clear tool block index on stop
khalilgharbaoui Sep 5, 2026
c36e614
Strip system reminders from btw questions
khalilgharbaoui Sep 6, 2026
c3f1b15
v0.15.1
khalilgharbaoui Sep 6, 2026
aee0e8c
Answer /btw concurrently in a child session
khalilgharbaoui Sep 6, 2026
4c58f84
Keep /btw exchanges in the conversation
khalilgharbaoui Sep 6, 2026
f0d5660
Stop /btw queueing when asked early
khalilgharbaoui Sep 6, 2026
1f26b16
Write /btw answers into the running turn
khalilgharbaoui Sep 6, 2026
5add284
Quote the whole btw block
khalilgharbaoui Sep 6, 2026
09aa34a
Mark the btw block with a bar, not a quote
khalilgharbaoui Sep 6, 2026
0598fb5
Stop toasting the btw answer
khalilgharbaoui Sep 6, 2026
9b65f98
Receipt a btw the moment it is sent
khalilgharbaoui Sep 6, 2026
fab091b
v0.15.2
khalilgharbaoui Sep 6, 2026
13403bd
Name the question in the btw receipt
khalilgharbaoui Sep 6, 2026
dbc6d70
Give the btw receipt the full question
khalilgharbaoui Sep 6, 2026
068b4de
Record why the btw bar stays uncoloured
khalilgharbaoui Sep 6, 2026
6de7cf9
v0.15.3
khalilgharbaoui Sep 6, 2026
06a57cf
Refresh the roadmap against live issue state
khalilgharbaoui Sep 6, 2026
dc3368c
Stop losing subagent output across CLI resume (#29)
khalilgharbaoui Sep 6, 2026
0bab184
Record the live check for #29
khalilgharbaoui Sep 6, 2026
e9d60ec
v0.15.4
khalilgharbaoui Sep 6, 2026
694d3d0
Mark #29 closed in the roadmap
khalilgharbaoui Sep 6, 2026
f95a862
fix(cwd): resolve per-session project directory in opencode serve mode
May 18, 2026
bb21510
fix(system-prompt): dedup AGENTS.md forwarded by opencode vs plugin d…
HeikoAtGitHub Jul 2, 2026
d0b22e9
Add idle timeout for Claude workers
Jul 14, 2026
e760d4a
Interrupt the CLI turn on abort
broskees Sep 6, 2026
e47356b
Bridge opencode skills into Claude's Skill tool
broskees Sep 6, 2026
bc5bf19
Credit and document the fork absorption
khalilgharbaoui Sep 6, 2026
fee8336
v0.16.0
khalilgharbaoui Sep 6, 2026
1ecaa4c
Run subagents concurrently with task_batch
broskees Sep 6, 2026
1a57b9e
v0.17.0
khalilgharbaoui Sep 6, 2026
9105d61
Bundle the plugin configuration skill
khalilgharbaoui Sep 6, 2026
46d785e
v0.18.0
khalilgharbaoui Sep 6, 2026
eb78c9c
Record the question proxy as verified
khalilgharbaoui Sep 6, 2026
55b7323
Drop the idle timeout observation
khalilgharbaoui Sep 6, 2026
2f458cc
Record plan mode findings from live probes
khalilgharbaoui Sep 6, 2026
255565d
Never let plan mode permit edits
khalilgharbaoui Sep 6, 2026
9a0a3db
v0.18.1
khalilgharbaoui Sep 6, 2026
0cde0ed
Note the opencode plan mode alignment idea
khalilgharbaoui Sep 6, 2026
cc85b57
Continue a turn cut off at max_tokens
khalilgharbaoui Sep 6, 2026
74f4c0a
v0.18.2
khalilgharbaoui Sep 6, 2026
5144a7f
Audit the opencode surface at 1.18.29
khalilgharbaoui Sep 6, 2026
4a67a08
Never auto-continue a compaction turn (#30)
khalilgharbaoui Sep 7, 2026
f6bc098
v0.18.3
khalilgharbaoui Sep 7, 2026
450d701
Point the v2 tracker at issue 31
khalilgharbaoui Sep 7, 2026
5cabeaa
Note the account fallback idea
khalilgharbaoui Sep 14, 2026
3af286b
Handle stdin errors, LRU and crashes (#33)
khalilgharbaoui Sep 14, 2026
defea0b
Observability: turn stats, CLI event parsing, doctor command (#34)
khalilgharbaoui Sep 15, 2026
8b10658
Fix README contradictions, add quickstart and missing options (#32)
khalilgharbaoui Sep 15, 2026
0cb899a
v0.19.0
khalilgharbaoui Sep 15, 2026
ff2edf0
Listen for how a proxied call ends instead of timing it out
broskees Sep 19, 2026
4aad4c7
Replay unattended stdout as one text block, not one per delta (#35)
nic-lan Sep 19, 2026
9866f02
Merge PR #36: listen for how a proxied call ends
khalilgharbaoui Sep 19, 2026
dfb82d5
Keep skills, idle timeout and cap defaults as they were
khalilgharbaoui Sep 19, 2026
3b1c122
Record the 2026-09-19 fork sweep
khalilgharbaoui Sep 19, 2026
afb9ab3
v0.20.0
khalilgharbaoui Sep 19, 2026
834b689
Re-audit the opencode surface at 1.18.31
khalilgharbaoui Sep 19, 2026
c31dd3e
Say when a call with no deadline is still waiting (#37)
khalilgharbaoui Sep 19, 2026
8c0da5a
Forward named opencode tools through the proxy (#38)
khalilgharbaoui Sep 19, 2026
89970ee
Record that proxyOpencodeMcpTools routes nothing today
khalilgharbaoui Sep 19, 2026
3b5120b
v0.21.0
khalilgharbaoui Sep 19, 2026
76a4f48
Stop the recovery tests reporting the machine's load
khalilgharbaoui Sep 19, 2026
7f51273
Warn before a deadline takes a proxied call
khalilgharbaoui Sep 19, 2026
61dae03
Discover MCP tools from the model tool set (#39)
khalilgharbaoui Sep 19, 2026
ee917f1
Correct the doStream tools-argument note
khalilgharbaoui Sep 19, 2026
dd62663
Record the five-server routing verification
khalilgharbaoui Sep 19, 2026
56a4cc9
v0.22.0
khalilgharbaoui Sep 19, 2026
8fa9a16
Stop an exclusion losing to a cached bridge file
khalilgharbaoui Sep 20, 2026
1796a24
v0.22.1
khalilgharbaoui Sep 20, 2026
44d48f0
Record open questions where they survive a reset
khalilgharbaoui Sep 20, 2026
aab16c3
Pin the spawned CLI against mid-session autoupdate (#40)
khalilgharbaoui Sep 20, 2026
dad87c2
v0.23.0
khalilgharbaoui Sep 20, 2026
e01dec5
Record the deferred config decisions
khalilgharbaoui Sep 20, 2026
2b0b294
Offer another account when one hits its usage limit (#41)
khalilgharbaoui Sep 20, 2026
bfbda60
Bound the serve-mode session and ledger maps (#42)
khalilgharbaoui Sep 20, 2026
96e7d02
v0.24.0
khalilgharbaoui Sep 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v4
- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org
- run: npm install -g npm@latest
- run: npm install
- run: npm run build
- name: Publish package
Expand Down
243 changes: 243 additions & 0 deletions AGENTS.md

Large diffs are not rendered by default.

1,255 changes: 1,154 additions & 101 deletions README.md

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Deferred Checks

## Ideas

- 2026-09-06, maintainer: "maybe someday we still want to align it with plan mode of opencode maybe".
Deferred, not scheduled. Make `permissionMode: "plan"` follow opencode's own plan/build agent
instead of being a static provider option.

Cheaper than it looks, and the objection that killed it the first time does not apply:
the opencode agent is already part of the session key
(`...::ses_...::context=["claude-code-appical","build"]`), so plan and build turns already
run as separate `claude` processes. A Tab back to build would spawn one without the flag,
so a coupled design is not a one-way door the way the static option is.

What still argues against it, and what to re-check before building:
1. `"plan"` is only a name. Users define their own agents called plan, some of which write
plan documents into the repo, and forcing CLI plan mode would break those silently.
Any implementation needs an explicit opt-in rather than a name match.
2. The two disagree about how you leave. Claude Code expects an `ExitPlanMode` tool call
that headless `--print` never offers (measured on 2.1.258, probes recorded in AGENTS.md),
so the model searches for a tool it cannot find and narrates confusion. Re-run those
probes first: if a newer CLI offers `ExitPlanMode` headless, this objection dies and the
`planModeQuestion` bridge becomes reachable at the same time.
3. It buys little for the common config. opencode's plan mode already denies its own tools,
and `Bash`/`Edit`/`Write` are proxied by default, so the only gap it closes is Claude's
unproxied built-ins.

Shape if built: an explicit option (something like `planModePermission: "follow-agent"`),
never silent coupling. Do not start this without a user asking for it.

- 2026-09-09, maintainer: "pin to appical but if limits hit switch to default is that possible?"
Asked while designing the `dev-support` agent, which must run on the appical account for
its per-profile MCP servers (Linear, Aikido, Sentry) but should survive that account's
spend limit. Today it is not possible: the account is the provider, it is fixed for the
life of the `claude` process, and a `forceModel` agent inherits whoever invoked it. When
the limit error arrives ("You've hit your individual spend limit", resets at a stated
time) the turn simply fails and the human restarts on the other account.

Shape if built: an optional `fallbackAccounts: ["default"]` per agent or per provider.
On a recognised limit error the plugin respawns the session on the next account with
the same model, effort and cwd, and says so in the turn. Things to check first:
1. The failover account may lack the MCP servers the run depends on; the resumed turn
would need to re-announce its tool list, or the option should refuse to fail over when
the tool sets differ.
2. Session key includes the account, so a failover is a new process and loses in-process
state; opencode's own transcript is what carries over, which is probably enough.
3. Detection must match the CLI's limit message exactly, not any 4xx, or a transient
error would silently move billing to another account.

## Dropped

- Dropped 2026-09-06 at the user's request: live observation of `idleProcessTimeoutMs: 900000`. The 15-minute eviction and subsequent resume remain unverified in the user's window; no test is planned.

## Backlog

## Deferred decisions

- 2026-09-20: The maintainer chose "later" for adding the Appical MCP project block
to `Appical.IaC`, `Cl-nica-Aurora---Player-team`, `Manager-toolkit`,
`NOW-player-web` and `workshop-sep-2026`.
- 2026-09-20: The maintainer chose "later" for choosing a Slack authentication
strategy. The current global server can still pay a 30-second 1Password unlock
timeout on startup.
- 2026-09-20: The maintainer chose "later" for completing opencode's separate,
global Linear OAuth authentication.

## Open from you

Questions the maintainer still owes an answer on. Written here the turn they are
raised, so they survive context compaction; removed when answered, done or dropped.

No pending questions.

## In progress

- 2026-09-20: two lanes dispatched after the maintainer said `go` to every recommendation.
Lane 1, account failover: on whenever more than one account is configured; a synthetic
`question` tool-call on a recognised limit rejection; the pick applies inside the same
opencode turn; sticky for the limited account until its reset time; subagents follow
the parent's pick and never ask; a dismissed form ends the turn as the rate-limit error
does today. Lane 2, small cleanup: stale plan-mode comment, visible result-fallback
timeout, bounded serve-mode maps, silent-turn nudge.
97 changes: 97 additions & 0 deletions e2e-claude-session-bun.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/**
* E2E for src/claude-session-bun.ts against REAL claude over Bun's native
* ConPTY. Plain runnable script (not part of the offline suite; spawns claude,
* needs a logged-in subscription). Run:
*
* bun e2e-claude-session-bun.ts
*
* Milestone proof: multiple messages in one live chat session, context retained
* across turns (subscription interactive path), with prompt-cache reuse.
*/
import { ClaudeSession, askOnce } from "./src/claude-session-bun.js"

const TERMINAL = new Set(["end_turn", "stop_sequence", "max_tokens"])
let failures = 0
function check(cond: boolean, msg: string) {
if (cond) console.log(" PASS:", msg)
else {
failures++
console.log(" FAIL:", msg)
}
}

async function main() {
console.log("=== e2e claude-session-bun (Bun native ConPTY) ===")
console.log(
"bun:",
Bun.version,
"| Bun.Terminal:",
typeof (Bun as any).Terminal,
)

console.log("\n[A] one-shot 2+2")
const r = await askOnce("What is 2+2? Reply with only the number.", {
settingSources: "",
})
console.log(" reply:", JSON.stringify(r.text), "stop:", r.stopReason)
check(TERMINAL.has(r.stopReason ?? ""), "one-shot terminal stop")
check(/4/.test(r.text), "one-shot says 4")

console.log("\n[B] multi-turn: 3 messages, one live process")
const s = new ClaudeSession({ settingSources: "" })
await s.start()
try {
const t1 = await s.ask(
"Remember two facts for this conversation: my favorite number is 42 and my favorite color is teal. Reply with exactly: OK",
)
console.log(" turn1:", JSON.stringify(t1.text), "stop:", t1.stopReason)
check(TERMINAL.has(t1.stopReason ?? ""), "turn1 terminal stop")

const t2 = await s.ask(
"What is my favorite number? Reply with only the number.",
)
console.log(
" turn2:",
JSON.stringify(t2.text),
"stop:",
t2.stopReason,
"cacheRead:",
t2.cacheReadTokens,
"eph1h:",
t2.ephemeral1hTokens,
)
check(TERMINAL.has(t2.stopReason ?? ""), "turn2 terminal stop")
check(/42/.test(t2.text), "turn2 recalls 42 (context retained across turns)")

const t3 = await s.ask(
"What is my favorite color? Reply with only the word.",
)
console.log(
" turn3:",
JSON.stringify(t3.text),
"stop:",
t3.stopReason,
"cacheRead:",
t3.cacheReadTokens,
)
check(TERMINAL.has(t3.stopReason ?? ""), "turn3 terminal stop")
check(/teal/i.test(t3.text), "turn3 recalls teal (context retained across turns)")

check(
t2.cacheReadTokens > 0 || t3.cacheReadTokens > 0,
"prompt-cache reuse on later turns (1h tier)",
)
} finally {
s.dispose()
}

console.log(
`\n=== ${failures === 0 ? "ALL PASS" : failures + " FAILURE(S)"} ===`,
)
process.exit(failures === 0 ? 0 : 1)
}

main().catch((e) => {
console.error("FATAL:", e?.stack ?? e)
process.exit(2)
})
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@unixfox/opencode-claude-code-plugin",
"name": "@khalilgharbaoui/opencode-claude-code-plugin",
"version": "0.1.0",
"license": "MIT",
"exports": "./mod.ts"
Expand Down
22 changes: 15 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "opencode-claude-code-plugin",
"version": "0.1.2",
"name": "@khalilgharbaoui/opencode-claude-code-plugin",
"version": "0.24.0",
"description": "Claude Code CLI provider plugin for opencode",
"author": "Khalil Gharbaoui",
"type": "module",
"main": "dist/index.js",
"module": "dist/index.js",
Expand All @@ -13,20 +14,24 @@
}
},
"files": [
"dist"
"dist",
"skills"
],
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"test": "tsx --test test-bridge.ts test-broker.ts test-proxy-mcp.ts test-proxy-task.ts test-auto-continue.ts test-has-new-user-content.ts test-get-claude-user-message.ts test-logger.ts test-cli-args.ts test-session-manager.ts test-compaction-model.ts test-tool-mapping.ts test-cwd-resolution.ts test-todo-ledger.ts test-session-affinity.ts test-config-models.ts test-ask-user-question.ts test-claude-session-wrapper.ts test-spawn-env.ts test-respawn.ts test-startup-diagnostics.ts test-subagent-hint.ts test-exit-plan-mode-question.ts test-compress-tool.ts test-agent-models.ts test-side-question.ts test-btw-command.ts test-effort-sessions.ts test-tool-block-index.ts test-skill-bridge.ts test-turn-stats.ts test-cli-events.ts test-cli-events-stream.ts test-result-fallback.ts test-doctor.ts test-configure-skill.ts test-unattended-replay.ts test-process-lifecycle.ts test-account-failover.ts"
},
"dependencies": {
"@ai-sdk/provider": "^2.0.0",
"@ai-sdk/provider-utils": "^2.0.0"
"@ai-sdk/provider": "^3.0.8",
"@ai-sdk/provider-utils": "^3.0.8",
"jsonc-parser": "3.3.1"
},
"devDependencies": {
"@types/node": "^25.5.0",
"tsup": "^8.0.0",
"tsx": "^4.22.4",
"typescript": "^5.7.0"
},
"keywords": [
Expand All @@ -39,6 +44,9 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/unixfox/opencode-claude-code-plugin"
"url": "git+https://github.com/khalilgharbaoui/opencode-claude-code-plugin.git"
},
"publishConfig": {
"access": "public"
}
}
Loading