Repository navigation
Report get_document read failures as tool errors - #727
Merged
Merged
Conversation
Signed-off-by: mayakid <29959320+mayakid@users.noreply.github.com>
Contributor
|
Merged — thank you. Verified locally too: the two regressions fail on dev with only |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
get_documentcurrently reports a failed document lookup as a successful "not found" result. If the lookup succeeds but reading its chunks fails, it instead returns a successful empty document. Both can make a caller treat a storage failure as an answer about the document.Handle both database errors explicitly, log the underlying error server-side, and return
isError: truewith "Could not read the document." This extends the read-error handling in #604 toget_document. Missing, deleted and foreign-KB documents retain the same indistinguishable response; genuinely empty documents still succeed. No dependencies, migrations or structured output fields change.Regression coverage uses a closed pool for lookup failure and a connection-local search path with an incomplete
chunksview for chunk-read failure. The latter verifies that the document lookup succeeds first and does not alter shared tables. Normal, empty, missing, deleted and foreign-KB reads are also covered through the authenticated MCP handler.Validation:
UTOPIA_TEST_REQUIRE_DB=1.cargo test --workspacepasses (826 passed, 1 ignored, database-gated cases skipped as in the backend CI job).Additional runs against the SSH-forwarded database were not fully green: two pipeline timing failures (
a_failed_batch_does_not_strand_the_documentandthe_embedding_gate_is_never_held_beyond_its_ceiling) also reproduce on unmodifiedbb564694; the separate store suite stopped at the unchangeda_queued_job_wakes_an_idle_workertiming assertion (433 ms versus its 300 ms bound). The database-backed MCP regression suite passes independently.