2 Commits
Author SHA1 Message Date
evanp 4fdaa0ca9d Merge pull request 'Abort in-flight requests when the chat is cancelled' (#1) from code/inference-coop-copilot:fix/abort-on-cancel into main
Reviewed-on: evanp/inference-coop-copilot#1
2026-11-07 04:07:19 +00:00
inference-bot 9798a41745 fix: abort in-flight chat requests on cancellation
Cancellation was only checked at POST time; once the SSE stream was
open the reader loop never looked at the token again, so a stopped
chat kept generating server-side (and billing) until the response
ended.

Wire an AbortController to token.onCancellationRequested, pass its
signal to fetch, and check token.isCancellationRequested at the top
of the reader loop so the connection closes as soon as the user
stops the request. AbortError is swallowed (a stop is not a
failure); real HTTP errors still surface, and the cancellation
listener is disposed in a finally.
2026-11-07 00:40:40 +00:00
5 changed files with 17 additions and 33 deletions

No files matched your search

+6 -22
View File
@@ -8,22 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html). [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.3.0] - 2026-11-08 ## [Unreleased]
### Changed
- Removed the "(unofficial)" disclaimer from the package description and
NOTICE, and the README; the project is now official, maintained in the
co-op's Git at `code/inference-coop-copilot`.
- Updated the repository URL to `https://git.inference.coop/code/inference-coop-copilot.git`
in package.json and CHANGELOG links.
### Fixed
- Abort in-flight chat requests on cancellation: an `AbortController` wired
to `token.onCancellationRequested` closes the SSE connection as soon as
the user stops the request, instead of the server continuing to generate
until the response ends.
## [0.2.2] - 2026-11-06 ## [0.2.2] - 2026-11-06
@@ -85,9 +70,8 @@ First release usable for chat.
Initial development release. Not functional for chat. Initial development release. Not functional for chat.
[Unreleased]: https://git.inference.coop/code/inference-coop-copilot/compare/v0.3.0...HEAD [Unreleased]: https://git.inference.coop/evanp/inference-coop-copilot/compare/v0.2.2...HEAD
[0.3.0]: https://git.inference.coop/code/inference-coop-copilot/compare/v0.2.2...v0.3.0 [0.2.2]: https://git.inference.coop/evanp/inference-coop-copilot/compare/v0.2.1...v0.2.2
[0.2.2]: https://git.inference.coop/code/inference-coop-copilot/compare/v0.2.1...v0.2.2 [0.2.1]: https://git.inference.coop/evanp/inference-coop-copilot/compare/v0.2.0...v0.2.1
[0.2.1]: https://git.inference.coop/code/inference-coop-copilot/compare/v0.2.0...v0.2.1 [0.2.0]: https://git.inference.coop/evanp/inference-coop-copilot/compare/v0.1.0...v0.2.0
[0.2.0]: https://git.inference.coop/code/inference-coop-copilot/compare/v0.1.0...v0.2.0 [0.1.0]: https://git.inference.coop/evanp/inference-coop-copilot/releases/tag/v0.1.0
[0.1.0]: https://git.inference.coop/code/inference-coop-copilot/releases/tag/v0.1.0
+1 -1
View File
@@ -1,4 +1,4 @@
Inference Coop Copilot Inference Coop Copilot (unofficial)
Copyright 2026 Evan Prodromou Copyright 2026 Evan Prodromou
Licensed under the Apache License, Version 2.0. Licensed under the Apache License, Version 2.0.
+5 -5
View File
@@ -1,9 +1,8 @@
# Inference Coop for Copilot Chat # Inference Coop for Copilot Chat (unofficial)
Official model provider for [inference.coop](https://inference.coop), usable Community-built model provider for [inference.coop](https://inference.coop),
in GitHub Copilot Chat. An official project of the Inference Cooperative, usable in GitHub Copilot Chat. Not affiliated with or endorsed by the
maintained in the co-op's Git at Inference Cooperative.
[code/inference-coop-copilot](https://git.inference.coop/code/inference-coop-copilot).
## Requirements ## Requirements
@@ -31,6 +30,7 @@ To use a different gateway, set `inferenceCoop.baseUrl`. To sign out, run
context budgeting is approximate. context budgeting is approximate.
- No inline code completions. Copilot does not support third-party providers - No inline code completions. Copilot does not support third-party providers
for completions; this extension only adds chat models. for completions; this extension only adds chat models.
- Unofficial client. Report extension bugs here, not to the co-op.
## License ## License
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "inference-coop-copilot", "name": "inference-coop-copilot",
"version": "0.3.0", "version": "0.2.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "inference-coop-copilot", "name": "inference-coop-copilot",
"version": "0.3.0", "version": "0.2.2",
"devDependencies": { "devDependencies": {
"@types/mocha": "^10.0.10", "@types/mocha": "^10.0.10",
"@types/node": "24.x", "@types/node": "24.x",
+3 -3
View File
@@ -1,15 +1,15 @@
{ {
"name": "inference-coop-copilot", "name": "inference-coop-copilot",
"displayName": "inference-coop-copilot", "displayName": "inference-coop-copilot",
"description": "Inference.coop models for Copilot Chat", "description": "Inference.coop models for Copilot Chat (unofficial)",
"version": "0.3.0", "version": "0.2.2",
"engines": { "engines": {
"vscode": "^1.145.0" "vscode": "^1.145.0"
}, },
"publisher": "evanp", "publisher": "evanp",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://git.inference.coop/code/inference-coop-copilot.git" "url": "https://git.inference.coop/evanp/inference-coop-copilot.git"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"categories": [ "categories": [