Skip to content

Commit 2472046

Browse files
committed
chore: enforce opencode generation in pre-commit
1 parent 1afe030 commit 2472046

5 files changed

Lines changed: 17 additions & 4 deletions

File tree

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Only proceed with the commit if it passes. If it fails, fix the issues first.
88

99
**Exception:** If the commit contains only documentation and markdown changes (`.md` files), you may skip `just pre-commit`.
1010

11+
`just pre-commit` now runs the opencode generation flow (`packages/opencode/script/generate.ts`), which also runs formatting/linting steps in the submodule. It is expected that this can modify files you did not directly edit.
12+
13+
When this happens, review those extra diffs before committing and confirm they are mechanical generation/format/lint changes (no unintended behavior changes).
14+
1115
## Bun Lockfile Updates
1216

1317
`bun.lock` file updates are expected in this repository across all `bun.lock` files when changing versions of our own packages (for example `packages/cli-node`, `packages/core`, and related workspace packages). They can also be produced by normal `just pre-commit`/build flows.

CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Only proceed with the commit if it passes. If it fails, fix the issues first.
88

99
**Exception:** If the commit contains only documentation and markdown changes (`.md` files), you may skip `just pre-commit`.
1010

11+
`just pre-commit` now runs the opencode generation flow (`packages/opencode/script/generate.ts`), which also runs formatting/linting steps in the submodule. It is expected that this can modify files you did not directly edit.
12+
13+
When this happens, review those extra diffs before committing and confirm they are mechanical generation/format/lint changes (no unintended behavior changes).
14+
1115
## Bun Lockfile Updates
1216

1317
`bun.lock` file updates are expected in this repository across all `bun.lock` files when changing versions of our own packages (for example `packages/cli-node`, `packages/core`, and related workspace packages). They can also be produced by normal `just pre-commit`/build flows.

justfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ opencode-submodule-check:
104104
opencode-install-if-needed: opencode-submodule-check
105105
bun install --cwd packages/opencode --frozen-lockfile
106106

107+
# Regenerate opencode OpenAPI + SDK artifacts.
108+
# Run this whenever fork-auth/opencode routes or schemas change so generated clients stay in sync.
109+
sync-opencode-sdk: opencode-install-if-needed
110+
bun run --cwd packages/opencode script/generate.ts
111+
107112
# Typecheck opencode workspace
108113
# Keep scripts.typecheck defined in each fork-* package so Turbo executes its task.
109114
lint-opencode: opencode-install-if-needed check-fork-typecheck-wiring
@@ -347,7 +352,7 @@ do-marketplace-build:
347352

348353
# Pre-commit checks with conditional Docker stage build for Docker-risk changes.
349354
# This keeps routine commits fast while still catching Docker context regressions.
350-
pre-commit: check-opencode-submodule-published fmt lint build test-all-fast e2e
355+
pre-commit: check-opencode-submodule-published sync-opencode-sdk fmt lint build test-all-fast e2e
351356
@if ./scripts/should-run-docker-check.sh; then \
352357
echo "Running Docker stage check because Docker-risk files changed..."; \
353358
just check-docker; \
@@ -356,7 +361,7 @@ pre-commit: check-opencode-submodule-published fmt lint build test-all-fast e2e
356361
fi
357362

358363
# Pre-commit checks including Docker build (requires Docker)
359-
pre-commit-full: check-opencode-submodule-published fmt lint build test-all-fast e2e build-docker
364+
pre-commit-full: check-opencode-submodule-published sync-opencode-sdk fmt lint build test-all-fast e2e build-docker
360365
@echo "✓ Full pre-commit checks passed (including Docker build)"
361366

362367
# Format everything

packages/core/src/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ COPY --chown=opencoder:opencoder packages/opencode /tmp/opencode-local
556556
# Update it by running: ./scripts/update-opencode-commit.sh
557557
RUN set -eux; \
558558
OPENCODE_COMMIT_OVERRIDE="${OPENCODE_COMMIT:-}"; \
559-
OPENCODE_COMMIT="6c2659009cc95524720cb312d696879ced23d948"; \
559+
OPENCODE_COMMIT="23b2b908346332e1277a1c624acac92a80c174d9"; \
560560
if [ -n "${OPENCODE_COMMIT_OVERRIDE}" ]; then OPENCODE_COMMIT="${OPENCODE_COMMIT_OVERRIDE}"; fi; \
561561
rm -rf /tmp/opencode-repo; \
562562
if [ "${OPENCODE_SOURCE}" = "local" ]; then \

0 commit comments

Comments
 (0)