You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(chat): use the model passed in via params - #3422
When looking at implementing a new edit_file tool, I noticed some issues in how my tool testing script was running and it led to the identification that models passed in through parameters on the chat may not resolve correctly, especially in the case of the CoPilot adapter.
Supporting Documentation
AI Usage
Claude Code + Opus 5.5
Related Issue(s)
Screenshots
Checklist
I've read the contributing guidelines and have adhered to them in this PR
I confirm that this PR has been majority created by me, and not AI (unless stated in the "AI Usage" section above)
I've run make all to ensure docs are generated, tests pass and StyLua has formatted the code
(optional) I've added test coverage for this fix/feature
(optional) I've updated the README and/or relevant docs pages
### Issue 1
lua/codecompanion/interactions/chat/init.lua:1627
When an HTTP request fails and automatic context compaction starts, `done` returns before passing the request error to `finish`. If compaction also fails, its abort path calls `finish()` without that error. The `on_completed` callback then reports the failure without its details, making the original request failure harder to diagnose.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
The PR routes chat model parameters through adapter resolution, gives explicit ACP model and mode options precedence over configured session defaults, and adds failure details to completion callbacks.
Tests cover model selection and HTTP and ACP completion errors.
The HTTP error detail is still lost if automatic compaction starts and then fails.
The reason will be displayed to describe this comment to others. Learn more.
Compaction loses request errors
When an HTTP request fails and automatic context compaction starts, done returns before passing the request error to finish. If compaction also fails, its abort path calls finish() without that error. The on_completed callback then reports the failure without its details, making the original request failure harder to diagnose.
Prompt To Fix With AI
This is a comment left during a code review.
Path: lua/codecompanion/interactions/chat/init.lua
Line: 1627
Comment:
**Compaction loses request errors**
When an HTTP request fails and automatic context compaction starts, `done` returns before passing the request error to `finish`. If compaction also fails, its abort path calls `finish()` without that error. The `on_completed` callback then reports the failure without its details, making the original request failure harder to diagnose.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
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
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.
Description
When looking at implementing a new
edit_filetool, I noticed some issues in how my tool testing script was running and it led to the identification that models passed in through parameters on the chat may not resolve correctly, especially in the case of the CoPilot adapter.Supporting Documentation
AI Usage
Claude Code + Opus 5.5
Related Issue(s)
Screenshots
Checklist
make allto ensure docs are generated, tests pass and StyLua has formatted the code