Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

fix(compile): accept preserve_complete in child preview hook (#6696)

Vladimir Babin6b92f9f691ea
diff --git a/bot/tests/test_compile_preview_hook_signature.py b/bot/tests/test_compile_preview_hook_signature.py
new file mode 100644
index 000000000..91b241ae7
--- /dev/null
+++ b/bot/tests/test_compile_preview_hook_signature.py
@@ -0,0 +1,16 @@
+# Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
+# SPDX-License-Identifier: AGPL-3.0
+
+"""Regression: the Compile preview hook must accept the keyword arguments the
+AgentLoop preview hook is invoked with."""
+
+import pytest
+from vikingbot.compile.pipeline_agent import complete_tool_result
+
+
[email protected]("preserve_complete", [False, True])
+async def test_complete_tool_result_accepts_preserve_complete(preserve_complete):
+ result = await complete_tool_result(
+ "payload", "session-key", preserve_complete=preserve_complete
+ )
+ assert result == "payload"
diff --git a/bot/vikingbot/compile/pipeline_agent.py b/bot/vikingbot/compile/pipeline_agent.py
index 900089f2e..5004b633d 100644
--- a/bot/vikingbot/compile/pipeline_agent.py
+++ b/bot/vikingbot/compile/pipeline_agent.py
@@ -52,7 +52,7 @@ class ChildProvider(LLMProvider):
messages = [*messages, {"role": "user", "content": error}]
-async def complete_tool_result(result, session_key):
+async def complete_tool_result(result, session_key, *, preserve_complete: bool = False):
"""Keep scoped tool evidence complete for subsequent model requests.
Child file tools cannot read shared preview spill files, so head/tail previews