Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9043d92
fix: hide skill prompt text from chat UI
lgarceau768 Apr 8, 2026
8fc831e
fix: respect tool_call: false capability flag at runtime
lgarceau768 Apr 8, 2026
9129fd7
docs: add local build and AWS Bedrock setup instructions
lgarceau768 Apr 15, 2026
cd21796
fix: re-sign macOS binaries after Bun compile to fix Darwin 25+ SIGKILL
rgoshen Apr 16, 2026
2a67b0f
Merge pull request #3 from flexion/fix/bun-build-issue-on-macos-darwin25
lgarceau768 Apr 20, 2026
998ffb5
fix(bedrock): add inference profile prefixes and fix reasoning for ad…
sfradkin Apr 20, 2026
eb0dd25
chore - merge dev into flex, resolve conflicts in session/llm.ts and …
lgarceau768 Apr 20, 2026
a128f55
docs: update LOCAL_AWS_SETUP.md with corrected model config keys and …
sfradkin Apr 20, 2026
a2233d2
Merge pull request #7 from flexion/chore/merge-dev-into-flex
lgarceau768 Apr 20, 2026
5e3eb0f
Merge remote-tracking branch 'origin/bedrock-model-config-update' int…
lgarceau768 Apr 20, 2026
9070214
chore: change profile name
lgarceau768 Apr 21, 2026
9eba8a7
chore: change aws profile name
lgarceau768 Apr 21, 2026
a03b21a
fix: bump @opentui/core and @opentui/solid catalog to 0.1.101
sfradkin Apr 21, 2026
b24baeb
docs: update opencode-work shell function with credential check and s…
sfradkin Apr 21, 2026
92c3fd4
Merge branch 'flex' into docs/update-opencode-work-function
lgarceau768 Apr 21, 2026
2e92b8f
Merge branch 'fix/opentui-version-mismatch' of personal:flexion/openc…
lgarceau768 Apr 21, 2026
fb032ac
chore: add install-flex automated setup script and update docs
lgarceau768 Apr 22, 2026
23b2cc8
fix - pin OPENCODE_CHANNEL=flex at build time to prevent per-branch D…
lgarceau768 Apr 22, 2026
1f2df7f
fix - install unzip and extend setup-bun to handle ARM64 Blacksmith r…
lgarceau768 Apr 22, 2026
6e9742e
fix - also install build-essential for node-gyp native addon compilat…
lgarceau768 Apr 22, 2026
b9810c4
fix - cache npm registry and pre-warm @opencode-ai/plugin to fix plug…
lgarceau768 Apr 22, 2026
94ff3f0
fix - skip arborist plugin deps install in tests; bump snapshot rever…
lgarceau768 Apr 22, 2026
4b61290
fix - raise shell-loop test timeout from 3 s to 15 s for ARM64 CI
lgarceau768 Apr 22, 2026
10ec91c
chore - add session persistence for chore/bolster-install
lgarceau768 Apr 22, 2026
48b5196
fix - raise BusyError-when-loop test timeout from 3 s to 15 s for ARM…
lgarceau768 Apr 22, 2026
26c09fd
Merge pull request #11 from flexion/chore/bolster-install
lgarceau768 Apr 23, 2026
a6d8168
Update model identifiers in LOCAL_AWS_SETUP.md
lgarceau768 Apr 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 28 additions & 10 deletions .github/actions/setup-bun/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,37 @@ description: "Setup Bun with caching and install dependencies"
runs:
using: "composite"
steps:
- name: Get baseline download URL
- name: Ensure build tools are available
if: runner.os == 'Linux'
shell: bash
# Blacksmith's ARM64 ubuntu-2404 runners ship a minimal image that is missing:
# unzip — needed by oven-sh/setup-bun to extract the downloaded bun zip
# build-essential (make, g++) — needed by node-gyp to compile native addons
# (e.g. tree-sitter-powershell) during `bun install`
run: |
PKGS=()
command -v unzip >/dev/null 2>&1 || PKGS+=(unzip)
command -v make >/dev/null 2>&1 || PKGS+=(build-essential)
[ ${#PKGS[@]} -gt 0 ] && sudo apt-get install -y --no-install-recommends "${PKGS[@]}"
true

- name: Get bun download URL
id: bun-url
shell: bash
run: |
if [ "$RUNNER_ARCH" = "X64" ]; then
V=$(node -p "require('./package.json').packageManager.split('@')[1]")
case "$RUNNER_OS" in
macOS) OS=darwin ;;
Linux) OS=linux ;;
Windows) OS=windows ;;
esac
echo "url=https://github.com/oven-sh/bun/releases/download/bun-v${V}/bun-${OS}-x64-baseline.zip" >> "$GITHUB_OUTPUT"
fi
V=$(node -p "require('./package.json').packageManager.split('@')[1]")
case "$RUNNER_OS" in
macOS) OS=darwin ;;
Linux) OS=linux ;;
Windows) OS=windows ;;
*) exit 0 ;;
esac
case "$RUNNER_ARCH" in
X64) ARCH=x64-baseline ;;
ARM64) ARCH=aarch64 ;;
*) exit 0 ;;
esac
echo "url=https://github.com/oven-sh/bun/releases/download/bun-v${V}/bun-${OS}-${ARCH}.zip" >> "$GITHUB_OUTPUT"

