From 195c23dbb29e815bff6d3fe888e057d701930de5 Mon Sep 17 00:00:00 2001 From: Askhz <1361267452@qq.com> Date: Thu, 14 May 2026 17:00:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E7=BC=96=E8=AF=91=E5=90=8E=E4=BA=8C?= =?UTF-8?q?=E8=BF=9B=E5=88=B6=20serve=20=E5=AD=90=E8=BF=9B=E7=A8=8B=20cras?= =?UTF-8?q?h=20=E6=8A=A5=20unknown=20option=20--feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit getScriptArgsForChild() 无法正确识别编译后的二进制:argv[1] 仍为原始入口 路径(如 src/entrypoints/cli.tsx),被误判为脚本模式,导致 saveChildSpawnPrefix() 生成 --feature Bun 专有参数传给子进程,子进程不识别直接 crash。 修复:在所有判断之前增加 execPath basename 检查,非 bun/node 的可执行文件 直接视为编译二进制,返回空数组。 Co-Authored-By: CoStrict-DeepSeek-V4-Pro --- src/server/childSpawn.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/server/childSpawn.ts b/src/server/childSpawn.ts index 9ef52e639..343624ddc 100644 --- a/src/server/childSpawn.ts +++ b/src/server/childSpawn.ts @@ -1,3 +1,5 @@ +import { basename } from 'path' + export const INIT_TIMEOUT_MS = (() => { const raw = Number(process.env.CSC_SERVE_INIT_TIMEOUT_MS) return Number.isFinite(raw) && raw > 0 ? raw : 120000 @@ -6,10 +8,18 @@ export const INIT_TIMEOUT_MS = (() => { export function getScriptArgsForChild(): string[] { const argv1 = process.argv[1] if (!argv1) return [] + // If the executable is not bun/node, we're in a compiled standalone binary. + // In compiled mode, argv[1] may be the original entrypoint path (e.g. + // "src/entrypoints/cli.tsx") which looks like a script — prevent that. + const execBase = basename(process.execPath) + if (!/^(bun|node)/i.test(execBase)) return [] // Bun standalone executable embeds a virtual snapshot path like "B:/~BUN/root/cli.js". // This is not a real file on disk — skip it so the child process (the same exe) // is not launched with a bogus script argument. if (argv1.startsWith('B:/~BUN/') || argv1.startsWith('/snapshot/')) return [] + // When running as a compiled standalone binary (./csc), argv[1] is the binary + // itself — same as execPath. Do not treat it as a script file. + if (argv1 === process.execPath) return [] if (argv1.endsWith('.ts') || argv1.endsWith('.tsx') || argv1.includes('/') || argv1.includes('\\')) { return [argv1] } @@ -58,4 +68,4 @@ export function loadChildSpawnPrefix(): { execPath: string; scriptArgs: string[] } catch { return null } -} +} \ No newline at end of file From 4b7922d59bb0abf30a8d3ae66f5760799b2266b3 Mon Sep 17 00:00:00 2001 From: Askhz <1361267452@qq.com> Date: Thu, 14 May 2026 17:03:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E5=87=AD=E8=AF=81?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E6=B3=A8=E9=87=8A=E4=B8=BA=20~/.costrict/sha?= =?UTF-8?q?re/auth.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: CoStrict-DeepSeek-V4-Pro --- src/costrict/provider/credentials.ts | 4 ++-- src/services/rawDump/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/costrict/provider/credentials.ts b/src/costrict/provider/credentials.ts index 6a8544793..5fd7553fe 100644 --- a/src/costrict/provider/credentials.ts +++ b/src/costrict/provider/credentials.ts @@ -1,6 +1,6 @@ /** * CoStrict 凭证管理模块 - * 负责读写 ~/.claude/csc-auth.json + * 负责读写 ~/.costrict/share/auth.json */ import { promises as fs } from 'node:fs' @@ -62,7 +62,7 @@ export async function loadCoStrictCredentials(): Promise