Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .changeset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ npm run changeset

Choose `patch`, `minor`, or `major`, then describe the user-visible change. The
release workflow collects pending changesets into a version pull request.
Merging that pull request packages the VSIX and creates a matching GitHub
release. Visual Studio Marketplace publishing is temporarily disabled.
Merging that pull request packages the VSIX, publishes it to the Visual Studio
Marketplace using the existing `VSCE_PAT` repository secret, and creates a matching
GitHub release.

Documentation-only and internal maintenance changes may use an empty
changeset:
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ permissions:

jobs:
release:
name: Changesets and GitHub release
name: Changesets and Marketplace
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -61,13 +61,19 @@ jobs:
if: steps.release.outputs.publish == 'true'
run: npm run package

- name: Publish to Visual Studio Marketplace
if: steps.release.outputs.publish == 'true'
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: npx vsce publish --packagePath "opencode-bridge-for-copilot-chat-${{ steps.release.outputs.version }}.vsix" --skip-duplicate

- name: Create GitHub release
if: steps.release.outputs.publish == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ steps.release.outputs.tag }}" \
"opencode-bridge-copilot-chat-${{ steps.release.outputs.version }}.vsix" \
"opencode-bridge-for-copilot-chat-${{ steps.release.outputs.version }}.vsix" \
--target "$GITHUB_SHA" \
--title "${{ steps.release.outputs.tag }}" \
--generate-notes
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.0.0

### Major Changes

- Launch OpenCode Bridge for Copilot Chat v1.0.0 under the new extension ID `grikomsn.opencode-bridge-for-copilot-chat` and restore Visual Studio Marketplace publishing. Remove the temporary GitHub update notifier in favor of VS Code updates. Users of the previous extension should disable or uninstall it, install the new listing, and sign in again; existing `opencode.*` settings retain their names.

## 0.8.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

Thanks for helping improve OpenCode for Copilot Chat.
Thanks for helping improve OpenCode Bridge for Copilot Chat.

## Before opening work

Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="https://raw.githubusercontent.com/grikomsn/opencode-copilot-chat/main/assets/cover.jpg" alt="OpenCode and GitHub Copilot" width="960">
</p>

<h1 align="center">OpenCode for Copilot Chat</h1>
<h1 align="center">OpenCode Bridge for Copilot Chat</h1>

<p align="center">Use OpenCode Console and OpenCode Go models directly from the GitHub Copilot Chat model picker in Visual Studio Code.</p>

Expand All @@ -14,9 +14,6 @@

This native VS Code `LanguageModelChatProvider` registers Console and Go as separate provider groups and streams their responses into Copilot Chat without a local proxy. VS Code 1.125 exposes the provider-entry configuration through the built-in Language Models UI; the packaged extension does not enable proposed APIs.

