Repository navigation
Conversation
Anga205
requested review from
anuragrao04,
kamaleshs-bridge4,
razvi-razorpay,
richeshgupta and
stuckinforloop
as code owners
December 3, 2026 23:17
Anga205
force-pushed
the
Anga205/search-truncated-flag
branch
from
December 4, 2026 16:33
4267a13 to
155b9c4
Compare
Anga205
force-pushed
the
Anga205/search-truncated-flag
branch
from
December 4, 2026 16:39
155b9c4 to
6856285
Compare
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.
What and why
Refs #201 this is the short-term fix discussed there, (not the chunked-indexing redesign)
A version's
search_textis capped at 256 KiB (maxSearchTextBytesinapi/internal/repo/postgres/search_text.go). Text past the cut is silently unsearchable: create/push report success, and an agent using the CLI or MCP has no way to know. The reporter supplied the SQL reproduction; the word-boundary cut and the help-text documentation were already merged upstream in 04b721a. The remaining work, as narrowed in the issue discussion, was to surface the cut to the author.This change:
searchTextTruncatedreturns the text and atruncatedflag from the same extraction pass, so the flag cannot drift from what is indexed. Exactly at the limit, it scans the remainder for a visible word, ignoring hidden elements.repo.Version.SearchTruncatedcarries the flag from document create and from the live-version seal path (version push).search_truncated(omitempty); Swagger docs regenerated.docs createanddocs pushand keeps the field under--json. MCP inherits the field through the existing response payload.skills/slashdocs/SKILL.mddocuments the warning and the JSON field.Scope: what this does NOT fix
skills/slashdocs/SKILL.mdbefore this PR.search_truncatedisomitempty: absent means false.Attribution
search_truncatedhint + CLI warning).default_grant/permission_warningandnotehandling. Tests follow the structure ofexisting tests in the same files.
How it was tested
go build ./...,go vet,golangci-lint runon changed packages: clean.go test -p 1 ./... -count=1: all 22 packages pass. Serial invocation avoids the testcontainers port exhaustion tracked in Tests leave a PostgreSQL container running per package when the testcontainers reaper does not run #304.TestSearchTextTruncated,TestCreateDocumentReportsSearchTruncation,TestCreateVersionReportsSearchTruncation,TestCreateWarnsWhenSearchIsTruncated,TestPushWarnsWhenSearchIsTruncated.make swaggerproduces no diff;gofmt -landprettier --checkclean.npm test: 1323/1325 pass. The two failures are inauth-state.test.tsxandformat-date.test.ts, both untouched by this PR and failing on master too (timing/locale flakes).Checklist
make format,make test,make lintrun locally