Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
cb104e9
ci: ignore
thdxr Jun 27, 2025
5524280
ci: ignore
thdxr Jun 27, 2025
1306a41
fix: unawaited promise causes opencode to use unenabled formatter (#625)
rekram1-node Jul 2, 2025
f268613
fix: typescript error (#618)
timoclsn Jul 3, 2025
aff300d
ignore: ci
thdxr Jul 19, 2025
205a5e0
ci: ignore
thdxr Jul 19, 2025
684abe6
Add opencode workflow
Aug 24, 2025
b2729b3
Add opencode workflow
Aug 24, 2025
e623130
Add opencode workflow
Aug 24, 2025
5aa9978
Add opencode workflow
Aug 25, 2025
d924927
Add opencode workflow
Aug 25, 2025
fb00c18
ci
thdxr Dec 24, 2025
3dfa092
chore: consolidate and standardize workflow files (#11183)
thdxr Jan 29, 2026
d857bc7
ci
thdxr Jan 30, 2026
630af13
ci
thdxr Feb 2, 2026
b8bc68b
chore: make dax shut up (#12375)
rekram1-node Feb 5, 2026
47e39d4
refactor: migrate cli/cmd/github.ts from Bun.write() to Filesystem mo…
thdxr Feb 18, 2026
37a5fee
refactor: migrate uninstall.ts from Bun.file()/Bun.write() to Filesys…
thdxr Feb 18, 2026
1a0232f
refactor: migrate src/file/time.ts from Bun.file() to stat (#14141)
thdxr Feb 18, 2026
ec72505
refactor: migrate src/lsp/client.ts from Bun.file() to Filesystem mod…
thdxr Feb 18, 2026
b8cbb4e
feat(vscode): VS Code chat participant with ACP integration
rudironsoni Feb 28, 2026
5afd4f5
Address Copilot review comments
rudironsoni Mar 1, 2026
8252e9d
Address remaining Copilot review comments: session key collision and …
rudironsoni Mar 1, 2026
1967a6a
Revert: Remove incorrect --dev flag from bun install
rudironsoni Mar 1, 2026
fe06979
feat(vscode): Add screenshot capture system for integration tests
rudironsoni Mar 1, 2026
2334634
fix(vscode): Correct test file paths in .vscode-test.mjs
rudironsoni Mar 1, 2026
d328a97
feat(vscode): Add screenshot capture system for integration tests
rudironsoni Mar 1, 2026
4d2c47e
fix(vscode): fix all failing tests and screenshot output path
rudironsoni Mar 1, 2026
f2b656d
feat(vscode): Add Playwright E2E tests for chat participant UI
rudironsoni Mar 1, 2026
9e42cbf
feat(vscode): enterprise-grade E2E testing with dual VS Code: channels
rudironsoni Mar 3, 2026
994f435
fix(vscode): remove Insiders guard, fix participant ID mismatch, add …
rudironsoni Mar 3, 2026
3c4885c
test(vscode): add e2e evidence capture and CI updates
Mar 4, 2026
ea2672b
test(e2e): add compiled bootstrap+smoke test to validate evidence cap…
Mar 4, 2026
21e0291
chore(test): add mochawesome reporter to devDependencies for CI evide…
Mar 4, 2026
9f383cd
test(e2e): use relative path for mocha require in .vscode-test.mjs
Mar 4, 2026
acaaaaa
test(e2e): use spec reporter for VS Code e2e (avoid mochawesome depen…
Mar 4, 2026
432d65a
test(e2e): pin mochawesome@7.1.3 and restore mochawesome reporter for…
Mar 5, 2026
d15da2f
test(e2e): make smoke test passing
Mar 5, 2026
d9840b5
test(e2e): add temporary failing test to force evidence capture
Mar 5, 2026
ab0dd03
test(e2e): improve Playwright attach retry and mirror artifacts for s…
Mar 5, 2026
c142f27
feat(testing): add opencode.captureEvidence command using VS Code/Ele…
Mar 5, 2026
98b73bc
test: add file-trigger capture mechanism and evidence helper retries
Mar 5, 2026
aae5784
test: add package-local capture trigger dir and poller for reliable e…
Mar 5, 2026
acd7b34
test: write processed marker for capture triggers so runner can detec…
Mar 5, 2026
18a7973
feat: updated tests
Mar 6, 2026
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
100 changes: 100 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Copilot instructions — OpenCode monorepo

Purpose: concise, repo-specific guidance for Copilot/automation sessions.

---

## Quick setup & prerequisites

- Requires Bun 1.3+ (repo packageManager: `bun@...`).
- From repo root:
- `bun install` — install workspace deps
- `bun dev` — start default dev server (runs `packages/opencode` by default)
- `bun run typecheck` — turbo typecheck across workspace
- Note: tests are intentionally guarded at repo root (root `test` prints an error). Run tests from the package that owns them (see examples below).

## Build / test / lint (examples)

- General
- Build a standalone OpenCode binary: `./packages/opencode/script/build.ts --single`
- Run a package script from repo root: `bun run --cwd packages/<pkg> <script>`

- packages/app (web)
- `bun run --cwd packages/app dev` — start web dev server
- `bun run --cwd packages/app test:e2e` — run Playwright E2E
- Run a single E2E spec: `bun run --cwd packages/app test:e2e -- path/to/feature-name.spec.ts`
- Run a single test by title: `bun run --cwd packages/app test:e2e -- -g "test title"`
- Unit tests: `bun run --cwd packages/app test:unit` (bun test supports path/filters)

- sdks/vscode (VS Code extension)
- `cd sdks/vscode`
- `bun install`
- `bun run lint` — runs `eslint src`
- `bun run compile-tests` — `tsc -p tsconfig.test.json`
- `bun run test` — runs `vscode-test run --config .vscode-test.mjs`
- To run a single test: compile tests and run the compiled file or use the underlying test runner's filters (e.g. compile then run the compiled test at `out/.../testfile.js`, or pass filters to the runner).
- Debug the extension with VS Code Insiders and `--enable-proposed-api sst-dev.opencode`.

- packages/desktop (Tauri)
- `bun run --cwd packages/desktop tauri dev`

- General lint
- Run a package lint script or: `bun run --cwd packages/<pkg> lint` (where defined)

## How to run a single test (summary)

- Playwright E2E (packages/app/e2e): `bun run --cwd packages/app test:e2e -- path/to/spec.ts` or `-- -g "title"` to filter by name.
- bun-based unit tests: `bun test <path>` or the package's `test` script with a path/filter.
- For VS Code extension tests (vscode-test), compile (`compile-tests`) then run the specific compiled test artifact or use runner filtering where supported.

## High-level architecture (big picture)

- Monorepo (Bun + Turbo). Default branch: `dev`.
- Key packages:
- `packages/opencode` — core server, CLI, and TUI (server & business logic)
- `packages/app` — web UI (SolidJS + Vite)
- `packages/desktop` — Tauri wrapper for native app
- `packages/sdk/js` — JavaScript SDK build
- `sdks/vscode` — VS Code extension (requires proposed APIs; use VS Code Insiders)
- Several other packages (`plugin`, `console`, `ui`, `storyboard`, etc.) compose features and integrations.
- Tests & CI
- E2E: Playwright under `packages/app/e2e` (fixtures, helpers, and selectors live there).
- Unit tests: per-package `bun test` or package test scripts. **Do not run tests from repo root.**

## Key repository conventions (what Copilot should follow)

- Tooling & branches
- Use Bun for package tasks where possible; many scripts assume `bun`.
- Default branch for diffs and PRs: `dev` (local `main` may not exist).
- Regenerate the JS SDK with: `./packages/sdk/js/script/build.ts`.

- Coding style (see `AGENTS.md` / `CONTRIBUTING.md` for full details)
- Prefer single-word variable names when they remain descriptive.
- Favor `const` over `let` and avoid unnecessary destructuring.
- Avoid `try`/`catch` where possible; prefer `.catch(...)` for promises.
- Prefer Bun APIs (e.g., `Bun.file()`) and use type inference; avoid `any`.
- Drizzle schema fields: use `snake_case` column names.
- Keep logic in one function unless composition or reuse justifies breaking out.

- Testing & PR workflow
- Tests should avoid mocks where possible — prefer testing real implementations.
- Tests cannot run from repo root (guard `do-not-run-tests-from-root`); execute tests from the package directory.
- PRs must reference an existing issue (Issue-first policy). Use `Fixes #NN` in the PR body.
- PR titles should follow conventional commits (e.g., `feat(app): ...`, `fix: ...`).
- Do not submit long AI-generated PR descriptions (keep PR bodies focused and human-written).
- There is a vouch system at `.github/VOUCHED.td` for trusted contributors.

- Automation/Copilot-specific rules
- ALWAYS use parallel tool calls when independent operations can be parallelized.
- Prefer package-level operations (use `--cwd` or `cd` into the package) rather than performing heavy work at repo root.
- Respect repo guards (do not run root test scripts, follow PR/issue policy).

## Files to consult (shortlist)
- `CONTRIBUTING.md` — setup, `bun dev`, debugging and build commands
- `AGENTS.md` — style guide, testing guardrails, and the parallel-tools note
- `packages/app/e2e/AGENTS.md` — Playwright patterns and single-test examples
- `sdks/vscode/README.md` & `sdks/vscode/package.json` — extension-specific scripts and dev notes

---

If you want, I can also add suggested MCP server configs (for example Playwright e2e runners) into the repo’s CI/workflows — would you like me to add MCP server configuration for Playwright or other services?
38 changes: 38 additions & 0 deletions .github/workflows/vscode-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: VS Code Extension Tests

on:
push:
branches: [dev]
paths: [sdks/vscode/**]
pull_request:
paths: [sdks/vscode/**]

jobs:
vscode:
name: vscode (${{ matrix.os }})
strategy:
matrix:
os: [blacksmith-4vcpu-ubuntu-2404, blacksmith-4vcpu-windows-2025]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-bun

- name: Install vscode dependencies
run: bun install --cwd sdks/vscode --dev
shell: bash

- name: Install xvfb
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y xvfb

- name: Build
run: bun --cwd sdks/vscode run compile

- name: Test
if: runner.os == 'Linux'
run: xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" bun run --cwd sdks/vscode test

- name: Test
if: runner.os == 'Windows'
run: bun --cwd sdks/vscode run test
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ Learn more about [agents](https://opencode.ai/docs/agents).

For more info on how to configure OpenCode, [**head over to our docs**](https://opencode.ai/docs).

> [!NOTE]
> The VS Code extension uses proposed APIs for chat session targets and requires VS Code Insiders with
> `--enable-proposed-api sst-dev.opencode` when running the extension host.

### Contributing

If you're interested in contributing to OpenCode, please read our [contributing docs](./CONTRIBUTING.md) before submitting a pull request.
Expand Down
7 changes: 6 additions & 1 deletion packages/app/script/e2e-local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ const serverEnv = {
OPENCODE_E2E_PROJECT_DIR: repoDir,
OPENCODE_E2E_SESSION_TITLE: "E2E Session",
OPENCODE_E2E_MESSAGE: "Seeded for UI e2e",
OPENCODE_E2E_MODEL: "opencode/gpt-5-nano",
OPENCODE_E2E_MODEL: "opencode/big-pickle",
OPENCODE_CLIENT: "app",
OPENCODE_CONFIG_CONTENT: JSON.stringify({
model: "opencode/big-pickle",
small_model: "opencode/big-pickle",
}),
} satisfies Record<string, string>

const runnerEnv = {
Expand All @@ -82,6 +86,7 @@ const runnerEnv = {
VITE_OPENCODE_SERVER_HOST: "127.0.0.1",
VITE_OPENCODE_SERVER_PORT: String(serverPort),
PLAYWRIGHT_PORT: String(webPort),
XDG_CACHE_HOME: process.env.XDG_CACHE_HOME ?? path.join(os.homedir(), ".cache"),
} satisfies Record<string, string>

let seed: ReturnType<typeof Bun.spawn> | undefined
Expand Down
Loading
Loading