- name: Setup Bun
uses: oven-sh/setup-bun@v2
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ jobs:
turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json') }}-
turbo-${{ runner.os }}-

- name: Cache npm registry packages
# Plugin integration tests install @opencode-ai/plugin into fresh temp dirs
# using @npmcli/arborist, which fetches from the npm registry and caches
# tarballs in ~/.npm. Without this cache, each test does a full network
# download, easily hitting the 30 s bun test timeout on Blacksmith ARM64.
uses: actions/cache@v4
with:
path: ~/.npm
key: npm-${{ runner.os }}-${{ runner.arch }}-opencode-ai-plugin-${{ hashFiles('**/package.json') }}
restore-keys: |
npm-${{ runner.os }}-${{ runner.arch }}-opencode-ai-plugin-

- name: Warm npm cache for @opencode-ai/plugin
# Pre-populate ~/.npm so arborist can satisfy @opencode-ai/plugin from
# cache during plugin integration tests instead of hitting the registry.
if: runner.os == 'Linux'
run: npm install --prefix /tmp/plugin-warmup @opencode-ai/plugin

- name: Run unit tests
run: bun turbo test:ci
env:
Expand Down
1 change: 0 additions & 1 deletion .opencode/agent/translator.md
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,6 @@ OPENCODE_DISABLE_CLAUDE_CODE
OPENCODE_DISABLE_CLAUDE_CODE_PROMPT
OPENCODE_DISABLE_CLAUDE_CODE_SKILLS
OPENCODE_DISABLE_DEFAULT_PLUGINS
OPENCODE_DISABLE_FILETIME_CHECK
OPENCODE_DISABLE_LSP_DOWNLOAD
OPENCODE_DISABLE_MODELS_FETCH
OPENCODE_DISABLE_PRUNE
Expand Down
6 changes: 1 addition & 5 deletions .opencode/opencode.jsonc
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"opencode": {
"options": {},
},
},
"provider": {},
"permission": {
"edit": {
"packages/opencode/migration/*": "deny",
Expand Down
80 changes: 80 additions & 0 deletions .opencode/sessions/chore-bolster-install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Session: Bolster Install — Blacksmith ARM64 CI Fixes

**Branch**: chore/bolster-install
**Issue**: N/A
**Created**: 2026-04-22
**Status**: complete — PR #11 open, awaiting merge

## Goal
Harden the `install-flex` automated installer and fix all Blacksmith ARM64 CI
failures that were blocking the unit and e2e test jobs on the Flexion fork.

## Approach
Fix issues in layers as they surfaced during CI runs:
1. Add `install-flex` installer script
2. Pin `OPENCODE_CHANNEL=flex` to prevent per-branch SQLite DB fragmentation
3. Fix missing build tools on Blacksmith ARM64 runners
4. Fix unit test timeouts caused by arborist npm installs during tests
5. Bump individual test timeouts that are tight on ARM64

## Session Log
- 2026-04-22: Session created
- 2026-04-22: Added `install-flex` script (already existed on branch), fixed DB fragmentation
- 2026-04-22: CI round 1 — fixed `unzip` missing (setup-bun)
- 2026-04-22: CI round 2 — fixed `make`/`g++` missing (build-essential for node-gyp)
- 2026-04-22: CI round 3 — 7 test timeouts; root-caused to `@npmcli/arborist.reify()` in tests
- 2026-04-22: CI round 4 — 1 remaining timeout; fixed shell-loop test 3s → 15s
- 2026-04-22: All CI jobs passing. PR updated.
- 2026-04-22: CI round 5 — 1 new timeout; "shell rejects with BusyError when loop running" 3s → 15s

## Key Decisions

### `OPENCODE_CHANNEL=flex` in `install-flex`
OpenCode bakes `InstallationChannel` from the git branch at build time and uses it
as the SQLite DB name suffix (`opencode-<channel>.db`). Without pinning, each
rebuild from a different branch creates a fresh empty database, losing all session
history. Pinning to `"flex"` ensures all Flexion builds share `opencode-flex.db`.
See: `packages/opencode/src/storage/db.ts:getChannelPath()`.

### `OPENCODE_DISABLE_PLUGIN_DEPS_INSTALL` flag
`config.ts` fires a background `@npmcli/arborist.reify()` for `@opencode-ai/plugin`
in every `.opencode/` directory it discovers. In tests, 7 tests were timing out
because: plugin/tool tests called `waitForDependencies()` which joined the arborist
fiber (10–30 s per test on ARM64), and the resulting CPU saturation starved
concurrent session/snapshot tests. The flag skips the install in tests; safe because
bun resolves `@opencode-ai/plugin` from the workspace `node_modules` directly.
Set unconditionally in `test/preload.ts`.

### Blacksmith ARM64 runner gaps
`blacksmith-4vcpu-ubuntu-2404` uses ARM64 and ships a minimal Ubuntu image missing:
- `unzip` — needed by `oven-sh/setup-bun@v2` to extract the downloaded bun zip
- `make`/`g++` (build-essential) — needed by `node-gyp` for `tree-sitter-powershell`
Both now installed in a single `Ensure build tools are available` step in
`.github/actions/setup-bun/action.yml` (Linux only, no-op if already present).

### Test timeout bumps
- `snapshot.test.ts` "revert handles large mixed batches": 30 s → 60 s
(280 files + multiple git commits/patches/reverts on ARM64)
- `prompt-effect.test.ts` "loop waits while shell runs": 3 s → 15 s
(spawns a real `sleep 0.2` subprocess; ARM64 fork/exec overhead exceeds 3 s)
- `prompt-effect.test.ts` "shell rejects with BusyError when loop running": 3 s → 15 s
(fiber fork + session init before `llm.wait(1)` exceeds 3 s on ARM64)

## Files Changed
- `install-flex` — `OPENCODE_CHANNEL=flex` added to build command
- `.github/actions/setup-bun/action.yml` — build tools prereq + ARM64/X64 URL construction
- `.github/workflows/test.yml` — npm cache + pre-warm step (unit job)
- `packages/opencode/src/flag/flag.ts` — `OPENCODE_DISABLE_PLUGIN_DEPS_INSTALL` flag
- `packages/opencode/src/config/config.ts` — guard arborist install with new flag
- `packages/opencode/test/preload.ts` — set `OPENCODE_DISABLE_PLUGIN_DEPS_INSTALL=true`
- `packages/opencode/test/snapshot/snapshot.test.ts` — 60 s timeout on 280-file test
- `packages/opencode/test/session/prompt-effect.test.ts` — 15 s timeout on shell-loop test

## Side Effects Applied Outside the Repo
- `~/.opencode/bin/opencode` — rebuilt from this branch with `OPENCODE_CHANNEL=flex`;
now reports `0.0.0-flex-<timestamp>` and uses `~/.local/share/opencode/opencode-flex.db`

## Next Steps
- [ ] Merge PR #11 into flex: https://github.com/flexion/opencode/pull/11
- [ ] After merge, other developers run `install-flex` to pick up all fixes
- [ ] Consider periodically running `install-flex` to stay current with `flex` branch
2 changes: 1 addition & 1 deletion .opencode/tool/github-pr-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ async function githubFetch(endpoint: string, options: RequestInit = {}) {
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
Accept: "application/vnd.github+json",
"Content-Type": "application/json",
...options.headers,
...(options.headers instanceof Headers ? Object.fromEntries(options.headers.entries()) : options.headers),
},
})
if (!response.ok) {
Expand Down
2 changes: 1 addition & 1 deletion .opencode/tool/github-triage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function githubFetch(endpoint: string, options: RequestInit = {}) {
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
Accept: "application/vnd.github+json",
"Content-Type": "application/json",
...options.headers,
...(options.headers instanceof Headers ? Object.fromEntries(options.headers.entries()) : options.headers),
},
})
if (!response.ok) {
Expand Down
51 changes: 51 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"$schema": "https://raw.githubusercontent.com/nicolo-ribaudo/oxc-project.github.io/refs/heads/json-schema/src/public/.oxlintrc.schema.json",
"options": {
"typeAware": true
},
"categories": {
"suspicious": "warn"
},
"rules": {
"typescript/no-base-to-string": "warn",
// Effect uses `function*` with Effect.gen/Effect.fnUntraced that don't always yield
"require-yield": "off",
// SolidJS uses `let ref: T | undefined` for JSX ref bindings assigned at runtime
"no-unassigned-vars": "off",
// SolidJS tracks reactive deps by reading properties inside createEffect
"no-unused-expressions": "off",
// Intentional control char matching (ANSI escapes, null byte sanitization)
"no-control-regex": "off",
// SST and plugin tools require triple-slash references
"triple-slash-reference": "off",

// Suspicious category: suppress noisy rules
// Effect's nested function* closures inherently shadow outer scope
"no-shadow": "off",
// Namespace-heavy codebase makes this too noisy
"unicorn/consistent-function-scoping": "off",
// Opinionated — .sort()/.reverse() mutation is fine in this codebase
"unicorn/no-array-sort": "off",
"unicorn/no-array-reverse": "off",
// Not relevant — this isn't a DOM event handler codebase
"unicorn/prefer-add-event-listener": "off",
// Bundler handles module resolution
"unicorn/require-module-specifiers": "off",
// postMessage target origin not relevant for this codebase
"unicorn/require-post-message-target-origin": "off",
// Side-effectful constructors are intentional in some places
"no-new": "off",

// Type-aware: catch unhandled promises
"typescript/no-floating-promises": "warn",
// Warn when spreading non-plain objects (Headers, class instances, etc.)
"typescript/no-misused-spread": "warn"
},
"options": {
"typeAware": true
},
"options": {
"typeAware": true
},
"ignorePatterns": ["**/node_modules", "**/dist", "**/.build", "**/.sst", "**/*.d.ts", "**/sdk.gen.ts"]
}
27 changes: 1 addition & 26 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,10 @@
- Keep things in one function unless composable or reusable
- Avoid `try`/`catch` where possible
- Avoid using the `any` type
- Prefer single word variable names where possible
- Use Bun APIs when possible, like `Bun.file()`
- Rely on type inference when possible; avoid explicit type annotations or interfaces unless necessary for exports or clarity
- Prefer functional array methods (flatMap, filter, map) over for loops; use type guards on filter to maintain type inference downstream

### Naming

Prefer single word names for variables and functions. Only use multiple words if necessary.

### Naming Enforcement (Read This)

THIS RULE IS MANDATORY FOR AGENT WRITTEN CODE.

- Use single word names by default for new locals, params, and helper functions.
- Multi-word names are allowed only when a single word would be unclear or ambiguous.
- Do not introduce new camelCase compounds when a short single-word alternative is clear.
- Before finishing edits, review touched lines and shorten newly introduced identifiers where possible.
- Good short names to prefer: `pid`, `cfg`, `err`, `opts`, `dir`, `root`, `child`, `state`, `timeout`.
- Examples to avoid unless truly required: `inputPID`, `existingClient`, `connectTimeout`, `workerPath`.

```ts
// Good
const foo = 1
function journal(dir: string) {}

// Bad
const fooBar = 1
function prepareJournal(dir: string) {}
```
- In `src/config`, follow the existing self-export pattern at the top of the file (for example `export * as ConfigAgent from "./agent"`) when adding a new config module.

Reduce total variable count by inlining when a value is only used once.

Expand Down
Loading
Loading