feat(deploy): finalize MVP deployment and file transfer approach

This commit is contained in:
Mikhail Putilovskij 2026-05-02 23:45:52 +03:00
parent 6369721876
commit 0f79494fbe
43 changed files with 3078 additions and 645 deletions

View file

@ -185,6 +185,24 @@ async def test_real_platform_client_send_message_uses_direct_agent_api_per_chat(
assert await prototype_state.get_last_tokens_used_for_context("chat-7") == 0
@pytest.mark.asyncio
async def test_real_platform_client_preserves_path_base_url_without_trailing_slash():
agent_api = FakeAgentApiFactory()
client = RealPlatformClient(
agent_id="agent-17",
agent_base_url="http://lambda.coredump.ru:7000/agent_17",
agent_api_cls=agent_api,
prototype_state=PrototypeStateStore(),
platform="matrix",
)
await client.send_message("@alice:example.org", "41", "hello")
assert agent_api.created_calls == [
("agent-17", "http://lambda.coredump.ru:7000/agent_17/", "41")
]
@pytest.mark.asyncio
async def test_real_platform_client_forwards_attachments_to_chat_api():
agent_api = FakeAgentApiFactory(chat_api_cls=AttachmentTrackingChatAgentApi)
@ -213,15 +231,15 @@ async def test_real_platform_client_forwards_attachments_to_chat_api():
def test_attachment_paths_normalize_workspace_roots_to_relative_paths():
attachments = [
Attachment(workspace_path="/workspace/output/report.pdf"),
Attachment(workspace_path="/agents/7/output/report.csv"),
Attachment(workspace_path="surfaces/matrix/alice/room/inbox/note.txt"),
Attachment(workspace_path="/workspace/report.pdf"),
Attachment(workspace_path="/agents/7/report.csv"),
Attachment(workspace_path="note.txt"),
]
assert RealPlatformClient._attachment_paths(attachments) == [
"output/report.pdf",
"output/report.csv",
"surfaces/matrix/alice/room/inbox/note.txt",
"report.pdf",
"report.csv",
"note.txt",
]
@ -257,9 +275,12 @@ async def test_real_platform_client_preserves_send_file_events_in_sync_result(mo
@pytest.mark.parametrize(
("location", "expected_workspace_path"),
[
("/workspace/output/report.pdf", "output/report.pdf"),
("/agents/7/output/report.pdf", "output/report.pdf"),
("surfaces/matrix/alice/room/inbox/report.pdf", "surfaces/matrix/alice/room/inbox/report.pdf"),
("/workspace/report.pdf", "report.pdf"),
("/agents/7/report.pdf", "report.pdf"),
(
"surfaces/matrix/alice/room/inbox/report.pdf",
"surfaces/matrix/alice/room/inbox/report.pdf",
),
],
)
def test_attachment_from_send_file_event_normalizes_shared_volume_paths(