From f5df49ac959fbbc71da9af7b0499d3415bd8cba9 Mon Sep 17 00:00:00 2001 From: gptlang <121417512+gptlang@users.noreply.github.com> Date: Sun, 4 Feb 2024 19:47:15 +0000 Subject: [PATCH 1/5] Restore authentication code on first start (#59) * merge jellydn fork * remove release workflow * chore(doc): auto generate docs * put the authentication code back * We don't actually have dependencies * chore(doc): auto generate docs * remove pointer to fork in preparation for PR --------- Co-authored-by: github-actions[bot] --- .all-contributorsrc | 34 +++++------------- .github/workflows/release.yml | 26 -------------- CHANGELOG.md | 45 ++++++++++-------------- README.md | 3 +- doc/CopilotChat.txt | 9 +++-- rplugin/python3/handlers/chat_handler.py | 18 +++++++++- 6 files changed, 52 insertions(+), 83 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.all-contributorsrc b/.all-contributorsrc index bc6c1a5a..4bd80307 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1,7 +1,5 @@ { - "files": [ - "README.md" - ], + "files": ["README.md"], "imageSize": 100, "commit": false, "commitType": "docs", @@ -12,65 +10,49 @@ "name": "gptlang", "avatar_url": "https://avatars.githubusercontent.com/u/121417512?v=4", "profile": "https://github.com/gptlang", - "contributions": [ - "code", - "doc" - ] + "contributions": ["code", "doc"] }, { "login": "jellydn", "name": "Dung Duc Huynh (Kaka)", "avatar_url": "https://avatars.githubusercontent.com/u/870029?v=4", "profile": "https://productsway.com/", - "contributions": [ - "code", - "doc" - ] + "contributions": ["code", "doc"] }, { "login": "qoobes", "name": "Ahmed Haracic", "avatar_url": "https://avatars.githubusercontent.com/u/58834655?v=4", "profile": "https://qoobes.dev", - "contributions": [ - "code" - ] + "contributions": ["code"] }, { "login": "ziontee113", "name": "Trí Thiện Nguyễn", "avatar_url": "https://avatars.githubusercontent.com/u/102876811?v=4", "profile": "https://youtube.com/@ziontee113", - "contributions": [ - "code" - ] + "contributions": ["code"] }, { "login": "Cassius0924", "name": "He Zhizhou", "avatar_url": "https://avatars.githubusercontent.com/u/62874592?v=4", "profile": "https://github.com/Cassius0924", - "contributions": [ - "code" - ] + "contributions": ["code"] }, { "login": "rguruprakash", "name": "Guruprakash Rajakkannu", "avatar_url": "https://avatars.githubusercontent.com/u/9963717?v=4", "profile": "https://www.linkedin.com/in/guruprakashrajakkannu/", - "contributions": [ - "code" - ] + "contributions": ["code"] }, { "login": "kristofka", "name": "kristofka", "avatar_url": "https://avatars.githubusercontent.com/u/140354?v=4", "profile": "https://github.com/kristofka", - "contributions": [ - "code" - ] + "contributions": ["code"] } ], "contributorsPerLine": 7, diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 9860c202..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Release -on: - push: - pull_request: - -jobs: - release: - name: release - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: simple - package-name: CopilotChat.nvim - - uses: actions/checkout@v3 - - name: tag stable versions - if: ${{ steps.release.outputs.release_created }} - run: | - git config user.name github-actions[bot] - git config user.email github-actions[bot]@users.noreply.github.com - git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git" - git tag -d stable || true - git push origin :stable || true - git tag -a stable -m "Last Stable Release" - git push origin stable diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c095c00..20d5a900 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,56 +2,49 @@ ## [1.2.0](https://github.com/jellydn/CopilotChat.nvim/compare/v1.1.0...v1.2.0) (2024-02-04) - ### Features -* show date time and additional information on end separator ([#53](https://github.com/jellydn/CopilotChat.nvim/issues/53)) ([b8d0a9d](https://github.com/jellydn/CopilotChat.nvim/commit/b8d0a9d0e0824ff3b643a2652202be2a51b37dbc)) - +- show date time and additional information on end separator ([#53](https://github.com/jellydn/CopilotChat.nvim/issues/53)) ([b8d0a9d](https://github.com/jellydn/CopilotChat.nvim/commit/b8d0a9d0e0824ff3b643a2652202be2a51b37dbc)) ### Bug Fixes -* handle get remote plugin path on Windows ([0b917f6](https://github.com/jellydn/CopilotChat.nvim/commit/0b917f633eaef621d293f344965e9e0545be9a80)) +- handle get remote plugin path on Windows ([0b917f6](https://github.com/jellydn/CopilotChat.nvim/commit/0b917f633eaef621d293f344965e9e0545be9a80)) ## [1.1.0](https://github.com/jellydn/CopilotChat.nvim/compare/v1.0.0...v1.1.0) (2024-02-04) - ### Features -* add CopilotChatDebugInfo command ([#51](https://github.com/jellydn/CopilotChat.nvim/issues/51)) ([89b6276](https://github.com/jellydn/CopilotChat.nvim/commit/89b6276e995de2e05ea391a9d1045676737c93bd)) +- add CopilotChatDebugInfo command ([#51](https://github.com/jellydn/CopilotChat.nvim/issues/51)) ([89b6276](https://github.com/jellydn/CopilotChat.nvim/commit/89b6276e995de2e05ea391a9d1045676737c93bd)) ## 1.0.0 (2024-02-03) - ### ⚠ BREAKING CHANGES -* drop new buffer mode +- drop new buffer mode ### Features -* add a note for help user to continue the chat ([8a80ee7](https://github.com/jellydn/CopilotChat.nvim/commit/8a80ee7d3f9d0dcb65b315255d629c2cd8263dac)) -* add CCExplain command ([640f361](https://github.com/jellydn/CopilotChat.nvim/commit/640f361a54be51e7c479257c374d4a26d8fcd31d)) -* add CCTests command ([b34a78f](https://github.com/jellydn/CopilotChat.nvim/commit/b34a78f05ebe65ca093e4dc4b66de9120a681f4c)) -* add configuration options for wrap and filetype ([b4c6e76](https://github.com/jellydn/CopilotChat.nvim/commit/b4c6e760232ec54d4632edef3869e1a05ec61751)) -* add CopilotChatToggleLayout ([07988b9](https://github.com/jellydn/CopilotChat.nvim/commit/07988b95a412756169016e991dabcf190a930c7e)) -* add debug flag ([d0dbd4c](https://github.com/jellydn/CopilotChat.nvim/commit/d0dbd4c6fb9be75ccaa591b050198d40c097f423)) -* add health check ([974f14f](https://github.com/jellydn/CopilotChat.nvim/commit/974f14f0d0978d858cbe0126568f30fd63262cb6)) -* add new keymap to get previous user prompt ([6e7e80f](https://github.com/jellydn/CopilotChat.nvim/commit/6e7e80f118c589a009fa1703a284ad292260e3a0)) -* set filetype to markdown and text wrapping ([9b19d51](https://github.com/jellydn/CopilotChat.nvim/commit/9b19d51deacdf5c958933e99a2e75ebe4c968a9b)) -* show chat in markdown format ([9c14152](https://github.com/jellydn/CopilotChat.nvim/commit/9c141523de12e723b1d72d95760f2daddcecd1d9)) - +- add a note for help user to continue the chat ([8a80ee7](https://github.com/jellydn/CopilotChat.nvim/commit/8a80ee7d3f9d0dcb65b315255d629c2cd8263dac)) +- add CCExplain command ([640f361](https://github.com/jellydn/CopilotChat.nvim/commit/640f361a54be51e7c479257c374d4a26d8fcd31d)) +- add CCTests command ([b34a78f](https://github.com/jellydn/CopilotChat.nvim/commit/b34a78f05ebe65ca093e4dc4b66de9120a681f4c)) +- add configuration options for wrap and filetype ([b4c6e76](https://github.com/jellydn/CopilotChat.nvim/commit/b4c6e760232ec54d4632edef3869e1a05ec61751)) +- add CopilotChatToggleLayout ([07988b9](https://github.com/jellydn/CopilotChat.nvim/commit/07988b95a412756169016e991dabcf190a930c7e)) +- add debug flag ([d0dbd4c](https://github.com/jellydn/CopilotChat.nvim/commit/d0dbd4c6fb9be75ccaa591b050198d40c097f423)) +- add health check ([974f14f](https://github.com/jellydn/CopilotChat.nvim/commit/974f14f0d0978d858cbe0126568f30fd63262cb6)) +- add new keymap to get previous user prompt ([6e7e80f](https://github.com/jellydn/CopilotChat.nvim/commit/6e7e80f118c589a009fa1703a284ad292260e3a0)) +- set filetype to markdown and text wrapping ([9b19d51](https://github.com/jellydn/CopilotChat.nvim/commit/9b19d51deacdf5c958933e99a2e75ebe4c968a9b)) +- show chat in markdown format ([9c14152](https://github.com/jellydn/CopilotChat.nvim/commit/9c141523de12e723b1d72d95760f2daddcecd1d9)) ### Bug Fixes -* **ci:** generate doc ([6287fd4](https://github.com/jellydn/CopilotChat.nvim/commit/6287fd452d83d43a739d4c7c7a5524537032fc5d)) -* Close spinner if the buffer does not exist ([#11](https://github.com/jellydn/CopilotChat.nvim/issues/11)) ([0ea238d](https://github.com/jellydn/CopilotChat.nvim/commit/0ea238d7be9c7872dd9932a56d3521531b2297db)) -* remove LiteralString, use Any for fixing issue on Python 3.10 ([b68c352](https://github.com/jellydn/CopilotChat.nvim/commit/b68c3522d03c8ac9a332169c56e725b69a43b07c)), closes [#45](https://github.com/jellydn/CopilotChat.nvim/issues/45) - +- **ci:** generate doc ([6287fd4](https://github.com/jellydn/CopilotChat.nvim/commit/6287fd452d83d43a739d4c7c7a5524537032fc5d)) +- Close spinner if the buffer does not exist ([#11](https://github.com/jellydn/CopilotChat.nvim/issues/11)) ([0ea238d](https://github.com/jellydn/CopilotChat.nvim/commit/0ea238d7be9c7872dd9932a56d3521531b2297db)) +- remove LiteralString, use Any for fixing issue on Python 3.10 ([b68c352](https://github.com/jellydn/CopilotChat.nvim/commit/b68c3522d03c8ac9a332169c56e725b69a43b07c)), closes [#45](https://github.com/jellydn/CopilotChat.nvim/issues/45) ### Reverts -* change back to CopilotChat command ([e304f79](https://github.com/jellydn/CopilotChat.nvim/commit/e304f792a5fbba412c2a5a1f717ec7e2ab12e5b0)) - +- change back to CopilotChat command ([e304f79](https://github.com/jellydn/CopilotChat.nvim/commit/e304f792a5fbba412c2a5a1f717ec7e2ab12e5b0)) ### Code Refactoring -* drop new buffer mode ([0a30b7c](https://github.com/jellydn/CopilotChat.nvim/commit/0a30b7cfbd8b52bf8a9e4cd96dcade4995e6eb3a)) +- drop new buffer mode ([0a30b7c](https://github.com/jellydn/CopilotChat.nvim/commit/0a30b7cfbd8b52bf8a9e4cd96dcade4995e6eb3a)) diff --git a/README.md b/README.md index c35d79eb..13d4f20e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # Copilot Chat for Neovim + [![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-) + > [!NOTE] @@ -23,7 +25,6 @@ It will prompt you with instructions on your first start. If you already have `C return { { "jellydn/CopilotChat.nvim", - dependencies = { "zbirenbaum/copilot.lua" }, -- Or { "github/copilot.vim" } opts = { show_help = "yes", -- Show help text for CopilotChatInPlace, default: yes debug = false, -- Enable or disable debug mode, the log file will be in ~/.local/state/nvim/CopilotChat.nvim.log diff --git a/doc/CopilotChat.txt b/doc/CopilotChat.txt index c709e515..89d6c082 100644 --- a/doc/CopilotChat.txt +++ b/doc/CopilotChat.txt @@ -18,6 +18,10 @@ Table of Contents *CopilotChat-table-of-contents* |CopilotChat-| + [!NOTE] You might want to take a look at this fork + which is more well maintained & + is more configurable. I personally use it now as well. + [!NOTE] A new command, `CopilotChatInPlace` has been introduced. It functions like the ChatGPT plugin. Please run ":UpdateRemotePlugins" command and restart Neovim before starting a chat with Copilot. To stay updated on our roadmap, @@ -42,7 +46,6 @@ LAZY.NVIM ~ return { { "jellydn/CopilotChat.nvim", - dependencies = { "zbirenbaum/copilot.lua" }, -- Or { "github/copilot.vim" } opts = { show_help = "yes", -- Show help text for CopilotChatInPlace, default: yes debug = false, -- Enable or disable debug mode, the log file will be in ~/.local/state/nvim/CopilotChat.nvim.log @@ -309,14 +312,14 @@ CONTRIBUTORS ✨ *CopilotChat-copilot-chat-for-neovim-contributors-✨* Thanks goes to these wonderful people (emoji key ): -gptlang💻 📖Dung Duc Huynh (Kaka)💻 📖Ahmed Haracic💻Trí Thiện Nguyễn💻He Zhizhou💻Guruprakash Rajakkannu💻This project follows the all-contributors +gptlang💻 📖Dung Duc Huynh (Kaka)💻 📖Ahmed Haracic💻Trí Thiện Nguyễn💻He Zhizhou💻Guruprakash Rajakkannu💻kristofka💻This project follows the all-contributors specification. Contributions of any kind welcome! ============================================================================== 2. Links *CopilotChat-links* -1. *All Contributors*: https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square +1. *All Contributors*: https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square 2. *@jellydn*: 3. *Chat Demo*: https://i.gyazo.com/10fbd1543380d15551791c1a6dcbcd46.gif 4. *Explain Code Demo*: https://i.gyazo.com/e5031f402536a1a9d6c82b2c38d469e3.gif diff --git a/rplugin/python3/handlers/chat_handler.py b/rplugin/python3/handlers/chat_handler.py index 679ae9f3..910e642e 100644 --- a/rplugin/python3/handlers/chat_handler.py +++ b/rplugin/python3/handlers/chat_handler.py @@ -1,3 +1,4 @@ +import time from datetime import datetime from typing import Optional, cast @@ -18,7 +19,7 @@ def is_module_installed(name): class ChatHandler: def __init__(self, nvim: MyNvim, buffer: MyBuffer): self.nvim: MyNvim = nvim - self.copilot = None + self.copilot: Copilot = None self.buffer: MyBuffer = buffer # public @@ -186,6 +187,21 @@ def _add_chat_messages( ): if self.copilot is None: self.copilot = Copilot() + if self.copilot.github_token is None: + req = self.copilot.request_auth() + self.nvim.out_write( + f"Please visit {req['verification_uri']} and enter the code {req['user_code']}\n" + ) + current_time = time.time() + wait_until = current_time + req["expires_in"] + while self.copilot.github_token is None: + self.copilot.poll_auth(req["device_code"]) + time.sleep(req["interval"]) + if time.time() > wait_until: + self.nvim.out_write("Timed out waiting for authentication\n") + return + self.nvim.out_write("Successfully authenticated with Copilot\n") + self.copilot.authenticate() for token in self.copilot.ask( system_prompt, prompt, code, language=cast(str, file_type), model=model From 7d4cb93e6c591932e5a3b215a5b65d9754bc1a80 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 4 Feb 2024 19:47:35 +0000 Subject: [PATCH 2/5] chore(doc): auto generate docs --- doc/CopilotChat.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doc/CopilotChat.txt b/doc/CopilotChat.txt index 89d6c082..8043f7df 100644 --- a/doc/CopilotChat.txt +++ b/doc/CopilotChat.txt @@ -18,10 +18,6 @@ Table of Contents *CopilotChat-table-of-contents* |CopilotChat-| - [!NOTE] You might want to take a look at this fork - which is more well maintained & - is more configurable. I personally use it now as well. - [!NOTE] A new command, `CopilotChatInPlace` has been introduced. It functions like the ChatGPT plugin. Please run ":UpdateRemotePlugins" command and restart Neovim before starting a chat with Copilot. To stay updated on our roadmap, From 81a9d818b1369d41108c46da477e4ea5cec0a525 Mon Sep 17 00:00:00 2001 From: Huynh Duc Dung Date: Mon, 5 Feb 2024 03:54:40 +0800 Subject: [PATCH 3/5] revert(ci): add release workflow back --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..6f3d1425 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release +on: + push: + branches: + - release + pull_request: + branches: + - main + - release + +jobs: + release: + name: release + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + release-type: simple + package-name: CopilotChat.nvim + - uses: actions/checkout@v3 + - name: tag stable versions + if: ${{ steps.release.outputs.release_created }} + run: | + git config user.name github-actions[bot] + git config user.email github-actions[bot]@users.noreply.github.com + git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git" + git tag -d stable || true + git push origin :stable || true + git tag -a stable -m "Last Stable Release" + git push origin stable From 033406776b3ca084aacdbae18c5f864b52d64ef1 Mon Sep 17 00:00:00 2001 From: gptlang <121417512+gptlang@users.noreply.github.com> Date: Sun, 4 Feb 2024 20:51:49 +0000 Subject: [PATCH 4/5] fix Python3.10 by removing Unpack type infomation --- rplugin/python3/mypynvim/ui_components/popup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rplugin/python3/mypynvim/ui_components/popup.py b/rplugin/python3/mypynvim/ui_components/popup.py index 9040b452..cab2bac9 100644 --- a/rplugin/python3/mypynvim/ui_components/popup.py +++ b/rplugin/python3/mypynvim/ui_components/popup.py @@ -2,7 +2,7 @@ from copy import deepcopy from dataclasses import dataclass -from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Union, Unpack +from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Union if TYPE_CHECKING: from mypynvim.core.nvim import MyNvim @@ -14,7 +14,7 @@ from mypynvim.core.window import MyWindow from .calculator import Calculator -from .types import PaddingKeys, PopUpArgs, PopUpConfiguration, Relative +from .types import PaddingKeys, PopUpConfiguration, Relative @dataclass @@ -33,7 +33,7 @@ def __init__( padding: PaddingKeys = {}, enter: bool = False, opts={}, - **kwargs: Unpack[PopUpArgs], + **kwargs, ): self.nvim: MyNvim = nvim self.calculator: Calculator = Calculator(self.nvim) From 1f57cf457cdc1ca87fc2f9c9db9ef447c0165629 Mon Sep 17 00:00:00 2001 From: gptlang <121417512+gptlang@users.noreply.github.com> Date: Sun, 4 Feb 2024 22:18:26 +0000 Subject: [PATCH 5/5] add option to remove extra information: disable_extra_info --- lua/CopilotChat/init.lua | 1 + rplugin/python3/handlers/chat_handler.py | 32 +++++++++++++++++------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/lua/CopilotChat/init.lua b/lua/CopilotChat/init.lua index 85510023..a5876373 100644 --- a/lua/CopilotChat/init.lua +++ b/lua/CopilotChat/init.lua @@ -16,6 +16,7 @@ _COPILOT_CHAT_GLOBAL_CONFIG = {} -- - debug: (boolean?) default: false. M.setup = function(options) vim.g.copilot_chat_show_help = options and options.show_help or 'yes' + vim.g.copilot_chat_disable_separators = options and options.disable_extra_info or false local debug = options and options.debug or false _COPILOT_CHAT_GLOBAL_CONFIG.debug = debug diff --git a/rplugin/python3/handlers/chat_handler.py b/rplugin/python3/handlers/chat_handler.py index 910e642e..3fe7b3d2 100644 --- a/rplugin/python3/handlers/chat_handler.py +++ b/rplugin/python3/handlers/chat_handler.py @@ -35,9 +35,9 @@ def chat( disable_end_separator: bool = False, model: str = "gpt-4", ): + no_annoyance = self.nvim.eval("g:copilot_chat_disable_separators") == "yes" if system_prompt is None: system_prompt = self._construct_system_prompt(prompt) - # Start the spinner self.nvim.exec_lua('require("CopilotChat.spinner").show()') @@ -46,7 +46,9 @@ def chat( ) if not disable_start_separator: - self._add_start_separator(system_prompt, prompt, code, filetype, winnr) + self._add_start_separator( + system_prompt, prompt, code, filetype, winnr, no_annoyance + ) self._add_chat_messages(system_prompt, prompt, code, filetype, model) @@ -54,7 +56,7 @@ def chat( self.nvim.exec_lua('require("CopilotChat.spinner").hide()') if not disable_end_separator: - self._add_end_separator(model) + self._add_end_separator(model, no_annoyance) # private @@ -75,14 +77,15 @@ def _add_start_separator( code: str, file_type: str, winnr: int, + no_annoyance: bool = False, ): - if is_module_installed("tiktoken"): + if is_module_installed("tiktoken") and not no_annoyance: self._add_start_separator_with_token_count( system_prompt, prompt, code, file_type, winnr ) else: self._add_regular_start_separator( - system_prompt, prompt, code, file_type, winnr + system_prompt, prompt, code, file_type, winnr, no_annoyance ) def _add_regular_start_separator( @@ -92,15 +95,17 @@ def _add_regular_start_separator( code: str, file_type: str, winnr: int, + no_annoyance: bool = False, ): - if code: + if code and not no_annoyance: code = f"\n \nCODE:\n```{file_type}\n{code}\n```" last_row_before = len(self.buffer.lines()) system_prompt_height = len(system_prompt.split("\n")) code_height = len(code.split("\n")) - start_separator = f"""### User + start_separator = ( + f"""### User SYSTEM PROMPT: ``` @@ -111,8 +116,13 @@ def _add_regular_start_separator( ### Copilot """ + if not no_annoyance + else f"### User\n{prompt}\n\n### Copilot\n\n" + ) self.buffer.append(start_separator.split("\n")) + if no_annoyance: + return self._add_folds(code, code_height, last_row_before, system_prompt_height, winnr) def _add_start_separator_with_token_count( @@ -222,13 +232,17 @@ def _add_chat_messages( token.split("\n"), ) - def _add_end_separator(self, model: str): + def _add_end_separator(self, model: str, no_annoyance: bool = False): current_datetime = datetime.now().strftime("%Y-%m-%d %H:%M:%S") model_info = f"\n#### Answer provided by Copilot (Model: `{model}`) on {current_datetime}." additional_instructions = ( "\n> For additional queries, please use the `CopilotChat` command." ) - disclaimer = "\n> Please be aware that the AI's output may not always be accurate. Always cross-verify the output.\n---\n" + disclaimer = "\n> Please be aware that the AI's output may not always be accurate. Always cross-verify the output." end_message = model_info + additional_instructions + disclaimer + + if no_annoyance: + end_message = "\n" + current_datetime + "\n---\n" + self.buffer.append(end_message.split("\n"))