feat: expose available docs as state value#47
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughVersion bumped to 1.5.15 in package.json. The documents provider now always returns Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant DocumentsProvider
Note over DocumentsProvider: fetch/format documents & counts
Caller->>DocumentsProvider: request documents
DocumentsProvider-->>Caller: { documentsCount, documents, availableDocuments, text }
alt knowledge service error / unavailable
DocumentsProvider-->>Caller: { documentsCount: 0, documents: "", availableDocuments: "", text: "" }
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Bug: Service failure causes inconsistent data structure.
The values object is missing the availableDocuments field when the knowledge service is unavailable. This creates an inconsistent return type compared to the success case at line 109, which could break code that expects availableDocuments to always be present in the values object for prompt binding.
src/documents-provider.ts#L28-L29
plugin-knowledge/src/documents-provider.ts
Lines 28 to 29 in 5d90592
Bug: Inconsistent return type: Missing expected field.
The values object is missing the availableDocuments field when no documents are found. This creates an inconsistent return type compared to the success case at line 109, which could break code that expects availableDocuments to always be present in the values object for prompt binding.
src/documents-provider.ts#L48-L49
plugin-knowledge/src/documents-provider.ts
Lines 48 to 49 in 5d90592
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (2)
package.json(1 hunks)src/documents-provider.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Cursor Bugbot
🔇 Additional comments (1)
package.json (1)
4-4: LGTM! Version bump is appropriate.The patch version increment aligns with the minor feature addition of exposing available documents as a state value.
Small PR exposing available docs as state value for easy prompt binding.
Note
Enhances the documents provider to return formatted available documents (with count) via new
valuesfields, updates error/empty handling, bumps version to 1.5.15, and refreshes dependencies.src/documents-provider.ts):valuesfields:documentsCount,availableDocuments; keepdocuments(concise list).documentsText).1.5.15inpackage.json.unpdf).Written by Cursor Bugbot for commit 8ec1f18. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
Chores
New Features