fix: retract markdown docs that become oversized - #319
Conversation
|
Linter diff in the way? Review this PR in Change Stack to focus on meaningful changes and expand context only when needed. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughWhen a previously ingested markdown file exceeds ChangesOversized file document retraction
Sequence DiagramsequenceDiagram
participant Scanner as Markdown Scanner
participant syncCandidates as syncCandidates
participant syncMarkdownFile as syncMarkdownFile
participant deleteCached as deleteCachedSourceDocument
participant RPCClient as RPC Client
Note over Scanner,RPCClient: File was previously ingested, now exceeds token limit
Scanner->>syncCandidates: Scan oversized candidate
syncCandidates->>syncCandidates: Check estimated tokens
alt Tokens exceed limit
syncCandidates->>deleteCached: Delete cached document
deleteCached->>RPCClient: enqueue delete_authored_document
deleteCached->>syncCandidates: filesDeleted++
else Proceed to streaming check
syncCandidates->>syncMarkdownFile: Stream file content
syncMarkdownFile->>syncMarkdownFile: too_large detected
syncMarkdownFile->>deleteCached: Delete cached document
deleteCached->>RPCClient: enqueue delete_authored_document
syncMarkdownFile->>syncMarkdownFile: Return "deleted"
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Summary
markdownIngestionMaxTokensPerFile.too_largepath.delete_authored_documentremoves stale authored content.Fixes #315.
Verification
pnpm exec tsc --noEmit— PASSpnpm run clean:test && pnpm exec tsc -p tsconfig.tests.json && node --test .ts-build/test/integration/markdown-ingest.test.js— PASSNote: this branch is stacked on #318 so the test suite can compile. Full
pnpm checkandnpm run test:integrationare still blocked by unrelated upstream unit/integration failures after #318's compile fix.– Vale
Summary by CodeRabbit
Bug Fixes
Tests