@@ -147,8 +147,10 @@ async def test_page_missing(self):
147147 ):
148148 result = await self .assert_call ({"page" : 999 }, error = True )
149149
150- # XXX better errors might be nice, "page 999 out of range" is… likely?
151- assert result .text == "Error calling tool 'assetdb_query_list': mocked http 400"
150+ assert result .text == (
151+ "Backend rejected request. This likely means the page parameter was out of bounds. "
152+ "Next steps: check page 1, or try a simpler search. Original error: mocked http 400"
153+ )
152154
153155 @json_guard_parametrize ([5 , 10 ])
154156 async def test_page_size (self , mangle , value ):
@@ -220,7 +222,9 @@ async def test_not_found(self):
220222 ):
221223 result = await self .assert_call ({"query_id" : 999 }, error = True )
222224
223- # XXX better errors might be nice, "query 999 does not exist"
225+ # Generally, this is enough context for the LLM to handle it fine.
226+ # Annotated errors come into their own when the meaning of a raw
227+ # error is not immediately obvious.
224228 assert result .text == "Error calling tool 'assetdb_query_get': mocked http 404"
225229
226230
@@ -437,7 +441,7 @@ async def assert_tool_call(self, params, *expect_http, expect_error=None):
437441 result = await self .assert_call (params , error = bool (expect_error ))
438442
439443 if expect_error :
440- assert result .text == f"Error calling tool ' { self . tool_name } ': " + expect_error
444+ assert result .text == expect_error
441445 else :
442446 self .assert_tool_query_result (result )
443447
@@ -549,7 +553,10 @@ async def test_job_timeout(self, mangle, value, async_sleeps):
549553 self .expect_get_job (self .job_response (JobStatus .STARTED )),
550554 self .expect_get_job (self .job_response (JobStatus .STARTED )),
551555 self .expect_get_job (self .job_response (JobStatus .STARTED )),
552- expect_error = "Query execution timed out after 60 seconds" ,
556+ expect_error = (
557+ "Timed out after 60 seconds. This likely means the query is still executing. "
558+ "Next steps: request cached results (with max_age=-1), or try a simpler query"
559+ ),
553560 )
554561 assert async_sleeps == [2 , 4 , 8 , 16 , 30 ]
555562
@@ -559,7 +566,11 @@ async def test_job_failure(self):
559566 {"query_id" : self .QUERY_ID },
560567 self .expect_post (self .post_data (), self .job_response (JobStatus .QUEUED )),
561568 self .expect_get_job (self .job_response (JobStatus .FAILED )),
562- expect_error = "Query execution failed: Oh no borken" ,
569+ expect_error = (
570+ "Query execution error: Oh no borken. This likely means the query SQL or "
571+ "parameters were invalid. Next steps: investigate the errors, or try a simpler "
572+ "query and build up"
573+ ),
563574 )
564575
565576 async def test_job_cancellation (self ):
@@ -570,7 +581,11 @@ async def test_job_cancellation(self):
570581 {"query_id" : self .QUERY_ID },
571582 self .expect_post (self .post_data (), self .job_response (JobStatus .QUEUED )),
572583 self .expect_get_job (self .job_response (JobStatus .CANCELED )),
573- expect_error = "Query execution failed: Unknown error." ,
584+ expect_error = (
585+ "Query execution error: (unknown). This likely means the query SQL or "
586+ "parameters were invalid. Next steps: investigate the errors, or try a simpler "
587+ "query and build up"
588+ ),
574589 )
575590
576591
@@ -641,7 +656,10 @@ async def test_job_timeout(self, mangle, value, async_sleeps):
641656 self .expect_get_job (self .job_response (JobStatus .STARTED )),
642657 self .expect_get_job (self .job_response (JobStatus .STARTED )),
643658 self .expect_get_job (self .job_response (JobStatus .STARTED )),
644- expect_error = "Query execution timed out after 60 seconds" ,
659+ expect_error = (
660+ "Timed out after 60 seconds. This likely means the query is still executing. "
661+ "Next steps: request cached results (with max_age=-1), or try a simpler query"
662+ ),
645663 )
646664 assert async_sleeps == [2 , 4 , 8 , 16 , 30 ]
647665
@@ -651,7 +669,11 @@ async def test_job_failure(self):
651669 {"query" : "SELECT 1" },
652670 self .expect_post (self .post_data (), self .job_response (JobStatus .QUEUED )),
653671 self .expect_get_job (self .job_response (JobStatus .FAILED )),
654- expect_error = "Query execution failed: Oh no borken" ,
672+ expect_error = (
673+ "Query execution error: Oh no borken. This likely means the query SQL or "
674+ "parameters were invalid. Next steps: investigate the errors, or try a simpler "
675+ "query and build up"
676+ ),
655677 )
656678
657679 async def test_job_cancellation (self ):
@@ -662,7 +684,11 @@ async def test_job_cancellation(self):
662684 {"query" : "SELECT 1" },
663685 self .expect_post (self .post_data (), self .job_response (JobStatus .QUEUED )),
664686 self .expect_get_job (self .job_response (JobStatus .CANCELED )),
665- expect_error = "Query execution failed: Unknown error." ,
687+ expect_error = (
688+ "Query execution error: (unknown). This likely means the query SQL or "
689+ "parameters were invalid. Next steps: investigate the errors, or try a simpler "
690+ "query and build up"
691+ ),
666692 )
667693
668694
0 commit comments