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
2 changes: 1 addition & 1 deletion .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
sync:
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
permissions:
contents: write
pull-requests: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:

jobs:
build:
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
env:
REGISTRY: ghcr.io/${{ github.repository_owner }}
TAG: "24.04"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-locale-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
sync-locales:
if: false
#if: github.actor != 'opencode-agent[bot]'
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
jobs:
update-docs:
if: github.repository == 'sst/opencode'
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
permissions:
id-token: write
contents: write
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/duplicate-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
check-duplicates:
if: github.event.action == 'opened'
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
permissions:
contents: read
issues: write
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:

recheck-compliance:
if: github.event.action == 'edited' && contains(github.event.issue.labels.*.name, 'needs:compliance')
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
permissions:
contents: read
issues: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
generate:
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
permissions:
contents: write
pull-requests: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nix-eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:

jobs:
nix-eval:
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout repository
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nix-hashes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
matrix:
include:
- system: x86_64-linux
runner: blacksmith-4vcpu-ubuntu-2404
runner: ubuntu-24.04
- system: aarch64-linux
runner: blacksmith-4vcpu-ubuntu-2404-arm
runner: ubuntu-24.04-arm
- system: x86_64-darwin
runner: macos-15-intel
- system: aarch64-darwin
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
update-hashes:
needs: compute-hash
if: github.event_name != 'pull_request'
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04

steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/notify-discord.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
notify:
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
steps:
- name: Send nicely-formatted embed to Discord
uses: SethCohen/github-releases-to-discord@24d166886aee4646d448c8a389ff9e1ebcab3682 # v1.20.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/opencode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
startsWith(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, ' /opencode') ||
startsWith(github.event.comment.body, '/opencode')
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
permissions:
id-token: write
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
check-duplicates:
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
permissions:
contents: read
pull-requests: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-github-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:

jobs:
publish:
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-vscode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:

jobs:
publish:
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ permissions:

jobs:
version:
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
if: github.repository == 'anomalyco/opencode'
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:

build-cli:
needs: version
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
if: github.repository == 'anomalyco/opencode'
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
needs:
- build-cli
- version
runs-on: blacksmith-4vcpu-windows-2025
runs-on: windows-2025
if: github.repository == 'anomalyco/opencode'
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
Expand Down Expand Up @@ -242,17 +242,16 @@ jobs:
target: aarch64-apple-darwin
platform_flag: --mac --arm64
bun_install_flags: --os=darwin --cpu=arm64
# github-hosted: blacksmith lacks ARM64 MSVC cross-compilation toolchain
- host: "windows-2025"
target: aarch64-pc-windows-msvc
platform_flag: --win --arm64
- host: "blacksmith-4vcpu-windows-2025"
- host: "windows-2025"
target: x86_64-pc-windows-msvc
platform_flag: --win
- host: "blacksmith-4vcpu-ubuntu-2404"
- host: "ubuntu-24.04"
target: x86_64-unknown-linux-gnu
platform_flag: --linux
- host: "blacksmith-4vcpu-ubuntu-2404-arm"
- host: "ubuntu-24.04-arm"
target: aarch64-unknown-linux-gnu
platform_flag: --linux --arm64
runs-on: ${{ matrix.settings.host }}
Expand Down Expand Up @@ -412,7 +411,7 @@ jobs:
- sign-cli-windows
- build-electron
if: always() && !failure() && !cancelled()
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-github-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:

jobs:
release:
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
github.event.issue.pull_request &&
startsWith(github.event.comment.body, '/review') &&
contains(fromJson('["OWNER","MEMBER"]'), github.event.comment.author_association)
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
permissions:
contents: read
pull-requests: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
stats:
if: github.repository == 'anomalyco/opencode'
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
permissions:
contents: write

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ concurrency:
jobs:
build:
name: storybook build
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
Expand Down
36 changes: 30 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
matrix:
settings:
- name: linux
host: blacksmith-4vcpu-ubuntu-2404
host: ubuntu-24.04
- name: windows
host: blacksmith-4vcpu-windows-2025
host: windows-2025
runs-on: ${{ matrix.settings.host }}
defaults:
run:
Expand Down Expand Up @@ -63,9 +63,33 @@ jobs:
turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json') }}-
turbo-${{ runner.os }}-

