Anchor generated attachments to assistant messages
Deliverables now inherit the active assistant draft message ID so clients can render them beside the reply that produced them.
This commit is contained in:
@@ -28,6 +28,7 @@ if str(_PLUGIN_DIR) not in sys.path:
|
||||
|
||||
from pheby import protocol as proto # noqa: E402
|
||||
from pheby.attachments import AttachmentStore, constant_time_equals # noqa: E402
|
||||
from pheby.adapter import PhebyAdapter # noqa: E402
|
||||
from pheby.config import load_config # noqa: E402
|
||||
from pheby.conversations import ConversationRouter # noqa: E402
|
||||
from pheby.server import PhebyServer # noqa: E402
|
||||
@@ -344,6 +345,13 @@ class TestConversations:
|
||||
# Attachments
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
class TestAttachments:
|
||||
def test_adapter_anchors_deliverable_to_active_assistant_draft(self):
|
||||
adapter = object.__new__(PhebyAdapter)
|
||||
adapter._drafts = {"conv": {"message_id": "draft-run-1", "text": ""}}
|
||||
|
||||
assert adapter._active_assistant_message_id("conv") == "draft-run-1"
|
||||
assert adapter._active_assistant_message_id("unknown") is None
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_register_describe_download_path(self, tmp_path):
|
||||
src = Path(tmp_path) / "report.pdf"
|
||||
|
||||
Reference in New Issue
Block a user