Repository navigation
Fix RawRepresentationFactory settings being overwritten in AsChatClient - #1442
Merged
martindevans merged 4 commits intoSep 26, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Preserve raw MaxTokens, including the documented unlimited value -1.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
This PR updates AsChatClient to preserve settings from RawRepresentationFactory while honoring explicit ChatOptions values.
Changes:
- Preserves raw token and sampling settings.
- Retains custom sampling pipelines.
- Adds model-independent regression tests.
A moderate issue remains: raw MaxTokens = -1 is still overwritten with 256 when MaxOutputTokens is unset.
| File | Description |
|---|---|
LLama/Extensions/LLamaExecutorExtensions.cs |
Updates inference parameter merging. |
LLama.Unittest/LLamaExecutorChatClientTests.cs |
Adds coverage for raw settings and option precedence. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…en only the seed changes
…hed on first use
Member
|
Thanks for fixing this. Looks good to merge once the tests are completed :D |
martindevans
self-requested a review
September 26, 2026 00:08
martindevans
approved these changes
Sep 26, 2026
This was referenced Oct 19, 2026
Merged
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.

Settings passed through
ChatOptions.RawRepresentationFactorywere partly overwritten byAsChatClient:MaxTokenswas reset to 256 whenMaxOutputTokenswasn't setTemperature,TopPandTopKwere reset to the defaultsSeedwas replaced with a random oneDefaultSamplingPipelinewas replacedThese now fall back to the raw settings, the same way the other sampling settings already did. Values set on
ChatOptionsstill take priority.Added
LLamaExecutorChatClientTests, which don't need a model.