fix(server): surface partial results in list-all-entities - #45
Merged
Conversation
…masking The list-across-all-entities path silently `continue`d on a per-entity List error, so a failing entity produced a 200 with quietly-incomplete results. Log each skip and a partial-result summary so the gap is visible (behavior otherwise unchanged — one bad entity still doesn't fail the whole request). go build ./... + go vet + go test ./cmd/keyoku-server/ all green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement. To sign, please comment on this PR with the following text:
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
Contributor
There was a problem hiding this comment.
Pull request overview
Improves observability for the HandleListMemories “list-all-entities” path so that per-entity failures no longer produce a quietly-incomplete 200 response without any operator signal.
Changes:
- Track how many entities are skipped due to
h.k.Listerrors whenentity_idis omitted. - Emit warning logs per skipped entity and a final “partial results” summary warning.
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
The top finding from the engine audit: the list-all-entities path (
HandleListMemories, noentity_id) silentlycontinued on a per-entityListerror, so one failing entity returned a 200 with quietly-incomplete results. Now each skip is logged plus a partial-result summary — the request still doesn't fail for one bad entity, but the gap is no longer invisible.Scope note (rest of the audit "quick wins")
main— not needed.MaxBytesReader(nil, …)→ proper 413 (handlers.go:380): requires changingdecodeBody's signature across all callers for a cosmetic 413-vs-400 difference. Deferred — not a low-risk "quick win" in BSL core; happy to do it as its own PR if you want it.strings.Contains(err,"HNSW")→errors.Is(handlers.go:371): no vector-index error sentinel exists yet, so this would mean inventing + threading one through. Deferred to avoid risk; works correctly today.Verification
go build ./...·go vet ./cmd/keyoku-server/·go test ./cmd/keyoku-server/— all green.🤖 Generated with Claude Code