11 Commits
Author SHA1 Message Date
evanp e74d97f4ae chore: publish script 2026-11-08 11:09:16 -05:00
evanp b5c2924886 fix: baseContentUrl for publishing 2026-11-08 11:05:17 -05:00
evanp 892151ef92 0.3.0 2026-11-08 10:58:51 -05:00
evanp 503273f17d chore: release v0.3.0 2026-11-08 10:58:43 -05:00
evanp bbf1b56a76 fix: repository URL 2026-11-08 10:55:57 -05:00
evanp 9b6e78e9f5 chore: mark package as official 2026-11-08 10:52:45 -05:00
evanp 4e50c28def Merge remote-tracking branch 'origin/fix/abort-on-cancel' 2026-11-08 10:48:48 -05:00
inference-bot 8f1d71d913 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-08 15:44:59 +00:00
inference-bot e9a060af0f docs: project is now official
Drop the unofficial framing (title, intro disclaimer, limitations note)
and state the project as official, maintained in the co-op's Git at
code/inference-coop-copilot.
2026-11-07 00:44:54 +00:00
evanp 46b8d7e888 0.2.2 2026-11-06 14:02:02 -05:00
evanp 0460305327 fix: publisher in package.json 2026-11-06 14:01:56 -05:00
6 changed files with 1553 additions and 22 deletions

No files matched your search

+36 -4
View File
@@ -10,6 +10,36 @@ and this project adheres to
## [Unreleased]
### Added
- Set `baseContentUrl` in package.json to the Gitea raw URL, so LICENSE and
NOTICE links in the README resolve correctly on the Marketplace.
- Added an npm `publish` script running `vsce publish`, with `@vscode/vsce`
as a dev dependency, for releasing to the VS Code Marketplace.
## [0.3.0] - 2026-11-08
### 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
### Fixed
- Correct the publisher in package.json.
## [0.2.1] - 2026-11-06
### Fixed
@@ -64,7 +94,9 @@ First release usable for chat.
Initial development release. Not functional for chat.
[Unreleased]: https://git.inference.coop/evanp/inference-coop-copilot/compare/v0.2.1...HEAD
[0.2.1]: https://git.inference.coop/evanp/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.1.0]: https://git.inference.coop/evanp/inference-coop-copilot/releases/tag/v0.1.0
[Unreleased]: https://git.inference.coop/code/inference-coop-copilot/compare/v0.3.0...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/code/inference-coop-copilot/compare/v0.2.1...v0.2.2
[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/code/inference-coop-copilot/compare/v0.1.0...v0.2.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 (unofficial)
Inference Coop Copilot
Copyright 2026 Evan Prodromou
Licensed under the Apache License, Version 2.0.
+5 -5
View File
@@ -1,8 +1,9 @@
# Inference Coop for Copilot Chat (unofficial)
# Inference Coop for Copilot Chat
Community-built model provider for [inference.coop](https://inference.coop),
usable in GitHub Copilot Chat. Not affiliated with or endorsed by the
Inference Cooperative.
Official model provider for [inference.coop](https://inference.coop), usable
in GitHub Copilot Chat. An official project of the Inference Cooperative,
maintained in the co-op's Git at
[code/inference-coop-copilot](https://git.inference.coop/code/inference-coop-copilot).
## Requirements
@@ -30,7 +31,6 @@ To use a different gateway, set `inferenceCoop.baseUrl`. To sign out, run
context budgeting is approximate.
- No inline code completions. Copilot does not support third-party providers
for completions; this extension only adds chat models.
- Unofficial client. Report extension bugs here, not to the co-op.
## License
+1461 -2
View File
File diff suppressed because it is too large. Load diff
+16 -9
View File
@@ -1,15 +1,16 @@
{
"name": "inference-coop-copilot",
"displayName": "inference-coop-copilot",
"description": "Inference.coop models for Copilot Chat (unofficial)",
"version": "0.2.1",
"description": "Inference.coop models for Copilot Chat",
"version": "0.3.0",
"engines": {
"vscode": "^1.145.0"
},
"publisher": "inference-coop",
"publisher": "evanp",
"repository": {
"type": "git",
"url": "https://git.inference.coop/evanp/inference-coop-copilot.git"
"url": "https://git.inference.coop/code/inference-coop-copilot.git",
"baseContentUrl": "https://git.inference.coop/code/inference-coop-copilot/raw/branch/main"
},
"license": "Apache-2.0",
"categories": [
@@ -61,22 +62,28 @@
"pretest": "npm run compile-tests && npm run compile && npm run lint",
"check-types": "tsc --noEmit",
"lint": "eslint src",
"publish": "vsce publish",
"test": "vscode-test"
},
"devDependencies": {
"@types/vscode": "^1.145.0",
"@types/mocha": "^10.0.10",
"@types/node": "24.x",
"typescript-eslint": "^8.61.1",
"eslint": "^10.5.0",
"@types/vscode": "^1.145.0",
"@vscode/test-cli": "^0.0.15",
"@vscode/test-electron": "^3.0.0",
"@vscode/vsce": "^4.1.0",
"esbuild": "^0.28.1",
"eslint": "^10.5.0",
"npm-run-all": "^4.1.5",
"typescript": "^6.0.3",
"@vscode/test-cli": "^0.0.15",
"@vscode/test-electron": "^3.0.0"
"typescript-eslint": "^8.61.1"
},
"overrides": {
"diff": "^8.0.4",
"serialize-javascript": "^7.0.6"
},
"allowScripts": {
"@vscode/vsce-sign@2.1.0": true,
"esbuild@0.28.2": true
}
}
+34 -1
View File
@@ -109,6 +109,19 @@ export function activate(context: vscode.ExtensionContext) {
body.tool_choice = "auto";
}
if (token.isCancellationRequested) {
out.appendLine(" request cancelled before it started");
return;
}
// Abort the request as soon as the user cancels, so a cancelled chat
// stops generating (and stops billing) server-side.
const abort = new AbortController();
const cancelSubscription = token.onCancellationRequested(() =>
abort.abort(),
);
try {
const res = await fetch(`${BASE_URL}/chat/completions`, {
method: "POST",
headers: {
@@ -116,7 +129,7 @@ export function activate(context: vscode.ExtensionContext) {
"Content-Type": "application/json",
},
body: JSON.stringify(body),
signal: token.isCancellationRequested ? AbortSignal.abort() : undefined,
signal: abort.signal,
});
out.appendLine(` /chat/completions status: ${res.status}`);
if (!res.ok || !res.body) {
@@ -157,6 +170,11 @@ export function activate(context: vscode.ExtensionContext) {
};
while (true) {
if (token.isCancellationRequested) {
out.appendLine(" cancelled mid-stream; aborting request");
abort.abort(); // close the connection so the gateway stops generating
return;
}
const { done, value } = await reader.read();
if (done) {
break;
@@ -221,6 +239,21 @@ export function activate(context: vscode.ExtensionContext) {
flushTools();
}
out.appendLine(` stream ended, ${textChunks} text chunks`);
} catch (e) {
// A cancellation aborts fetch (before headers) or the pending stream
// read (mid-response) - both surface as AbortError. That is the user
// pressing stop, not a failure: stop quietly instead of erroring.
if (
token.isCancellationRequested ||
(e instanceof Error && e.name === "AbortError")
) {
out.appendLine(" stream aborted after cancellation");
return;
}
throw e;
} finally {
cancelSubscription.dispose();
}
},
async provideTokenCount() {