claude-bridge-cli 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bridge.js +12 -5
- package/package.json +1 -1
package/lib/bridge.js
CHANGED
|
@@ -418,11 +418,18 @@ function askClaude(config, { prompt, session_id, images, cwd, plan_mode, allow_t
|
|
|
418
418
|
const isWin = process.platform === "win32";
|
|
419
419
|
const isCmdShim = isWin && config.claudeBin.endsWith(".cmd");
|
|
420
420
|
|
|
421
|
-
//
|
|
422
|
-
// cmd.exe's ~8K arg limit
|
|
423
|
-
//
|
|
424
|
-
//
|
|
425
|
-
|
|
421
|
+
// Fall back to @file syntax in two cases:
|
|
422
|
+
// 1) Prompt exceeds Windows cmd.exe's ~8K arg limit (threshold 6000).
|
|
423
|
+
// 2) Prompt contains a newline AND we're on Windows with a .cmd shim
|
|
424
|
+
// — cmd.exe parses arg strings line-by-line and silently truncates
|
|
425
|
+
// at the first \n, even with Node.js's proper argv quoting. Without
|
|
426
|
+
// this fallback, any multi-line prompt to Claude on Windows lost
|
|
427
|
+
// everything after line 1, and the model saw a stub message + the
|
|
428
|
+
// header but none of the body. Manifested as "your message got
|
|
429
|
+
// cut off" responses for prompts that LOOK short.
|
|
430
|
+
const useTempFile =
|
|
431
|
+
finalPrompt.length > 6000 ||
|
|
432
|
+
(isWin && isCmdShim && /\r|\n/.test(finalPrompt));
|
|
426
433
|
let tmpFile = null;
|
|
427
434
|
if (useTempFile) {
|
|
428
435
|
tmpFile = path.join(os.tmpdir(), `claude-prompt-${Date.now()}-${Math.random().toString(36).slice(2)}.txt`);
|
package/package.json
CHANGED