fix: improved error reporting; codex cli would at times fail to figure out how to handle plain-text / JSON errors

fix: working directory should exist, raise error and not try and create one
docs: improved API Lookup instructions
* test added to confirm failures
* chat schema more explicit about file paths
This commit is contained in:
Fahad
2025-10-17 23:42:32 +04:00
parent 71796c0c70
commit 95e69a7cb2
24 changed files with 569 additions and 337 deletions

View File

@@ -8,6 +8,7 @@ import pytest
from tools.models import ToolModelCategory
from tools.planner import PlannerRequest, PlannerTool
from tools.shared.exceptions import ToolExecutionError
class TestPlannerTool:
@@ -340,16 +341,12 @@ class TestPlannerTool:
# Missing required fields: step_number, total_steps, next_step_required
}
result = await tool.execute(arguments)
with pytest.raises(ToolExecutionError) as exc_info:
await tool.execute(arguments)
# Should return error response
assert len(result) == 1
response_text = result[0].text
# Parse the JSON response
import json
parsed_response = json.loads(response_text)
parsed_response = json.loads(exc_info.value.payload)
assert parsed_response["status"] == "planner_failed"
assert "error" in parsed_response