- name: Install ripgrep (Windows)
# RipgrepBinary prefers a PATH-resolved rg.exe; without one, the first
# ripgrep test pays a cold download + Expand-Archive that exceeds the
# 5s per-test timeout on hosted runners. Version pinned to match
# packages/core/src/ripgrep/binary.ts.
if: runner.os == 'Windows'
run: |
curl -fsSL --retry 3 -o "$RUNNER_TEMP/rg.zip" https://github.com/BurntSushi/ripgrep/releases/download/15.1.0/ripgrep-15.1.0-x86_64-pc-windows-msvc.zip
7z e "$RUNNER_TEMP/rg.zip" -o"$RUNNER_TEMP/ripgrep" rg.exe -r -y
"$RUNNER_TEMP/ripgrep/rg.exe" --version
echo "$RUNNER_TEMP/ripgrep" >> "$GITHUB_PATH"

- name: Cache downloaded tool binaries
# Ripgrep tests download rg into ~/.cache/opencode/bin on first use;
# on GitHub-hosted windows runners that download has blown the test
# timeout. Cache it so only version bumps re-download.
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.cache/opencode/bin
key: opencode-bin-${{ runner.os }}-${{ hashFiles('packages/core/src/ripgrep/binary.ts') }}
- name: Run unit tests
timeout-minutes: 20
run: GITHUB_ACTIONS=false bun turbo test
# opencode#test alone takes ~20 minutes on GitHub-hosted windows runners.
# --log-order=stream keeps per-task output visible if the step is ever
# killed; turbo's CI default (grouped) buffers a task's output until it
# finishes, so a timeout eats the entire log (LAC-2717).
timeout-minutes: 35
run: GITHUB_ACTIONS=false bun turbo test --log-order=stream
env:
OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: ${{ runner.os == 'Windows' && 'true' || 'false' }}

Expand All @@ -86,9 +110,9 @@ jobs:
matrix:
settings:
- name: linux
host: blacksmith-4vcpu-ubuntu-2404
host: ubuntu-24.04
- name: windows
host: blacksmith-4vcpu-windows-2025
host: windows-2025
runs-on: ${{ matrix.settings.host }}
env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/.playwright-browsers
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
triage:
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
permissions:
contents: read
issues: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
typecheck:
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
Expand Down
16 changes: 15 additions & 1 deletion packages/core/src/filesystem/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,35 @@ export const ripgrepLayer = Layer.effect(
files: [] as string[],
directories: [] as string[],
}
const files = new Set<string>()
const directories = new Set<string>()
// The scan fills the find() index incrementally. A transient spawn failure
// or hung rg process would otherwise kill this forked fiber silently and
// leave find() empty forever (LAC-2693), so bound each attempt, retry, and
// log a scan that never completes. Dedupe keeps retries from re-adding
// entries already indexed by an interrupted attempt.
yield* ripgrep
.find({
cwd: location.directory,
pattern: "*",
limit: location.vcs ? Number.MAX_SAFE_INTEGER : 100_000,
onEntry: (entry) =>
Effect.sync(() => {
if (files.has(entry.path)) return
files.add(entry.path)
state.files.push(entry.path)
const parts = entry.path.split("/")
parts.slice(0, -1).forEach((_, index) => directories.add(parts.slice(0, index + 1).join("/") + path.sep))
state.directories = Array.from(directories)
}),
})
.pipe(Effect.orDie, Effect.asVoid, Effect.forkIn(scope))
.pipe(
Effect.timeout("120 seconds"),
Effect.retry({ times: 2 }),
Effect.catch((error) => Effect.logWarning("file index scan failed", { error })),
Effect.asVoid,
Effect.forkIn(scope),
)
return Service.of({
glob: (input) =>
Effect.gen(function* () {
Expand Down
6 changes: 6 additions & 0 deletions packages/core/test/filesystem/search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import { testEffect } from "../lib/effect"

const it = testEffect(LayerNode.compile(Ripgrep.node))

// first Ripgrep use may download and extract the rg binary, which exceeds the
// default 5s test timeout on Windows CI runners (PowerShell Expand-Archive)
const RG_DOWNLOAD = { timeout: 120_000 }

const withTmp = <A, E, R>(f: (directory: AbsolutePath) => Effect.Effect<A, E, R>) =>
Effect.acquireRelease(
Effect.promise(() => tmpdir()),
Expand All @@ -26,6 +30,7 @@ describe("Ripgrep", () => {
expect(result.map((item) => item.path)).toEqual([RelativePath.make("src/match.ts")])
}),
),
RG_DOWNLOAD,
)

it.live("greps files with include filtering", () =>
Expand All @@ -40,5 +45,6 @@ describe("Ripgrep", () => {
expect(result[0]?.submatches[0]?.text).toBe("needle")
}),
),
RG_DOWNLOAD,
)
})
Loading
Loading