[GH-ISSUE #22] Bug: Cross-tool handoff to OpenCode fails with 'Command exited with code 1' #11

Closed
opened 2026-03-04 01:39:12 +03:00 by kerem · 3 comments
Owner

Originally created by @DaveW001 on GitHub (Mar 1, 2026).
Original GitHub issue: https://github.com/yigitkonur/cli-continues/issues/22

Bug Description

Cross-tool handoff TO OpenCode fails when using continues resume <id> --in opencode. The command exits with code 1 and displays the OpenCode help menu instead of launching with the session context.

Environment

  • OS: Windows 11
  • Node.js: v22.x
  • continues version: Latest (installed via npm install -g continues)
  • OpenCode version: 1.2.15
  • Shell: PowerShell/Git Bash

Steps to Reproduce

  1. Install continues: npm install -g continues
  2. Have an existing session in another tool (e.g., Gemini CLI)
  3. Run the handoff command:
    continues resume <session-id> --in opencode
    

Expected Behavior

OpenCode should launch with the session context from the source tool loaded and ready to continue.

Actual Behavior

◇  Handing off to opencode...
│
└  Launching opencode

[OpenCode ASCII art/logo displays]

Commands:
  opencode completion          generate shell completion script
  opencode acp                 start ACP (Agent Client Protocol) server
  ...
  
■  Command exited with code 1

The OpenCode help menu is displayed instead of launching with context, indicating argument parsing failure.

Error Details

When running with --verbose, a DeprecationWarning appears:

DeprecationWarning: Passing args to a child process with shell option true 
can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
    at normalizeSpawnArguments (node:child_process:644:15)
    at spawn (node:child_process:789:13)
    at file:///.../continues/dist/utils/resume.js:103:23

Root Cause Analysis

The issue appears to be in how continues spawns the OpenCode process with session context arguments. OpenCode 1.2.15+ may have different CLI argument parsing than expected by the current implementation in src/utils/resume.js.

Additional Context

  • Handoff TO OpenCode fails: continues resume <gemini-session> --in opencode
  • Session discovery and inspection work correctly

The issue likely stems from:

  • src/utils/resume.js around line 103 (spawn logic)
  • Argument formatting for OpenCode specifically
  • Possible mismatch between expected and actual OpenCode CLI interface

Labels

bug, compatibility, opencode

Originally created by @DaveW001 on GitHub (Mar 1, 2026). Original GitHub issue: https://github.com/yigitkonur/cli-continues/issues/22 ## Bug Description Cross-tool handoff **TO OpenCode** fails when using `continues resume <id> --in opencode`. The command exits with code 1 and displays the OpenCode help menu instead of launching with the session context. ## Environment - **OS**: Windows 11 - **Node.js**: v22.x - **continues version**: Latest (installed via `npm install -g continues`) - **OpenCode version**: 1.2.15 - **Shell**: PowerShell/Git Bash ## Steps to Reproduce 1. Install continues: `npm install -g continues` 2. Have an existing session in another tool (e.g., Gemini CLI) 3. Run the handoff command: ```bash continues resume <session-id> --in opencode ``` ## Expected Behavior OpenCode should launch with the session context from the source tool loaded and ready to continue. ## Actual Behavior ``` ◇ Handing off to opencode... │ └ Launching opencode [OpenCode ASCII art/logo displays] Commands: opencode completion generate shell completion script opencode acp start ACP (Agent Client Protocol) server ... ■ Command exited with code 1 ``` The OpenCode help menu is displayed instead of launching with context, indicating argument parsing failure. ## Error Details When running with `--verbose`, a DeprecationWarning appears: ``` DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated. at normalizeSpawnArguments (node:child_process:644:15) at spawn (node:child_process:789:13) at file:///.../continues/dist/utils/resume.js:103:23 ``` ## Root Cause Analysis The issue appears to be in how `continues` spawns the OpenCode process with session context arguments. OpenCode 1.2.15+ may have different CLI argument parsing than expected by the current implementation in `src/utils/resume.js`. ## Additional Context - **Handoff TO OpenCode fails**: `continues resume <gemini-session> --in opencode` ❌ - Session discovery and inspection work correctly ## Related Code The issue likely stems from: - `src/utils/resume.js` around line 103 (spawn logic) - Argument formatting for OpenCode specifically - Possible mismatch between expected and actual OpenCode CLI interface ## Labels bug, compatibility, opencode
kerem closed this issue 2026-03-04 01:39:13 +03:00
Author
Owner

@DaveW001 commented on GitHub (Mar 1, 2026):

🔬 Additional Validation Testing, Insights

I've completed some more testing of the continues tool on Windows 11 with Node.js v22.x. Here are the results:

Test Environment

  • OS: Windows 11
  • Node.js: v22.x
  • continues: Latest (installed via npm)
  • OpenCode: 1.2.15
  • Gemini CLI: 0.30.1
  • Other tools: Not installed (cannot test)

What Works

  1. Session Discovery - Finds 1,256 sessions across OpenCode, Gemini, and Codex
  2. Export/Inspect - 100% reliable for all tools (tested all 3)
  3. OpenCode Native Resume - continues opencode works perfectly

Issues Confirmed

1. OpenCode Handoff (This Issue)

  • Status: CONFIRMED - Same failure as reported
  • Command: continues resume <id> --in opencode
  • Error: Shows OpenCode help menu, exits code 1
  • Workaround: Use continues inspect --write-md + manual import

2. Gemini Native Resume (NEW BUG)

  • Status: NEW ISSUE DISCOVERED
  • Command: continues gemini
  • Error: Unknown argument: continue
  • Root Cause: passes continue instead of --resume

Compatibility Matrix

Feature Status
Export/Inspect 100%
OpenCode native resume Works
Gemini native resume Broken
Handoff TO OpenCode Broken
Handoff FROM OpenCode ⚠️ Needs more testing

Bottom Line: The tool works great for discovery and export (read-only operations), but automatic handoff has compatibility issues with OpenCode and Gemini that need fixing.

<!-- gh-comment-id:3981024340 --> @DaveW001 commented on GitHub (Mar 1, 2026): ## 🔬 Additional Validation Testing, Insights I've completed some more testing of the continues tool on Windows 11 with Node.js v22.x. Here are the results: ### Test Environment - **OS:** Windows 11 - **Node.js:** v22.x - **continues:** Latest (installed via npm) - **OpenCode:** 1.2.15 ✅ - **Gemini CLI:** 0.30.1 ✅ - **Other tools:** Not installed (cannot test) ### ✅ What Works 1. **Session Discovery** - Finds 1,256 sessions across OpenCode, Gemini, and Codex 2. **Export/Inspect** - 100% reliable for all tools (tested all 3) 3. **OpenCode Native Resume** - `continues opencode` works perfectly ### ❌ Issues Confirmed **1. OpenCode Handoff (This Issue)** - Status: ✅ **CONFIRMED** - Same failure as reported - Command: `continues resume <id> --in opencode` - Error: Shows OpenCode help menu, exits code 1 - Workaround: Use `continues inspect --write-md` + manual import **2. Gemini Native Resume (NEW BUG)** - Status: ❌ **NEW ISSUE DISCOVERED** - Command: `continues gemini` - Error: `Unknown argument: continue` - Root Cause: passes `continue` instead of `--resume` ### Compatibility Matrix | Feature | Status | |---------|--------| | Export/Inspect | ✅ 100% | | OpenCode native resume | ✅ Works | | Gemini native resume | ❌ Broken | | Handoff TO OpenCode | ❌ Broken | | Handoff FROM OpenCode | ⚠️ Needs more testing | --- **Bottom Line:** The tool works great for discovery and export (read-only operations), but automatic handoff has compatibility issues with OpenCode and Gemini that need fixing.
Author
Owner

@yigitkonur commented on GitHub (Mar 2, 2026):

hey @DaveW001 — this should be fixed in #29. turned out to be three bugs stacked on top of each other:

  • opencode was getting --prompt which doesn't exist on its run subcommand (yargs strict mode → help menu → exit 1)
  • gemini native resume was using --continue instead of --resume
  • windows spawn was hitting node 22 DEP0190 because args weren't being quoted with shell: true

would you mind giving it a spin once it's merged and letting me know if it works on your end? thanks for the detailed report, made it way easier to track down.

<!-- gh-comment-id:3986806639 --> @yigitkonur commented on GitHub (Mar 2, 2026): hey @DaveW001 — this should be fixed in #29. turned out to be three bugs stacked on top of each other: - opencode was getting `--prompt` which doesn't exist on its `run` subcommand (yargs strict mode → help menu → exit 1) - gemini native resume was using `--continue` instead of `--resume` - windows spawn was hitting node 22 DEP0190 because args weren't being quoted with `shell: true` would you mind giving it a spin once it's merged and letting me know if it works on your end? thanks for the detailed report, made it way easier to track down.
Author
Owner

@DaveW001 commented on GitHub (Mar 3, 2026):

Retest Results (v4.0.9)

Tested the fixes by building from GitHub main branch (v4.0.9) on Windows 11.

Test Results

Test Prior Behavior New Behavior Status
Gemini native resume Unknown argument: continue Successfully launches Gemini with session FIXED
Gemini → OpenCode handoff Help menu shown, exit code 1 Launches OpenCode with context FIXED
OpenCode → Gemini handoff ⚠️ Timeout before confirmation Successfully transfers context WORKS
OpenCode native resume Working Still working NO REGRESSION

Before (v2.3.0)

$ continues gemini
Unknown argument: continue
$ continues resume d27e2340 --in opencode
[OpenCode help menu displays]
■  Command exited with code 1

After (v4.0.9)

$ continues gemini
Resuming gemini session #1:
[gemini]   2026-02-28 17:25  [Assistant Rules...]  d27e2340
$ continues resume d27e2340 --in opencode
Session: [gemini] 2026-02-28 17:25  d27e2340-20c
Command: continues resume d27e2340-20c7-4267-a2dd-054d3da03123 --in opencode
> 01-Planner · glm-4.7
I'll read the `.continues-handoff.md` file to understand the context...

Thank you for the quick fix! 🎉

Note: The npm package (2.4.3) still shows v2.3.0 and doesn't include these fixes yet. Users will need to build from source until v4.0.9 is published to npm.

<!-- gh-comment-id:3991758897 --> @DaveW001 commented on GitHub (Mar 3, 2026): ## Retest Results (v4.0.9) Tested the fixes by building from GitHub main branch (v4.0.9) on Windows 11. ### Test Results | Test | Prior Behavior | New Behavior | Status | |------|----------------|--------------|--------| | Gemini native resume | ❌ `Unknown argument: continue` | ✅ Successfully launches Gemini with session | ✅ **FIXED** | | Gemini → OpenCode handoff | ❌ Help menu shown, exit code 1 | ✅ Launches OpenCode with context | ✅ **FIXED** | | OpenCode → Gemini handoff | ⚠️ Timeout before confirmation | ✅ Successfully transfers context | ✅ **WORKS** | | OpenCode native resume | ✅ Working | ✅ Still working | ✅ **NO REGRESSION** | ### Before (v2.3.0) ``` $ continues gemini Unknown argument: continue ``` ``` $ continues resume d27e2340 --in opencode [OpenCode help menu displays] ■ Command exited with code 1 ``` ### After (v4.0.9) ``` $ continues gemini Resuming gemini session #1: [gemini] 2026-02-28 17:25 [Assistant Rules...] d27e2340 ``` ``` $ continues resume d27e2340 --in opencode Session: [gemini] 2026-02-28 17:25 d27e2340-20c Command: continues resume d27e2340-20c7-4267-a2dd-054d3da03123 --in opencode > 01-Planner · glm-4.7 I'll read the `.continues-handoff.md` file to understand the context... ``` Thank you for the quick fix! 🎉 **Note:** The npm package (2.4.3) still shows v2.3.0 and doesn't include these fixes yet. Users will need to build from source until v4.0.9 is published to npm.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cli-continues#11
No description provided.