From ce660a4413254794baf5578060998f56451e7c55 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Mon, 16 Mar 2026 05:02:58 -0700 Subject: [PATCH] fix(gateway): remove app-specific Athabasca references from vision enrichment (#1529) Salvaged from PR #1428 by jplew. Removes Athabasca-specific persistence guidance accidentally merged in PR #1422: - Drop Athabasca docstring and injected note from _enrich_message_with_vision - Delete tests/gateway/test_image_enrichment.py (asserted app-specific behavior) Co-authored-by: jplew --- gateway/run.py | 14 ++------------ tests/gateway/test_image_enrichment.py | 25 ------------------------- 2 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 tests/gateway/test_image_enrichment.py diff --git a/gateway/run.py b/gateway/run.py index a7e637ec..ec293693 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -3620,13 +3620,9 @@ class GatewayRunner: 1. Immediately understand what the user sent (no extra tool call). 2. Re-examine the image with vision_analyze if it needs more detail. - Athabasca persistence should happen through Athabasca's own POST - /api/uploads flow, using the returned asset.publicUrl rather than local - cache paths. - Args: - user_text: The user's original caption / message text. - image_paths: List of local file paths to cached images. + user_text: The user's original caption / message text. + image_paths: List of local file paths to cached images. Returns: The enriched message string with vision descriptions prepended. @@ -3651,16 +3647,10 @@ class GatewayRunner: result = _json.loads(result_json) if result.get("success"): description = result.get("analysis", "") - athabasca_note = ( - "\n[If this image needs to persist in Athabasca state, upload the cached file " - "through Athabasca POST /api/uploads and use the returned asset.publicUrl. " - "Do not store the local cache path as the canonical imageUrl.]" - ) enriched_parts.append( f"[The user sent an image~ Here's what I can see:\n{description}]\n" f"[If you need a closer look, use vision_analyze with " f"image_url: {path} ~]" - f"{athabasca_note}" ) else: enriched_parts.append( diff --git a/tests/gateway/test_image_enrichment.py b/tests/gateway/test_image_enrichment.py deleted file mode 100644 index d3c7b72c..00000000 --- a/tests/gateway/test_image_enrichment.py +++ /dev/null @@ -1,25 +0,0 @@ -from unittest.mock import patch - -import pytest - - -@pytest.mark.asyncio -async def test_image_enrichment_uses_athabasca_upload_guidance_without_stale_r2_warning(): - from gateway.run import GatewayRunner - - runner = object.__new__(GatewayRunner) - - with patch( - "tools.vision_tools.vision_analyze_tool", - return_value='{"success": true, "analysis": "A painted serpent warrior."}', - ): - enriched = await runner._enrich_message_with_vision( - "caption", - ["/tmp/test.jpg"], - ) - - assert "R2 not configured" not in enriched - assert "Gateway media URL available for reference" not in enriched - assert "POST /api/uploads" in enriched - assert "Do not store the local cache path" in enriched - assert "caption" in enriched