feat: fix todos (#9)

This commit is contained in:
DanielWalnut
2026-01-17 23:23:12 +08:00
committed by GitHub
parent 3f1f6af30c
commit aa030410fc
10 changed files with 234 additions and 141 deletions

View File

@@ -34,7 +34,8 @@ def present_file_tool(
filepaths: List of absolute file paths to present to the user. **Only** files in `/mnt/user-data/outputs` can be presented.
"""
existing_artifacts = runtime.state.get("artifacts") or []
new_artifacts = existing_artifacts + filepaths
# Use dict.fromkeys to deduplicate while preserving order
new_artifacts = list(dict.fromkeys(existing_artifacts + filepaths))
runtime.state["artifacts"] = new_artifacts
return Command(
update={"artifacts": new_artifacts, "messages": [ToolMessage("Successfully presented files", tool_call_id=tool_call_id)]},