Repository navigation
test: pin the enable_thinking precedence (top-level, kwarg, --thinking) - #271
Merged
Merged
Conversation
The order sat inline in the chat handler where no test saw it. It is now resolveThinking, with a unit test per branch and a contract block for the conflicting case. Closes SharpAI#263.
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.
Closes #263.
The order for
enable_thinking(top-level field, thenchat_template_kwargs, then--thinking) was written inline in the chat handler, so no test could see it. As the issue says, you could swap two of its branches and everything stayed green.What changed:
resolveThinking(topLevel:kwarg:serverFlag:), and the handler just calls it. No behaviour change.ThinkingPrecedenceTests(4 tests) covers each branch. Every case gives the lower levels the opposite value, including the conflict where the top-level field has to win over the kwarg.tests/test-contract.shgets block 19 with the same conflict end to end, both ways, plus a kwarg that beats--thinking. The CI model's template ignoresenable_thinking, so the block reads the verdict from theslot_launch ... thinking=line the server logs, the way block 15 already reads the log.To be sure it really guards the order, I swapped the first two branches locally: the conflict test fails and block 19 fails 2 of its 3 checks. Put back, everything passes.
swift test --filter SwiftLMTests: 369 tests, 0 failures. Contract suite against the CI model: 35 passed, 0 failed, 2 skipped (the two usual skips for the tiny model).