Repository navigation
Report Mongo errors from the semantic knowledge tools instead of raising - #83
Merged
Merged
Conversation
query_knowledge and query_knowledge_global were bare create_retriever_tool
wrappers, so a PyMongoError escaped the tools node and killed the run,
cancelling any sibling tool calls (a prototype-fixer task, 16 minutes in).
The trigger was a vector index that existed but was not yet queryable
("state NOT_STARTED"), which the startup index check cannot rule out.
Wrap both in _safe_retriever_tool, which returns a warning pointing the
agent at the direct query tools, matching save_knowledge/update_knowledge.
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.
Problem
query_knowledgeandquery_knowledge_globalwere barecreate_retriever_toolwrappers with no error handling. A
PyMongoErrorescaped the tools node and killedthe whole run, cancelling sibling tool calls — in trace
01a1ec54-a460-7282-a96c-740b8ef7627cit took down a
prototype-fixertask 16 minutes in.The trigger was
re_knowledge_indexexisting but not being queryable("cannot query vector index ... while in state NOT_STARTED"); mongot had paused
initial syncs because the Mongo host's disk was 89% full. The startup index check
only verifies the index exists, so it can't rule this out.
Fix
_safe_retriever_tool()wrapscreate_retriever_tool(sync + async) and returns awarning pointing the agent at
query_by_address/query_by_category/query_by_tags,matching how
save_knowledge/update_knowledgealready handlePyMongoError.NOT_STARTEDfailure.Testing
lint, typecheck, and
./scripts/test.shpass (302 passed). Integration tests not run.