Repository navigation
Conversation
Ship the CLI's selected guides and bundled agent skills as a searchable offline corpus. Expose bounded search results and section retrieval through the standard JSON envelope so an agent can retrieve only the guidance it needs. Constraint: Keep search offline and add no runtime dependency. Rejected: Add embeddings in the first release | model/runtime cost is not justified before evaluating lexical search Confidence: high Scope-risk: moderate Directive: Update docs/search-sources.json and regenerate the corpus when an indexed source changes. Tested: 57 focused docs, discovery, and schema tests; Ruff lint and format; corpus freshness; wheel and sdist-built wheel smoke checks outside the checkout Not-tested: Full suite after schema registration fix; five failures in unchanged terminal-rendering, TLS-root, and bounded workflow tests reproduced individually
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
Agents need to find relevant CLI guidance even when a user describes a problem without knowing the command or heading. A version-matched optional LanceDB pack keeps BM25, semantic, and reciprocal-rank hybrid retrieval local while the base CLI retains its dependency-light lexical search. The bundled skill teaches agents to search, inspect source sections, and reformulate a missed query. Constraint: Preserve the Python 3.10+ platform matrix and keep the optional native dependencies out of base installs Rejected: Download the encoder on first search | searches must work offline from packaged assets Confidence: high Scope-risk: moderate Directive: Keep the query encoder revision paired with the precomputed vectors and rebuild the pack when the corpus or model changes Tested: 74 focused tests; ruff check; generated corpus/pack checks; core and companion wheels/sdists built and rebuilt from sdists; installed wheel hybrid search smoke Not-tested: Four unrelated full-suite failures remain in deploy-progress rendering, pretty-print styling, and HTTP certificate handling; PyPI publishing trust for the companion distribution requires repository setup
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Upstream changed reviewed documentation sources after the search branch was created. Merge the current default branch so the generated corpus and its version-matched LanceDB pack stay compatible with the PR merge tree. Constraint: Pull-request CI checks the corpus against the merged default branch Rejected: Exclude the new upstream guidance from this pack | the CLI corpus should describe the current release Confidence: high Scope-risk: narrow Directive: Regenerate both the core corpus and LanceDB pack whenever an included upstream source changes Tested: Conflict-free merge and fresh corpus/pack checks Not-tested: GitHub checks are rerunning after push
The latest default-branch merge added source sections that agents should be able to find. Regenerate the canonical corpus so its hash matches the packaged LanceDB vectors and FTS index. Constraint: The docs-search pack must match the core corpus hash exactly Rejected: Keep the previous corpus snapshot | search status would report the shipped pack as incompatible Confidence: high Scope-risk: narrow Directive: Rebuild the companion pack when this generated corpus changes Tested: docs bundle --check, docs pack --check, and 74 focused tests Not-tested: Full suite has four failures in untouched deploy-progress, pretty-print, and HTTP certificate tests
Windows Git checkout may translate generated JSON line endings even when the corpus content is unchanged. Normalize only CRLF during the freshness comparison so the three-platform docs-search matrix checks the same generated content. Constraint: Docs-search CI runs on Windows with Python 3.10 Rejected: Remove the freshness check from Windows | cross-platform corpus reproducibility is part of the feature Confidence: high Scope-risk: narrow Tested: 75 focused docs-search and CLI tests; ruff check; corpus and LanceDB pack checks Not-tested: The earlier Windows CI attempt also exposed unrelated console-codepage failures; the matrix now runs in Python UTF-8 mode and needs a fresh run
The source_line field in the docs output contract identifies the section heading. Store that same anchor in LanceDB chunks so search results and docs show point to the same source location, including chunks split past the encoder window. Constraint: Search and show must preserve the established one-based heading-line contract Rejected: Return the first body line or chunk offset | it disagrees with the section ID and show location Confidence: high Scope-risk: narrow Directive: Keep chunk source metadata aligned with the preview schema when changing chunking Tested: 75 focused docs-search/CLI tests; rebuilt and checked the pack; verified live hybrid search and show both report line 128 Not-tested: New GitHub checks are pending after push
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.
Summary
comfy-cli[docs-search]installs a version-matched companion package with a 59.3 MiB compressed offline search pack: 337 documentation chunks, precomputed 384-dimensional BGE vectors, the pinned local ONNX query encoder and tokenizer, and a LanceDB BM25 index. The base CLI remains lightweight and keeps its existing local BM25 search.comfy docs statusreports available retrieval modes.docs search --mode autoselects hybrid retrieval when the matching pack is installed;bm25,semantic, andhybridcan also be selected explicitly. Search output includes the backend, retrieval mode, source section, corpus and model identity, confidence evidence, and fallback reason.docs showreads the cited section. Searches use packaged assets and do not download a model; absent or incompatible optional assets leave auto mode on core BM25, while explicit semantic/hybrid requests return a structured error.The bundled
comfyskill teaches shell-capable agents to search, read relevant sections, and reformulate a missed query once before answering from retrieved sources. This exposes the workflow through the CLI; it does not add native tools to the separate local Comfy-agent runtime.The release workflow builds and validates the data package alongside comfy-cli, then smoke-installs the optional extra from PyPI. PyPI trusted publishing needs to be configured for both package names before release.
Example output
The following is the exact stdout from the hybrid search command against wheels built from the source distributions, run outside the checkout:
$ comfy --json docs search 'A job is still pending and seems frozen, what should I check?' --mode hybrid --limit 1 {"schema": "envelope/1", "type": "envelope", "ok": true, "command": "docs search", "version": "0.0.0", "where": null, "data": {"query": "A job is still pending and seems frozen, what should I check?", "results": [{"id": "comfy-debug:job-stuck-triage", "title": "comfy-debug agent guide", "headings": ["Job-stuck triage"], "source": "comfy_cli/skills/comfy-debug/SKILL.md", "source_line": 128, "excerpt": "If a prompt seems to hang:\n\n```\n# 1. Is it still tracked?\ncomfy --json jobs ls\n\n# 2. What does the server think?\ncomfy --json jobs status <prompt_id>\n\n# 3. Watch live events (NDJSON, one per line)\ncomfy --json-stream jobs watch <prompt_id>\n```\n\nThree possible answers:\n\n| Symptom | Likely cause | Fix |\n|---|---|---|\n| `status: pending`, `queue_position > 0` | Earlier jobs ahead of you | Wait or cancel them |\n| `status: running` but no progress events | A long sampler step, or a hung custom node | Wait one sampler-step's worth; if still stuck, interrupt |\n| `status: error` with no `error_message` | Server crashed mid-execution | Check the Comfy Cloud dashboard or server logs (cloud), or the stdout of `comfy launch` (local) |", "score": 0.032786883413791656, "score_type": "rrf"}], "zero_hit": false, "has_more": true, "search_backend": "lancedb-hybrid-rrf", "retrieval_mode": "hybrid", "corpus_hash": "1d62f56018524ac95c81a250666f0f4405c545328e6670b7b338ecb3a17af519", "pack_version": "0.0.0", "model": "BAAI/bge-small-en-v1.5", "fallback_reason": null, "highest_vector_similarity": 0.7049703896045685, "fts_term_coverage": 0.75, "query_mode": "hybrid"}, "error": null}