test(agents): avoid redundant guard scope spread · openclaw/openclaw@0d3b74e
steipete
·
2026-05-05
·
via Recent Commits to openclaw:main
File tree
src/agents/pi-embedded-runner
| Original file line number | Diff line number | Diff line change |
|---|
@@ -50,16 +50,18 @@ function recordToolOutcome(
|
50 | 50 | runId?: string, |
51 | 51 | ): void { |
52 | 52 | const toolCallId = `${toolName}-${state.toolOutcomeSeq ?? 0}`; |
53 | | -recordToolCall(state, toolName, toolParams, toolCallId, undefined, { |
54 | | - ...(runId ? { runId } : {}), |
55 | | -}); |
56 | | -recordToolCallOutcome(state, { |
| 53 | +const scope = runId ? { runId } : undefined; |
| 54 | +recordToolCall(state, toolName, toolParams, toolCallId, undefined, scope); |
| 55 | +const outcome: Parameters<typeof recordToolCallOutcome>[1] = { |
57 | 56 | toolName, |
58 | 57 | toolParams, |
59 | 58 | toolCallId, |
60 | 59 | result, |
61 | | - ...(runId ? { runId } : {}), |
62 | | -}); |
| 60 | +}; |
| 61 | +if (runId) { |
| 62 | +outcome.runId = runId; |
| 63 | +} |
| 64 | +recordToolCallOutcome(state, outcome); |
63 | 65 | } |
64 | 66 | |
65 | 67 | describe("post-compaction loop guard wired into runEmbeddedPiAgent", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。