Repository navigation
Conversation
…pping it `_collect_documents` silently skipped an explicit --doc that did not exist or was a directory. `deeptutor kb create x --doc typo.md` then only said "Provide at least one supported document (--doc or --docs-dir)." although a document was given, and next to a valid --doc the typo'd file was left out of the KB without a word. A missing --doc now raises `document does not exist: <path>` and a directory raises `document is not a file: <path>`, matching the existing --docs-dir error; both commands already print BadParameter as a red error and exit 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
XAE-A-Xii
force-pushed
the
fix/kb-cli-missing-doc
branch
from
December 5, 2026 12:15
7ae8130 to
588092b
Compare
This branch has not been deployed
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.
Description
deeptutor kb createandkb addsilently dropped an explicit--docthat doesn't exist, or that is a directory._collect_documents(deeptutor_cli/kb.py) kept a path only if it was an existing file and skipped anything else without a word. With a typo, the CLI blamed the user for not providing a document:Next to a valid
--doc, the mistyped file was simply left out, and the KB was built without it.A missing
--docnow raisesdocument does not exist: <path>, and a directory raisesdocument is not a file: <path>. That matches the existing--docs-direrror (docs directory does not exist: ...). Both commands already printtyper.BadParameterin red and exit 1:Intended behavior change:
kb addwith one valid and one mistyped--docnow stops instead of quietly adding only the valid file.Related Issues
Module(s) Affected
agentsapiconfigcoreknowledgeloggingservicestoolsutilsweb(Frontend)docs(Documentation)scriptstestsdeeptutor_cliChecklist
dev(notmain— see the base-branch selector above).pre-commit run --all-filesand fixed any issues.Additional Notes
tests/cli/test_kb_cli.pyadds two tests:test_collect_documents_rejects_a_missing_doc_by_namecovers a missing--docalone and next to a valid file, and checks for thedoes not exist: ...typo.mdmessage.test_collect_documents_rejects_a_directory_passed_as_docchecks fornot a file.With only
deeptutor_cli/kb.pyreverted, both fail (2 failed, 1 passed). Each branch is guarded separately: removing the existing-check or the is-file check fails one test. (An earlier version matched only the file name, so dropping the "does not exist" branch passed. The assertion now pins the message.)pre-commit run --fileson both changed files passes every hook.--all-filesfailsmypyondevitself inservices/embedding/adapters/volcengine.py, from #1015, which this PR doesn't touch. Open PR #2844 also touchesdeeptutor_cli/kb.py, but only its imports and an eval helper, not_collect_documents.🤖 Generated with Claude Code