mirror of
https://github.com/Gitlawb/openclaude.git
synced 2026-06-01 15:27:41 +00:00
* chore: centralize Bun version and refresh CI tool pins - add .bun-version as the shared Bun source of truth for workflows and Docker builds - update PR and release workflows to read Bun from bun-version-file - refresh pinned GitHub Actions and Docker action SHAs to newer low-risk releases - align contributor docs with Bun 1.3.13 guidance * test: stabilize reset and provider profile persistence Harden knowledge graph reset behavior across Windows file-lock scenarios by improving SQLite and JSON reset signaling, preserving a safe JSON source of truth when SQLite cannot be cleared, and adding direct storage regression coverage. Also centralize deterministic config-home handling for tests, tighten provider profile persistence path resolution and cleanup semantics, isolate environment-sensitive suites with the env mutex, and remove flaky external npx dependency from the SDK consumer type test. * test: fix Codex OAuth callback flake Investigate the real provider smoke failure from GitHub Actions and fix the root cause instead of patching the symptom. - make Codex OAuth callback host explicit and consistent across redirect URI generation and listener binding - allow safe loopback host overrides for localhost, 127.0.0.1, and ::1 - harden Codex OAuth tests with env/fetch isolation so they do not poison neighboring provider suites - pin the OAuth callback tests to 127.0.0.1 to avoid localhost IPv4/IPv6 family mismatch flakes in CI Validated with bun test src/services/api/codexOAuth.test.ts, bun test src/services/api/providerConfig.codexSecureStorage.test.ts, and bun run test:provider. * test: harden Codex OAuth callback tests Investigate the recurring provider-smoke OAuth failures across multiple PR runs and fix the flaky callback test design at the root. - remove the free-port reservation race from Codex OAuth tests - add bounded callback retry only for loopback listener warm-up during the in-process OAuth test flow - move ephemeral callback port support into an explicit CodexOAuthService test seam instead of widening production env parsing - keep runtime callback-port semantics unchanged while adding regression coverage for callback host and port parsing Validated with targeted Codex OAuth tests and repeated provider-bucket reruns to check for recurring flake. * test: serialize provider shared-state suites Fix the recurring provider smoke flake at the root cause by serializing test suites that mutate process.env or globalThis.fetch. Add a shared test mutation lock and wire it into the provider bucket so Codex OAuth no longer races with unrelated provider/config/openai shim tests under Bun's parallel test execution. Cleanup now releases the lock in finally blocks, and the shared lock waits indefinitely by default to avoid timeout-based CI flakes. * test: fix smoke root causes and noisy suites Replace the Codex OAuth test's live loopback listener dependency with an injected listener seam, avoid module-mock leakage across provider suites, and clean up the auth-code listener test setup. Also harden noisy storage and search tests by asserting expected log output, isolating SQLite masterpiece persistence per test cwd, and removing routine benchmark/stress logging from passing runs. * build: harden Bun version install in Docker Validate the repo-tracked .bun-version value before using it in the Docker build stage, strip line endings, and install Bun through a quoted semver-only variable instead of raw shell expansion. * test: replace flaky conversation arc benchmark Fix the recurring smoke failure caused by an absolute wall-clock assertion in the normal unit suite. Replace the CI-speed-sensitive conversation arc benchmark with deterministic regression coverage that verifies repeated fact extraction, expected entity shapes, bounded graph growth, and populated-summary behavior. * test: isolate shared-state smoke suites * test: restore codex credential mocks between suites * test: fix shared-state and provider init-order flakes * test: isolate remaining shared-state smoke suites Serialize the remaining smoke-sensitive suites that mutate process env, CLAUDE_CONFIG_DIR, fetch, or SDK session globals. Add shared lock coverage to discovery, agent/skills loading, platform storage, and SDK lifecycle/preserved-segment tests. Restore session and cwd state inside the lock boundary so parallel files cannot leak bootstrap state into knowledge graph and SDK isolation tests. Validated with repeated smoke and full-suite passes: - bun run smoke (2x) - bun test - bun test --max-concurrency=1 - bun run test:provider - python -m pytest -q python/tests - npm run test:provider-recommendation
50 lines
1.2 KiB
Docker
50 lines
1.2 KiB
Docker
# ---- build stage ----
|
|
FROM node:22-slim AS build
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy dependency manifests first for better layer caching
|
|
COPY package.json bun.lock .bun-version ./
|
|
|
|
# Install the Bun version tracked by the repo
|
|
RUN set -eu; \
|
|
BUN_VERSION="$(tr -d '\r\n' < .bun-version)"; \
|
|
printf '%s' "$BUN_VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; \
|
|
npm install -g "bun@$BUN_VERSION"
|
|
|
|
# Install all dependencies (including devDependencies for build)
|
|
RUN bun install --frozen-lockfile
|
|
|
|
# Copy source code
|
|
COPY src/ src/
|
|
COPY scripts/ scripts/
|
|
COPY bin/ bin/
|
|
COPY tsconfig.json ./
|
|
|
|
# Build the CLI bundle
|
|
RUN bun run build
|
|
|
|
# Prune devDependencies
|
|
RUN rm -rf node_modules && bun install --frozen-lockfile --production
|
|
|
|
# ---- runtime stage ----
|
|
FROM node:22-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy only what's needed to run
|
|
COPY --from=build /app/dist/cli.mjs dist/cli.mjs
|
|
COPY --from=build /app/bin/ bin/
|
|
COPY --from=build /app/node_modules/ node_modules/
|
|
COPY --from=build /app/package.json package.json
|
|
COPY README.md ./
|
|
|
|
# Install git and ripgrep — many CLI tool operations depend on them
|
|
RUN apt-get update && apt-get install -y --no-install-recommends git ripgrep \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Run as non-root user
|
|
USER node
|
|
|
|
ENTRYPOINT ["node", "/app/dist/cli.mjs"]
|