> [!IMPORTANT]
> Visual Studio Marketplace publishing is temporarily paused. Install and update the extension by sideloading the VSIX attached to the [latest GitHub release](https://github.com/grikomsn/opencode-copilot-chat/releases/latest).

## Highlights

- Separate OpenCode Console and Go model groups
Expand All @@ -29,15 +26,17 @@ This native VS Code `LanguageModelChatProvider` registers Console and Go as sepa

## Quick start

1. Download the `.vsix` asset from the [latest GitHub release](https://github.com/grikomsn/opencode-copilot-chat/releases/latest). You need VS Code 1.125 or newer and GitHub Copilot Chat.
2. In VS Code, open **Extensions**, select the **…** menu, choose **Install from VSIX…**, and select the downloaded file. Alternatively, run `code --install-extension ./opencode-bridge-copilot-chat-<version>.vsix --force`.
1. Install [OpenCode Bridge for Copilot Chat](https://marketplace.visualstudio.com/items?itemName=grikomsn.opencode-bridge-for-copilot-chat) from the Visual Studio Marketplace. You need VS Code 1.125 or newer and GitHub Copilot Chat.
2. Alternatively, run `code --install-extension grikomsn.opencode-bridge-for-copilot-chat`. For manual installation, download the `.vsix` from the [latest GitHub release](https://github.com/grikomsn/opencode-copilot-chat/releases/latest) and run `code --install-extension ./opencode-bridge-for-copilot-chat-<version>.vsix --force`.
3. For Console or Go, open **Manage Language Models**, choose **Add Models**, select the provider, name the entry, and paste its service-account API key (Console entries can omit the key and use a device-code profile instead).
4. For Console device-code sign-in, run **OpenCode: Add Console Account**, choose a profile ID, then add an OpenCode Console entry with the same ID in **Manage Language Models**. Go can also sign in with the same Console device-code flow from the Manage Connection menu.
5. Repeat either flow for another account or key, then enable the models you want in Copilot Chat.

VS Code cannot automatically update a sideloaded build from GitHub. To update, download the newest VSIX from the latest release and repeat step 2; the newer build replaces the installed version while preserving the extension's stored settings and credentials.
Marketplace installations receive updates through VS Code. Manual VSIX installations can be updated by installing the newest release asset.

### Moving from the previous extension

While Marketplace publishing is paused, the extension checks GitHub Releases at most once every 24 hours. When a newer VSIX is available, it shows a one-time notification with a link to the release and sideloading guidance.
Version 1.0.0 starts a new listing with ID `grikomsn.opencode-bridge-for-copilot-chat`. Disable or uninstall `grikomsn.opencode-bridge-copilot-chat` before installing the new extension to avoid duplicate providers and commands. Sign in again or re-enter your API keys in the new extension; its Secret Storage and local usage state are separate. Existing `opencode.*` workspace settings retain their names.

Composer controls override workspace defaults; ordered effort controls default to High, binary controls default On, and Qwen defaults Auto. Console and Go use each entry's authenticated live catalog, while a Console device-code profile shows only models enabled for that profile's selected organization. Click the OpenCode status-bar item to inspect tokens for the most recently used entry.

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Supported versions

Security fixes target the latest version published on the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=grikomsn.opencode-bridge-copilot-chat). Update to the latest release before reporting an issue that may already be fixed.
Security fixes target the latest version published on the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=grikomsn.opencode-bridge-for-copilot-chat). Update to the latest release before reporting an issue that may already be fixed.

## Reporting a vulnerability

Expand Down
6 changes: 6 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ npm run package
```

The extension host is the right place to test authenticated inference. Unit tests use injected fetchers and fake Secret Storage; they never contact OpenCode with real credentials.

## Releases

User-visible changes use Changesets. The release workflow opens a version pull request; after it is merged, CI validates and packages the extension, publishes it to the Visual Studio Marketplace using the existing `VSCE_PAT` repository secret, and attaches the VSIX to a GitHub release.

The extension ID is `grikomsn.opencode-bridge-for-copilot-chat`; release assets use `opencode-bridge-for-copilot-chat-<version>.vsix`. `npm run release` validates and publishes locally when `VSCE_PAT` is available.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "opencode-bridge-copilot-chat",
"displayName": "OpenCode for Copilot Chat",
"name": "opencode-bridge-for-copilot-chat",
"displayName": "OpenCode Bridge for Copilot Chat",
"description": "Use OpenCode Console and Go models in GitHub Copilot Chat.",
"version": "0.8.0",
"version": "1.0.0",
"publisher": "grikomsn",
"license": "MIT",
"icon": "assets/icon.png",
Expand Down Expand Up @@ -83,7 +83,7 @@
}
],
"configuration": {
"title": "OpenCode for Copilot Chat",
"title": "OpenCode Bridge for Copilot Chat",
"properties": {
"opencode.defaultMode": {
"type": "string",
Expand Down Expand Up @@ -412,7 +412,7 @@
"check": "npm test",
"changeset": "changeset",
"version": "changeset version",
"release": "npm run package",
"release": "npm run check && vsce publish --skip-duplicate",
"prepackage": "npm run check",
"package": "vsce package",
"vscode:prepublish": "npm run compile"
Expand Down
2 changes: 1 addition & 1 deletion src/commands/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ async function diagnostics(auth: OpenCodeAuth, providers: OpenCodeProviders): Pr
const session = await auth.getConsoleSession(activeConsole);
const apiKeys = await auth.getApiKeys();
const lines = [
"# OpenCode for Copilot Chat diagnostics", "", `- VS Code: ${vscode.version}`,
"# OpenCode Bridge for Copilot Chat diagnostics", "", `- VS Code: ${vscode.version}`,
`- Console profiles: ${profiles.length ? profiles.join(", ") : "none"}`,
`- Active Console profile: ${activeConsole}`,
`- Active Console session: ${session ? "present" : "missing"}`,
Expand Down
38 changes: 1 addition & 37 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,17 @@ import * as vscode from "vscode";
import { registerInlineCompletions } from "./autocomplete";
import { OpenCodeAuth } from "./auth/auth";
import { registerCommands } from "./commands/commands";
import { messageOf } from "./errors";
import { OpenCodeProvider } from "./provider";
import { ModelCatalog } from "./models/catalog";
import { ModelsDevMetadata } from "./models/metadata";
import { OPENCODE_PROVIDER_DEFINITIONS } from "./provider/definitions";
import { formatUsageStatus, formatUsageTooltip } from "./usage/presentation";
import type { OpenCodeUsageSnapshot } from "./usage/domain";
import { activeConsoleProfileFromState } from "./provider-profile";
import { isNewerVersion, parseExtensionRelease, RELEASES_LATEST_API_URL } from "./updates/releases";

const LEGACY_USAGE_STATE_KEY = "opencode.usageSnapshot.v1";
const USAGE_STATE_KEY = "opencode.usageSnapshots.v2";
const ACTIVE_CONSOLE_PROFILE_STATE_KEY = "opencode.activeConsoleProfile.v1";
const RELEASE_CHECKED_AT_STATE_KEY = "opencode.releaseCheckedAt.v1";
const RELEASE_NOTIFIED_TAG_STATE_KEY = "opencode.releaseNotifiedTag.v1";
const RELEASE_CHECK_INTERVAL_MS = 24 * 60 * 60 * 1_000;

export function activate(context: vscode.ExtensionContext): void {
const output = vscode.window.createOutputChannel("OpenCode");
Expand Down Expand Up @@ -88,38 +83,7 @@ export function activate(context: vscode.ExtensionContext): void {
userAgent,
}),
);
const releaseTimer = setInterval(() => void checkForRelease(context, version, userAgent, output), RELEASE_CHECK_INTERVAL_MS);
context.subscriptions.push(new vscode.Disposable(() => clearInterval(releaseTimer)));
void checkForRelease(context, version, userAgent, output);
output.appendLine(`[activate] OpenCode for Copilot Chat ${version} on VS Code ${vscode.version}`);
}

async function checkForRelease(
context: vscode.ExtensionContext,
currentVersion: string,
userAgent: string,
output: vscode.OutputChannel,
): Promise<void> {
const checkedAt = context.globalState.get<number>(RELEASE_CHECKED_AT_STATE_KEY) ?? 0;
if (Date.now() - checkedAt < RELEASE_CHECK_INTERVAL_MS) return;
await context.globalState.update(RELEASE_CHECKED_AT_STATE_KEY, Date.now());
try {
const response = await fetch(RELEASES_LATEST_API_URL, {
headers: { Accept: "application/vnd.github+json", "User-Agent": userAgent, "X-GitHub-Api-Version": "2022-11-28" },
});
if (!response.ok) throw new Error(`GitHub release check returned HTTP ${response.status}`);
const release = parseExtensionRelease(await response.json());
if (!release || !isNewerVersion(release.version, currentVersion)) return;
if (context.globalState.get<string>(RELEASE_NOTIFIED_TAG_STATE_KEY) === release.tag) return;
await context.globalState.update(RELEASE_NOTIFIED_TAG_STATE_KEY, release.tag);
const action = await vscode.window.showInformationMessage(
`OpenCode for Copilot Chat ${release.version} is available. Download the VSIX, then use Extensions → … → Install from VSIX… to update.`,
"View Release",
);
if (action === "View Release") await vscode.env.openExternal(vscode.Uri.parse(release.pageUrl));
} catch (error) {
output.appendLine(`[updates] daily GitHub release check failed: ${messageOf(error)}`);
}
output.appendLine(`[activate] OpenCode Bridge for Copilot Chat ${version} on VS Code ${vscode.version}`);
}

function renderUsageStatus(item: vscode.StatusBarItem, snapshot: OpenCodeUsageSnapshot): void {
Expand Down
46 changes: 0 additions & 46 deletions src/updates/releases.test.ts

This file was deleted.

58 changes: 0 additions & 58 deletions src/updates/releases.ts

This file was deleted.

Loading