Component: finbot/agents/chat.py → VendorChatAssistant._call_start_workflow (line 229)
Root cause:
Same as CHAT-BOUNDARY-012. When both description=None and vendor_id=None are passed,
description[:100] on line 229 crashes first. The crash masks the vendor_id=None gap
(TICKET 9) — neither field is validated before the exception is raised.
Steps to reproduce:
- Call
_call_start_workflow(None, vendor_id=None).
Expected: {"error": "description and vendor_id are required"}
Actual: TypeError: 'NoneType' object is not subscriptable
How to execute:
pytest tests/unit/agents/test_chat_assistant.py::TestBoundaryAndTypeValues::test_chat_boundary_013_both_required_fields_none_crashes -v
Proposed fix: Same unified guard as TICKET 10 — check both fields at the top of
the method before any other logic runs.
Impact: The most degenerate possible LLM tool call — all required fields absent —
produces an unhandled crash rather than a recoverable error. Resolving TICKETS 9, 10,
and 11 together with a single early-return guard covers all combinations.
Acceptance criteria:
test_chat_boundary_013_both_required_fields_none_crashes updated to assert error JSON
- Single guard at method entry handles
description is None OR vendor_id is None
Component: finbot/agents/chat.py → VendorChatAssistant._call_start_workflow (line 229)
Root cause:
Same as CHAT-BOUNDARY-012. When both
description=Noneandvendor_id=Noneare passed,description[:100]on line 229 crashes first. The crash masks thevendor_id=Nonegap(TICKET 9) — neither field is validated before the exception is raised.
Steps to reproduce:
_call_start_workflow(None, vendor_id=None).Expected:
{"error": "description and vendor_id are required"}Actual:
TypeError: 'NoneType' object is not subscriptableHow to execute:
Proposed fix: Same unified guard as TICKET 10 — check both fields at the top of
the method before any other logic runs.
Impact: The most degenerate possible LLM tool call — all required fields absent —
produces an unhandled crash rather than a recoverable error. Resolving TICKETS 9, 10,
and 11 together with a single early-return guard covers all combinations.
Acceptance criteria:
test_chat_boundary_013_both_required_fields_none_crashesupdated to assert error JSONdescription is NoneORvendor_id is None