惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
博客园 - 司徒正美
J
Java Code Geeks
aimingoo的专栏
aimingoo的专栏
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
D
Docker
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
腾讯CDC
V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
M
MIT News - Artificial intelligence
Jina AI
Jina AI
I
InfoQ
雷峰网
雷峰网
The Cloudflare Blog
美团技术团队
Engineering at Meta
Engineering at Meta

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: parse attached carrier option values · openclaw/open...
steipete · 2026-05-04 · via Recent Commits to openclaw:main

@@ -100,8 +100,37 @@ function optionName(token: string): string {

100100

return token.split("=", 1)[0] ?? token;

101101

}

102102103-

function hasInlineShortOptionValue(token: string): boolean {

104-

return /^-[A-Za-z].+/u.test(token) && token.length > 2;

103+

type ParsedCarrierOption = {

104+

name: string;

105+

hasInlineValue: boolean;

106+

};

107+108+

function parseCarrierOptionToken(

109+

token: string,

110+

optionsWithValue: ReadonlySet<string>,

111+

): ParsedCarrierOption {

112+

if (token.startsWith("--")) {

113+

return { name: optionName(token), hasInlineValue: token.includes("=") };

114+

}

115+

const shortName = token.slice(0, 2);

116+

if (/^-[A-Za-z]/u.test(shortName) && token.length > 2 && optionsWithValue.has(shortName)) {

117+

return { name: shortName, hasInlineValue: true };

118+

}

119+

return { name: token, hasInlineValue: false };

120+

}

121+122+

function knownCarrierOptionConsumesNextValue(

123+

option: ParsedCarrierOption,

124+

standaloneOptions: ReadonlySet<string>,

125+

optionsWithValue: ReadonlySet<string>,

126+

): boolean | null {

127+

if (standaloneOptions.has(option.name)) {

128+

return false;

129+

}

130+

if (optionsWithValue.has(option.name)) {

131+

return !option.hasInlineValue;

132+

}

133+

return null;

105134

}

106135107136

function resolveEnvSplitPayload(payload: string, depth: number): string[] | null {

@@ -138,17 +167,18 @@ function resolveEnvCarriedArgv(argv: string[], depth = 0): string[] | null {

138167

return resolveEnvSplitPayload(token.slice(2), depth);

139168

}

140169

if (token.startsWith("-")) {

141-

const normalized = optionName(token);

142-

if (ENV_STANDALONE_OPTIONS.has(normalized)) {

143-

continue;

170+

const consumeNextValue = knownCarrierOptionConsumesNextValue(

171+

parseCarrierOptionToken(token, ENV_OPTIONS_WITH_VALUE),

172+

ENV_STANDALONE_OPTIONS,

173+

ENV_OPTIONS_WITH_VALUE,

174+

);

175+

if (consumeNextValue === null) {

176+

return null;

144177

}

145-

if (ENV_OPTIONS_WITH_VALUE.has(normalized)) {

146-

if (!token.includes("=") && !hasInlineShortOptionValue(token)) {

147-

index += 1;

148-

}

149-

continue;

178+

if (consumeNextValue) {

179+

index += 1;

150180

}

151-

return null;

181+

continue;

152182

}

153183

return argv.slice(index);

154184

}

@@ -204,20 +234,22 @@ function resolveSudoLikeCarriedArgv(argv: string[]): string[] | null {

204234

if (!token.startsWith("-")) {

205235

return argv.slice(index);

206236

}

207-

const normalized = optionName(token);

208-

if (executable === "sudo" && SUDO_NON_EXEC_OPTIONS.has(normalized)) {

237+

const option = parseCarrierOptionToken(token, optionsWithValue);

238+

if (executable === "sudo" && SUDO_NON_EXEC_OPTIONS.has(option.name)) {

209239

return null;

210240

}

211-

if (standaloneOptions.has(normalized)) {

212-

continue;

241+

const consumeNextValue = knownCarrierOptionConsumesNextValue(

242+

option,

243+

standaloneOptions,

244+

optionsWithValue,

245+

);

246+

if (consumeNextValue === null) {

247+

return null;

213248

}

214-

if (optionsWithValue.has(normalized)) {

215-

if (!token.includes("=") && !hasInlineShortOptionValue(token)) {

216-

index += 1;

217-

}

218-

continue;

249+

if (consumeNextValue) {

250+

index += 1;

219251

}

220-

return null;

252+

continue;

221253

}

222254

return null;

223255

}

@@ -259,17 +291,18 @@ function resolveExecCarriedArgv(argv: string[]): string[] | null {

259291

if (!token.startsWith("-")) {

260292

return argv.slice(index);

261293

}

262-

const normalized = optionName(token);

263-

if (EXEC_STANDALONE_OPTIONS.has(normalized)) {

264-

continue;

294+

const consumeNextValue = knownCarrierOptionConsumesNextValue(

295+

parseCarrierOptionToken(token, EXEC_OPTIONS_WITH_VALUE),

296+

EXEC_STANDALONE_OPTIONS,

297+

EXEC_OPTIONS_WITH_VALUE,

298+

);

299+

if (consumeNextValue === null) {

300+

return null;

265301

}

266-

if (EXEC_OPTIONS_WITH_VALUE.has(normalized)) {

267-

if (!token.includes("=") && !hasInlineShortOptionValue(token)) {

268-

index += 1;

269-

}

270-

continue;

302+

if (consumeNextValue) {

303+

index += 1;

271304

}

272-

return null;

305+

continue;

273306

}

274307

return null;

275308

}