fix: repair codex context-engine test typing · openclaw/openclaw@639107b
jalehman
·
2026-05-16
·
via Recent Commits to openclaw:main
File tree
extensions/codex/src/app-server
| Original file line number | Diff line number | Diff line change |
|---|
@@ -823,9 +823,16 @@ describe("runCodexAppServerAttempt context-engine lifecycle", () => {
|
823 | 823 | expect(assemble).toHaveBeenCalledTimes(2); |
824 | 824 | const retryAssembleParams = assemble.mock.calls[1]?.[0]; |
825 | 825 | expect(retryAssembleParams?.messages.map((message) => message.role)).toEqual(["assistant"]); |
826 | | -expect( |
827 | | -retryAssembleParams?.messages.map((message) => String(message.content?.[0]?.text)), |
828 | | -).toEqual(["successor compacted context"]); |
| 826 | +const retryAssembleMessageTexts = retryAssembleParams?.messages.map((message) => { |
| 827 | +if (!("content" in message) || !Array.isArray(message.content)) { |
| 828 | +return ""; |
| 829 | +} |
| 830 | +const firstContent = message.content[0]; |
| 831 | +return typeof firstContent === "object" && firstContent !== null && "text" in firstContent |
| 832 | + ? String(firstContent.text) |
| 833 | + : ""; |
| 834 | +}); |
| 835 | +expect(retryAssembleMessageTexts).toEqual(["successor compacted context"]); |
829 | 836 | const retryInputText = getRequestInputTextAt(harness, -1); |
830 | 837 | expect(retryInputText).toContain("successor compacted context"); |
831 | 838 | expect(retryInputText).not.toContain("pre-compaction context"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。