fix: tighten telegram docker-media salvage follow-ups

Follow-up on top of the helix4u #6392 cherry-pick:
- reuse one helper for actionable Docker-local file-not-found errors
  across document/image/video/audio local-media send paths
- include /outputs/... alongside /output/... in the container-local
  path hint
- soften the gateway startup warning so it does not imply custom
  host-visible mounts are broken; the warning now targets the specific
  risky pattern of emitting container-local MEDIA paths without an
  explicit export mount
- add focused regressions for /outputs/... and non-document media hint
  coverage

This keeps the salvage aligned with the actual MEDIA delivery problem on
current main while reducing false-positive operator messaging.
This commit is contained in:
kshitijk4poor 2026-04-19 14:08:30 +05:30 committed by kshitij
parent 588333908c
commit ff63e2e005
4 changed files with 51 additions and 18 deletions

View file

@ -496,6 +496,19 @@ class TestSendDocument:
assert "host-visible path" in result.error.lower()
connected_adapter._bot.send_document.assert_not_called()
@pytest.mark.asyncio
async def test_send_document_outputs_path_has_docker_hint(self, connected_adapter):
"""Legacy /outputs paths also get the Docker hint."""
result = await connected_adapter.send_document(
chat_id="12345",
file_path="/outputs/report.txt",
)
assert result.success is False
assert "docker sandbox" in result.error.lower()
assert "host-visible path" in result.error.lower()
connected_adapter._bot.send_document.assert_not_called()
@pytest.mark.asyncio
async def test_send_document_not_connected(self, adapter):
"""If bot is None, returns not connected error."""
@ -678,6 +691,17 @@ class TestSendVideo:
assert result.success is False
assert "not found" in result.error.lower()
@pytest.mark.asyncio
async def test_send_video_workspace_path_has_docker_hint(self, connected_adapter):
result = await connected_adapter.send_video(
chat_id="12345",
video_path="/workspace/video.mp4",
)
assert result.success is False
assert "docker sandbox" in result.error.lower()
assert "host-visible path" in result.error.lower()
@pytest.mark.asyncio
async def test_send_video_not_connected(self, adapter):
result = await adapter.send_video(