fix: use temp file for message to avoid shell parsing issues #196

Merged
shoko merged 1 commits from fix/issue-message-encoding into main 2026-04-07 04:27:50 +02:00
Owner

Bug

When cmd_start, cmd_continue, or cmd_delegate pass messages to opencode run, the message contains newlines and special characters (parentheses, etc.) which break shell parsing.

Error seen:

sh: -c: line 9: syntax error near unexpected token `('
sh: -c: line 9: `3. Read README.md (if exists) to understand the general concept of this repository'

Fix

Write message to a temp file and use @msg_file syntax to pass to opencode run. This handles any characters in the message without shell parsing issues.

Changes in kugetsu-session.sh:

  • cmd_delegate: Use temp file for message
  • cmd_start: Use temp file for dev_message
  • cmd_continue: Use temp file for message

Temp file is cleaned up after the command starts.

## Bug When cmd_start, cmd_continue, or cmd_delegate pass messages to `opencode run`, the message contains newlines and special characters (parentheses, etc.) which break shell parsing. Error seen: ``` sh: -c: line 9: syntax error near unexpected token `(' sh: -c: line 9: `3. Read README.md (if exists) to understand the general concept of this repository' ``` ## Fix Write message to a temp file and use `@msg_file` syntax to pass to `opencode run`. This handles any characters in the message without shell parsing issues. Changes in `kugetsu-session.sh`: - `cmd_delegate`: Use temp file for message - `cmd_start`: Use temp file for dev_message - `cmd_continue`: Use temp file for message Temp file is cleaned up after the command starts.
shoko added 1 commit 2026-04-07 03:55:54 +02:00
The message passed to opencode run contains newlines and special
characters (parentheses, etc.) which break shell parsing when passed
directly in double quotes.

Fix by writing message to temp file and using '@msg_file' syntax
to pass to opencode run. This handles any characters in the message.
shoko merged commit e666f4dffb into main 2026-04-07 04:27:50 +02:00
Sign in to join this conversation.