Repository navigation
fix(learning): fit manual synchronous reflection to request budgets - #2600
Merged
Merged
Conversation
Reselect whole evidence units against retained and serialized input bounds and the reflector request limits. Fit optional comparison memories without displacing evidence, and abstain when no valid selection fits. Preserve automatic and durable execution paths. Co-authored-by: Mecatl <noreply@mecatl.dev>
Keep stored memories unchanged when their content or size is not eligible for the stricter learning comparison input. Skip those optional facts while retaining valid evidence and later comparisons. Cover unsafe and oversized facts through the real synchronous reflector path. Co-authored-by: Mecatl <noreply@mecatl.dev>
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
Closes #2598. Automatic/durable admission and replay are deferred to #2599. This fix is independent of the
/reflectionsUI work in #2595.Manual synchronous
/reflectcould select evidence under its selection budget but then reject it before a model call: retained-input accounting, serialized projection overhead, and reflector-specific byte/count limits did not agree. The client surfaced this as “reflection service is unavailable.”Regression coverage uses the real
EvidenceReflectorwith offline mock providers: raw/escaped-JSON size failures, smaller-selection success, event/fact count limits, optional memory bytes, no-fit/no-provider abstention, source identity/pairing, genuine failures, and isolation from automatic/durable paths. Initial first-pass production candidates are explicitly demonstrated to fail before the smaller accepted request succeeds.Verification
All passed on the final reviewed candidate:
task linttask testtask test:racego run ./cmd/mecademo— tool call, permission ask/approval, and final result verifiedtask buildgit diff --checkFinal qualification ran sequentially in the foreground using system temporary storage. Earlier managed-temp attempts encountered disappearing build files and overlong Unix-socket paths; those failed receipts were retained and are not counted as passes.
Review has no remaining findings within the explicitly agreed synchronous-only scope. Automatic/durable paths retain baseline behavior, including the separately tracked limitations in #2599.
API compatibility
Backward-compatible bug fix restoring bounded manual synchronous selection. Existing RPCs/fields, authorization, response/abstention vocabulary, wire error mappings, exported Go APIs, and stored evidence/data formats are unchanged. No API major or feature changes, dependency-pin changes, client migration, or coordinated upgrade is required.