Repository navigation
feat(context): report why a preparation lost its semantic recall path (#2039) #2144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jasondeng1997
wants to merge
7
commits into
oceanbase:master
Choose a base branch
from
jasondeng1997:fix/prepared-context-degradation-reason
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+644
−46
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1a3db93
feat(context): report why a preparation lost its semantic recall path…
jasondeng1997 49526f7
fix(context): spell the lost-channel reason in the RFC 1435 vocabulary
jasondeng1997 9ea45fe
chore(ci): retrigger after an OceanBase lock-wait flake
jasondeng1997 17f3b93
fix(client): keep `explain` off the wire until a Server knows it
jasondeng1997 4bebb15
Merge remote-tracking branch 'upstream/master' into fix/prepared-cont…
jasondeng1997 6ef8a98
Merge remote-tracking branch 'upstream/master' into fix/prepared-cont…
jasondeng1997 1343d60
fix(desktop): restore the license header in the regenerated contract …
jasondeng1997 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Omit
explainfrom SDK requests when diagnostics are disabledThe Python client serializes all defaults for
PREPARE_CONTEXT(src/powercontext/client/client.py:1376-1377), so addingexplain=Falsemakes evenprepare_context(PrepareContextRequest(scope_id=..., query=...))send"explain": false. When the client is upgraded before the Server, this breaks ordinary preparation: I ran the head SDK against a localhost Server at target30e3f1b1and got HTTP 422 (invalid_request); replaying the same payload with onlyexplainremoved returned HTTP 200.Please omit the new flag when diagnostics are disabled, or negotiate support before sending it. Preserve the existing omitted-versus-null handling for
assemblywhen adjusting serialization.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 17f3b93 — confirmed and reproduced on the client side.
PREPARE_CONTEXTis the one operation that serializes its defaults (exclude_unset=operation is not PREPARE_CONTEXT), because an older Server needs the fields it already understands. That madeexplain: falsetravel on every ordinary preparation, so a client upgraded ahead of its Server turned a workingprepare_context(...)into422 invalid_request.falseand absence are the same request, so the client now drops the key unless the caller actually opted in:This is the third case of the same pattern next to
assembly, and I kept the two independent so the omitted-versus-null handling forassemblyis untouched —test_prepare_client_preserves_omitted_and_explicit_assemblystill passes unchanged.test_prepare_client_omits_the_explain_flag_a_server_may_not_knowcovers the three shapes on the wire: a default request has noexplainkey,explain: truestill travels, and an explicitexplain: falseis omitted. It also assertsmax_bytesandinclude_codeare still serialized in the default request, so the omission is targeted rather than the client quietly switching toexclude_unsetfor everything.One consequence worth stating: a caller who sets
explain: falseexplicitly cannot distinguish "asked for nothing" from "did not ask" on the wire, which is what makes the request acceptable to both Server versions. That is the same tradeassemblyalready makes.