Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: CopilotC-Nvim/CopilotChat.nvim
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.10.0
Choose a base ref
...
head repository: CopilotC-Nvim/CopilotChat.nvim
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.10.1
Choose a head ref
  • 5 commits
  • 6 files changed
  • 3 contributors

Commits on Apr 4, 2025

  1. fix(client): update response_text after parsing response (#1093)

    The response_text variable was being captured before the response body
    was parsed. This commit ensures that response_text is updated after
    parsing is complete, which provides the correct final text for
    processing.
    
    Closes #1064
    deathbeam authored Apr 4, 2025
    Copy the full SHA
    34d1b4f View commit details
  2. Copy the full SHA
    0a1c463 View commit details
  3. fix: handle invalid context window size in GitHub models (#1094)

    Before the code was assuming that context window = input tokens, but its total.
    Also some models arent reporting the input and output correctly, so use default when
    result is 0
    deathbeam authored Apr 4, 2025
    Copy the full SHA
    00bf27e View commit details
  4. fix(diff): normalize filename (#1095)

    Use utils.filename() to normalize the filename value in the diff object,
    ensuring consistent path handling.
    
    Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
    deathbeam authored Apr 4, 2025
    Copy the full SHA
    81754ea View commit details
  5. Copy the full SHA
    e7cd79a View commit details
Showing with 24 additions and 10 deletions.
  1. +9 −0 CHANGELOG.md
  2. +2 −2 doc/CopilotChat.txt
  3. +1 −3 lua/CopilotChat/client.lua
  4. +1 −2 lua/CopilotChat/config/mappings.lua
  5. +10 −2 lua/CopilotChat/config/providers.lua
  6. +1 −1 version.txt
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [3.10.1](https://github.com/CopilotC-Nvim/CopilotChat.nvim/compare/v3.10.0...v3.10.1) (2025-04-04)


### Bug Fixes

* **client:** update response_text after parsing response ([#1093](https://github.com/CopilotC-Nvim/CopilotChat.nvim/issues/1093)) ([34d1b4f](https://github.com/CopilotC-Nvim/CopilotChat.nvim/commit/34d1b4fc816401c9bad88b33f71ef943a7dd2396)), closes [#1064](https://github.com/CopilotC-Nvim/CopilotChat.nvim/issues/1064)
* **diff:** normalize filename ([#1095](https://github.com/CopilotC-Nvim/CopilotChat.nvim/issues/1095)) ([81754ea](https://github.com/CopilotC-Nvim/CopilotChat.nvim/commit/81754ea35253c48459db5712ae60531ea2c5ef75))
* handle invalid context window size in GitHub models ([#1094](https://github.com/CopilotC-Nvim/CopilotChat.nvim/issues/1094)) ([00bf27e](https://github.com/CopilotC-Nvim/CopilotChat.nvim/commit/00bf27ed201b9509105afaac4d5bdcc46ce89f35))

## [1.9.0](https://github.com/CopilotC-Nvim/CopilotChat.nvim/compare/v1.8.0...v1.9.0) (2024-02-24)


4 changes: 2 additions & 2 deletions doc/CopilotChat.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*CopilotChat.txt* For NVIM v0.8.0 Last change: 2025 April 01
*CopilotChat.txt* For NVIM v0.8.0 Last change: 2025 April 04

==============================================================================
Table of Contents *CopilotChat-table-of-contents*
@@ -884,7 +884,7 @@ See CONTRIBUTING.md </CONTRIBUTING.md> for detailed guidelines.
Thanks goes to these wonderful people (emoji key
<https://allcontributors.org/docs/en/emoji-key>):

gptlang💻 📖Dung Duc Huynh (Kaka)💻 📖Ahmed Haracic💻Trí Thiện Nguyễn💻He Zhizhou💻Guruprakash Rajakkannu💻kristofka💻PostCyberPunk📖Katsuhiko Nishimra💻Erno Hopearuoho💻Shaun Garwood💻neutrinoA4💻 📖Jack Muratore💻Adriel Velazquez💻 📖Tomas Slusny💻 📖Nisal📖Tobias Gårdhus📖Petr Dlouhý📖Dylan Madisetti💻Aaron Weisberg💻 📖Jose Tlacuilo💻 📖Kevin Traver💻 📖dTry💻Arata Furukawa💻Ling💻Ivan Frolov💻Folke Lemaitre💻 📖GitMurf💻Dmitrii Lipin💻jinzhongjia📖guill💻Sjon-Paul Brown💻Renzo Mondragón💻 📖fjchen7💻Radosław Woźniak💻JakubPecenka💻thomastthai📖Tomáš Janoušek💻Toddneal Stallworth📖Sergey Alexandrov💻Léopold Mebazaa💻JunKi Jin💻abdennourzahaf📖Josiah💻Tony Fischer💻 📖Kohei Wada💻Sebastian Yaghoubi📖johncming💻Rokas Brazdžionis💻Sola📖 💻Mani Chandra💻Nischal Basuti📖Teo Ljungberg💻Joe Price💻This project follows the all-contributors
gptlang💻 📖Dung Duc Huynh (Kaka)💻 📖Ahmed Haracic💻Trí Thiện Nguyễn💻He Zhizhou💻Guruprakash Rajakkannu💻kristofka💻PostCyberPunk📖Katsuhiko Nishimra💻Erno Hopearuoho💻Shaun Garwood💻neutrinoA4💻 📖Jack Muratore💻Adriel Velazquez💻 📖Tomas Slusny💻 📖Nisal📖Tobias Gårdhus📖Petr Dlouhý📖Dylan Madisetti💻Aaron Weisberg💻 📖Jose Tlacuilo💻 📖Kevin Traver💻 📖dTry💻Arata Furukawa💻Ling💻Ivan Frolov💻Folke Lemaitre💻 📖GitMurf💻Dmitrii Lipin💻jinzhongjia📖guill💻Sjon-Paul Brown💻Renzo Mondragón💻 📖fjchen7💻Radosław Woźniak💻JakubPecenka💻thomastthai📖Tomáš Janoušek💻Toddneal Stallworth📖Sergey Alexandrov💻Léopold Mebazaa💻JunKi Jin💻abdennourzahaf📖Josiah💻Tony Fischer💻 📖Kohei Wada💻Sebastian Yaghoubi📖johncming💻Rokas Brazdžionis💻Sola📖 💻Mani Chandra💻Nischal Basuti📖Teo Ljungberg💻Joe Price💻Yufan You📖 💻This project follows the all-contributors
<https://github.com/all-contributors/all-contributors> specification.
Contributions of any kind are welcome!

4 changes: 1 addition & 3 deletions lua/CopilotChat/client.lua
Original file line number Diff line number Diff line change
@@ -709,9 +709,6 @@ function Client:ask(prompt, opts)
end

local response_text = response_buffer:tostring()
log.trace('Response text:\n', response_text)
log.debug('Response message:\n', vim.inspect(last_message))

if errored then
error(response_text)
return
@@ -727,6 +724,7 @@ function Client:ask(prompt, opts)
else
parse_line(response.body)
end
response_text = response_buffer:tostring()
end

if utils.empty(response_text) then
3 changes: 1 addition & 2 deletions lua/CopilotChat/config/mappings.lua
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ local function get_diff(block)
change = block.content,
reference = reference or '',
filetype = filetype or '',
filename = filename,
filename = utils.filename(filename),
start_line = start_line,
end_line = end_line,
bufnr = bufnr,
@@ -240,7 +240,6 @@ return {

local lines = vim.split(diff.change, '\n', { trimempty = false })
vim.api.nvim_buf_set_lines(diff.bufnr, diff.start_line - 1, diff.end_line, false, lines)

copilot.set_selection(diff.bufnr, diff.start_line, diff.start_line + #lines - 1)
end,
},
12 changes: 10 additions & 2 deletions lua/CopilotChat/config/providers.lua
Original file line number Diff line number Diff line change
@@ -322,12 +322,20 @@ M.github_models = {
return vim.tbl_contains(model.inferenceTasks, 'chat-completion')
end)
:map(function(model)
local context_window = model.modelLimits.textLimits.inputContextWindow
local max_output_tokens = model.modelLimits.textLimits.maxOutputTokens
local max_input_tokens = context_window - max_output_tokens
if max_input_tokens <= 0 then
max_output_tokens = 4096
max_input_tokens = context_window - max_output_tokens
end

return {
id = model.name,
name = model.displayName,
tokenizer = 'o200k_base',
max_input_tokens = model.modelLimits.textLimits.inputContextWindow,
max_output_tokens = model.modelLimits.textLimits.maxOutputTokens,
max_input_tokens = max_input_tokens,
max_output_tokens = max_output_tokens,
}
end)
:totable()
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.0
3.10.1