Compare commits

..

1 Commits

Author SHA1 Message Date
Zamil Majdy
89745ef5ad fix: enrich description with context instead of separate parameter
The external Agent Generator service no longer accepts user_instruction
as a separate parameter. Instead, enrich the description with context
(e.g., clarifying question answers) before sending.
2026-02-02 23:20:50 +04:00
3 changed files with 8 additions and 7 deletions

View File

@@ -139,11 +139,10 @@ async def decompose_goal_external(
"""
client = _get_client()
# Build the request payload
payload: dict[str, Any] = {"description": description}
if context:
# The external service uses user_instruction for additional context
payload["user_instruction"] = context
description = f"{description}\n\nAdditional context from user:\n{context}"
payload: dict[str, Any] = {"description": description}
if library_agents:
payload["library_agents"] = library_agents

View File

@@ -102,7 +102,7 @@ class TestDecomposeGoalExternal:
@pytest.mark.asyncio
async def test_decompose_goal_with_context(self):
"""Test decomposition with additional context."""
"""Test decomposition with additional context enriched into description."""
mock_response = MagicMock()
mock_response.json.return_value = {
"success": True,
@@ -119,9 +119,12 @@ class TestDecomposeGoalExternal:
"Build a chatbot", context="Use Python"
)
expected_description = (
"Build a chatbot\n\nAdditional context from user:\nUse Python"
)
mock_client.post.assert_called_once_with(
"/api/decompose-description",
json={"description": "Build a chatbot", "user_instruction": "Use Python"},
json={"description": expected_description},
)
@pytest.mark.asyncio

View File

@@ -124,4 +124,3 @@ test("user can signup with existing email handling", async ({
console.error("❌ Duplicate email handling test failed:", error);
}
});