fix(session): replay user images from stored attachments (#6720)
This commit is contained in:
1 parent
488b657ee1
commit
3025a01cf0
29 files changed
+456
-281
No files matched your search
@@ -10,7 +10,6 @@ from nanobot.utils.helpers import (
|
||||
_write_text_atomic,
|
||||
atomic_write_lines,
|
||||
atomic_write_text,
|
||||
content_with_media_breadcrumbs,
|
||||
split_message,
|
||||
truncate_text_to_tokens,
|
||||
)
|
||||
@@ -124,33 +123,6 @@ def test_truncate_text_to_tokens_non_positive_budget_returns_text():
|
||||
assert truncate_text_to_tokens(text, 0) == text
|
||||
|
||||
|
||||
def test_content_with_media_breadcrumbs_preserves_valid_paths():
|
||||
assert content_with_media_breadcrumbs(
|
||||
"user",
|
||||
"review these",
|
||||
["/media/report.pdf", "/media/clip.mp4"],
|
||||
) == (
|
||||
"review these\n"
|
||||
"[image: /media/report.pdf]\n"
|
||||
"[image: /media/clip.mp4]"
|
||||
)
|
||||
|
||||
|
||||
def test_content_with_media_breadcrumbs_only_rewrites_plain_user_content():
|
||||
structured = [{"type": "text", "text": "hello"}]
|
||||
|
||||
assert content_with_media_breadcrumbs(
|
||||
"assistant",
|
||||
"done",
|
||||
["/media/output.png"],
|
||||
) == "done"
|
||||
assert content_with_media_breadcrumbs(
|
||||
"user",
|
||||
structured,
|
||||
["/media/input.png"],
|
||||
) is structured
|
||||
|
||||
|
||||
def test_write_text_atomic_fsyncs_file_and_parent_directory(
|
||||
tmp_path: Path, monkeypatch
|
||||
) -> None:
|
||||
|
||||
Reference in new issue
Block a user