fix(agent): guide generated media into workspace out
Some checks failed
Test Suite / test (3.11) (push) Failing after 1m4s
Test Suite / test (3.12) (push) Failing after 1m8s
Test Suite / test (3.13) (push) Failing after 1m2s

This commit is contained in:
Hua
2026-03-19 17:01:10 +08:00
parent 0859d5c9f6
commit e910769a9e
5 changed files with 29 additions and 3 deletions

View File

@@ -2,10 +2,10 @@
from __future__ import annotations
import datetime as datetime_module
from datetime import datetime as real_datetime
from importlib.resources import files as pkg_files
from pathlib import Path
import datetime as datetime_module
from nanobot.agent.context import ContextBuilder
@@ -47,6 +47,16 @@ def test_system_prompt_stays_stable_when_clock_changes(tmp_path, monkeypatch) ->
assert prompt1 == prompt2
def test_system_prompt_mentions_workspace_out_for_generated_artifacts(tmp_path) -> None:
workspace = _make_workspace(tmp_path)
builder = ContextBuilder(workspace)
prompt = builder.build_system_prompt()
assert f"Put generated artifacts meant for delivery to the user under: {workspace}/out" in prompt
assert f"For QQ delivery, local images under `{workspace}/out` can be auto-published" in prompt
def test_runtime_context_is_separate_untrusted_user_message(tmp_path) -> None:
"""Runtime metadata should be merged with the user message."""
workspace = _make_workspace(tmp_path)