CommandCodeAI / CommandCodeAI/command-code
Unhandled Promise Rejection: Bad substitution: chunks[1].startOffset
Nessuno ha ancora preso questa issue.
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 4k
- Fork
- 350
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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.
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.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dal percorso di analisi dei comandi che invoca shell-quote, quindi esamina le posizioni di parse.js nello stack trace e la gestione degli errori di promise circostante. Identifica un input che attiva il fallimento della sostituzione e verifica che il comando venga eseguito oppure produca un errore di validazione chiaro e gestito, invece di un rifiuto non gestito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- bash, node.js
- Ambito
- cli
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Attiva
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 48/100