Repository navigation
Conversation
🦋 Changeset detectedLatest commit: fb8daaa The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Summary
JsonChunkerfirst tokenizes its flattened JSON representation, then wraps the token chunks with JSON-specific metadata. The inherited token metadata containsformat: "text", andbuildMetadatamerges the inherited extras last, overwriting the intendedformat: "json". Valid JSON chunks therefore silently report the wrong format even thoughsourceTypeis JSON and structural fields are present.This PR removes the inherited
formatandsourceTypekeys before merging token chunk metadata. It retains token positions and JSON structural metadata, while invalid JSON still falls back to token chunking withformat: "text".Changes
TokenChunker'sformatandsourceTypefromJsonChunker's extras.@voltagent/rag.Reproduction and validation
mainsource at72a46c76b4507e1f98b41d5050a92bd30587eb70.JsonChunker,TokenChunker, andbuildMetadataimplementations, substituting only minimal tokenization/position helpers because the complete monorepo dependencies were unavailable.format: "text"; the targeted assertion fails.json/json) and invalid JSON fallback (text/token).git diff --check.Not run: official monorepo Vitest, package TypeScript build, lint, full CI, and integration tests. These still need real execution in the upstream/fork CI environment. The isolated harness is not a substitute for official tests.
Scope and prior work
Independent of #1459, which changes
detectFormatrouting for top-level arrays; this PR fixes metadata produced after a valid JSON payload has already reachedJsonChunker.AI use
Prepared with AI-assisted source review, duplication search, isolated reproduction, and patch verification. All validation limits are documented above.
Summary by cubic
Fixes
JsonChunkermetadata so valid JSON chunks reportformat: "json"andsourceType: "json"instead of inheriting"text"/"token"from the inner token chunker.formatandsourceTypebefore merging JSON metadata, while keeping token positions and structural fields.@voltagent/rag.Written for commit fb8daaa. Summary will update on new commits.
Summary by CodeRabbit