fix(agents): guard replay convert hook · openclaw/openclaw@54311a7
obviyus
·
2026-04-22
·
via Recent Commits to openclaw:main
File tree
1 file changed
lines changed
src/agents/pi-embedded-runner/run
1 file changed
lines changed
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1144,9 +1144,11 @@ export async function runEmbeddedAttempt(
|
1144 | 1144 | throw new Error("Embedded agent session missing"); |
1145 | 1145 | } |
1146 | 1146 | const activeSession = session; |
1147 | | -const baseConvertToLlm = activeSession.agent.convertToLlm.bind(activeSession.agent); |
1148 | | -activeSession.agent.convertToLlm = async (messages) => |
1149 | | -await baseConvertToLlm(normalizeAssistantReplayContent(messages)); |
| 1147 | +if (typeof activeSession.agent.convertToLlm === "function") { |
| 1148 | +const baseConvertToLlm = activeSession.agent.convertToLlm.bind(activeSession.agent); |
| 1149 | +activeSession.agent.convertToLlm = async (messages) => |
| 1150 | +await baseConvertToLlm(normalizeAssistantReplayContent(messages)); |
| 1151 | +} |
1150 | 1152 | let prePromptMessageCount = activeSession.messages.length; |
1151 | 1153 | abortSessionForYield = () => { |
1152 | 1154 | yieldAbortSettled = Promise.resolve(activeSession.abort()); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。