fix(agents): scope Claude JSON unwrapping · openclaw/openclaw@1c77515
obviyus
·
2026-04-26
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -267,14 +267,10 @@ function pickCliSessionId(
|
267 | 267 | } |
268 | 268 | |
269 | 269 | function shouldUnwrapNestedCliResultText(params: { |
270 | | -backend: CliBackendConfig; |
271 | 270 | providerId?: string; |
272 | 271 | parsed: Record<string, unknown>; |
273 | 272 | }): boolean { |
274 | | -const isClaudeBackend = |
275 | | -(params.providerId && isClaudeCliProvider(params.providerId)) || |
276 | | -/^claude(?:$|[\\/-])/i.test(params.backend.command.trim()); |
277 | | -if (!isClaudeBackend) { |
| 273 | +if (!params.providerId || !isClaudeCliProvider(params.providerId)) { |
278 | 274 | return false; |
279 | 275 | } |
280 | 276 | return !Object.hasOwn(params.parsed, "type") || params.parsed.type === "result"; |
@@ -304,7 +300,7 @@ export function parseCliJson(
|
304 | 300 | collectCliText(parsed.response) || |
305 | 301 | collectCliText(parsed); |
306 | 302 | const trimmedText = ( |
307 | | -shouldUnwrapNestedCliResultText({ backend, providerId, parsed }) |
| 303 | +shouldUnwrapNestedCliResultText({ providerId, parsed }) |
308 | 304 | ? unwrapNestedCliResultText(nextText) |
309 | 305 | : nextText |
310 | 306 | ).trim(); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。