Unhandled Promise Rejection: Bad substitution: chunks[1].startOffset

オープン
#856 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
活発
技術スタック
bash, node.js
領域
cli

調査の方向性

shell-quoteを呼び出すコマンド解析の経路から始め、次にスタックトレース内のparse.jsの箇所と、その周辺のpromiseのエラー処理を調べます。置換の失敗を引き起こす入力を特定し、コマンドが実行されるか、未処理の拒否ではなく、処理済みで明確な検証エラーが生成されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

Summary

Command Code crashes with an unhandled promise rejection when parsing a shell command.

Environment:

  • OS: Ubuntu Linux
  • Node.js: v22.20.0
  • Command Code: latest installed version
  • Shell: [bash/zsh/etc.]

Error:
CRITICAL: Unhandled Promise Rejection!
This is an unexpected error. Please file a bug report.

ERROR: Error
REASON → Bad substitution: chunks[1].startOffset

Stack trace:
Error: Bad substitution: chunks[1].startOffset
at parseEnvVar (.../command-code/node_modules/shell-quote/parse.js:171:12)
at .../command-code/node_modules/shell-quote/parse.js:256:17
at Array.map ()
at parseInternal (.../command-code/node_modules/shell-quote/parse.js:113:17)
at parse (.../command-code/node_modules/shell-quote/parse.js:309:15)
...

Trace ID:
c58b9fbd1d12acef3534f9db896e4142

The error appears to originate while parsing the shell command/environment
variable substitution through the shell-quote dependency.

Image
Expected Behavior

The command should either execute normally or return a handled/clear
validation error rather than crashing with an unhandled promise rejection.

Actual Behavior

The command should either execute normally.

Steps to reproduce the issue

The issue doesn’t require reproduction.

Command Code Version

1.53.0

Operating System

Linux

Terminal/IDE

Terminal

Shell

bash

Session file (optional)

No response

Fix prompt (optional)

No response

Additional context

This was reproduced on Ubuntu with Node.js v22.20.0.

主要言語
言語のデータがありません
スター
4k
フォーク
350
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CommandCodeAI/command-code のほかの issue

CommandCodeAI/command-code の issue をすべて見る

似ている issue

CLI の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。