Commit Graph

152 Commits

Author SHA1 Message Date
YeonGyu-Kim 9a61c607ab fix(ci): treat npm OIDC exchange 201 as success in preflight
Empirically the npm registry returns HTTP 201 (Created) - not 200 -
when the OIDC token exchange succeeds and a fresh publish token is
issued. The preflight gate was only accepting 200 so every
correctly-configured package was flagged as missing. Accept any
2xx status; only treat 4xx/5xx as missing trust config.
2026-04-30 16:27:35 +09:00
YeonGyu-Kim ab5216f6c7 feat(ci): add preflight-trust gate before version bump
The publish workflow used to bump npm latest+1 *before* attempting
the platform publishes. When a platform package was missing its
trusted-publisher config the version was already incremented but
that platform never shipped, leaving partial-publish garbage
versions on npm (this happened with v3.17.7-v3.17.9 during the
OIDC migration).

Add a preflight-trust job that runs in parallel with test/typecheck
and verifies all 24 packages have a trusted publisher configured by
calling npm's own OIDC token exchange endpoint with the workflow's
GitHub OIDC token. publish-main now needs preflight-trust, so any
missing trust config fails the workflow before the version bump.

Failure output lists the exact npm.com URLs to configure each
missing package, plus the org/repo/workflow values to enter.
2026-04-30 16:22:26 +09:00
YeonGyu-Kim fd85dad984 fix(ci): strip _authToken from .npmrc so OIDC takes precedence
After switching to npm Trusted Publishing the publish step still
returned 'PUT 404' because actions/setup-node injects an
'//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}' line into
.npmrc. With NODE_AUTH_TOKEN unset that placeholder evaluates to
an empty string, so npm tries an empty token before reaching for
the OIDC ID token and the registry rejects it.

- Add a step that strips any _authToken line from both project-
  local and $HOME/.npmrc before publishing, so npm CLI proceeds
  to OIDC token exchange.
- Bump publish commands to --loglevel verbose so future failures
  expose the actual auth path (provenance attestation, OIDC
  exchange, etc.) in workflow logs.
2026-04-30 15:19:43 +09:00
YeonGyu-Kim 48fc7bd459 fix(ci): switch npm publish to OIDC trusted publishing
NODE_AUTH_TOKEN expired (set 90 days ago, the npm token default
expiry) causing all publish runs to fail with 'PUT 404 Not Found'
since 2026-04-30.

Migrate publish.yml and publish-platform.yml to npm Trusted
Publishing (OIDC) so we no longer depend on long-lived secrets:

- Bump actions/setup-node v4 -> v6 (improves OIDC compatibility)
- Add 'npm install -g npm@latest' to guarantee npm CLI >= 11.5.1
  (the minimum required for trusted publishing).
- Drop NODE_AUTH_TOKEN env from every publish step. The npm CLI
  picks up the GitHub Actions OIDC token automatically.
- Keep --provenance / NPM_CONFIG_PROVENANCE=true (real-world
  reports indicate provenance is not auto-emitted yet).

Per-package trusted publisher must still be configured on
npmjs.com (Settings -> Trusted Publisher) for all 24 packages
(oh-my-opencode + oh-my-openagent main + 11 platform packages
each, dual-published) before the next publish run.
2026-04-30 14:48:36 +09:00
YeonGyu-Kim 470ed8b13a fix(ci): remove existing signature before ad-hoc signing darwin binary
Bun-compiled binaries contain a malformed LC_CODE_SIGNATURE load
command that prevents codesign from directly replacing it. Remove
the existing signature first, then apply a fresh ad-hoc signature.
2026-04-11 23:55:02 +09:00
YeonGyu-Kim 16e7fa5b1a fix(ci): ad-hoc sign darwin binaries with plain codesign
Bun on github macos-latest runners does not emit linker-signed
signatures by default. Sign explicitly with 'codesign --sign -'
without preserve-metadata since the binary has no prior signature.
2026-04-11 23:51:50 +09:00
YeonGyu-Kim 71b5ab67f6 fix(ci): replace breaking codesign step with signature verification
The previous ad-hoc codesign step failed with 'invalid or unsupported
format for signature' because it tried to preserve the 'linker-signed'
flag which cannot be re-signed. The native macOS build already produces
a valid ad-hoc signature via Bun's linker, so we only need to verify
the signature exists rather than re-sign it.
2026-04-11 23:47:54 +09:00
YeonGyu-Kim 565d3ffa91 fix(ci): build darwin binaries on macOS runners to restore code signing
v3.16.0 binaries had 'adhoc,linker-signed' signatures because newer
Bun versions no longer emit linker-signed signatures when cross-compiling
darwin targets from Linux. Current releases have 'code object is not
signed at all', causing macOS Gatekeeper to reject them immediately.

Verified empirically:
- v3.16.0 darwin-arm64: Signature=adhoc, flags=0x20002(adhoc,linker-signed)
- v3.17.0 darwin-arm64: 'code object is not signed at all'
- Local bun build on macos: produces linker-signed signature (matches v3.16.0)

Changes:
- Route darwin-* platforms to macos-latest runner (native compile)
- Add explicit ad-hoc codesign step as belt-and-suspenders safety net
2026-04-11 23:34:10 +09:00
YeonGyu-Kim 4f196f4917 ci: restore mock-isolated test runner
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 13:12:34 +09:00
YeonGyu-Kim e2d73f482a ci: run pure bun test in workflows
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-06 18:45:33 +09:00
YeonGyu-Kim 63aa1c3e1d ci: use run-ci-tests.ts for mock isolation in CI workflow 2026-04-05 01:16:16 +09:00
YeonGyu-Kim 01994e3f65 ci: sync publish.yml test job with CI.yml isolation pattern 2026-04-05 01:12:54 +09:00
YeonGyu-Kim da86b57f23 test: fix CI test isolation - upgrade Bun, fix mock contamination and fresh-import patterns 2026-04-05 01:01:19 +09:00
YeonGyu-Kim 1071d4defb Pin Bun to 1.3.10 in CI and remove test:ci script
- Pin bun-version to 1.3.10 across all CI workflows to avoid
  mock.module() barrel export regression introduced in 1.3.11
- Remove test:ci script from package.json (use bun test directly)
- Update publish-workflow.test.ts to expect "bun test" instead

🤖 GENERATED WITH ASSISTANCE OF OhMyOpenCode
2026-04-04 18:56:25 +09:00
YeonGyu-Kim eb4060d739 fix(test): narrow mock.module() targets in background-agent tests to prevent barrel corruption
Three test files were mocking the entire '../../shared' barrel, which
corrupted exports for subsequent test files in the same batch run.
Narrow mocks to specific submodules (logger, connected-providers-cache).

Also reverts Bun version pin since the root cause was mock scope, not Bun.
2026-04-04 16:56:39 +09:00
YeonGyu-Kim 99ae6d91d0 fix(ci): pin Bun to 1.3.10 to avoid mock.module() barrel export regression in 1.3.11
Bun 1.3.11 has a regression where mock.module() leaks across test files
in isolated batch execution, causing barrel re-exports to fail with
'Export named X not found' errors. Pin to 1.3.10 until upstream fix.
2026-04-04 16:51:23 +09:00
YeonGyu-Kim 72c8cb8d92 fix(ci): typecheck script tooling in CI workflow
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-04 16:12:30 +09:00
YeonGyu-Kim 2c081e1999 fix(ci): restore isolated Bun test execution for mock.module suites
Running Linux CI in one Bun process still leaks mock.module registrations across files, so the workflows now use a CI-specific test runner that isolates mock-heavy targets before executing the remaining suite together.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-04 15:51:54 +09:00
YeonGyu-Kim 57ec3a46ac fix(ci): use unquoted heredoc to allow env var expansion 2026-04-04 14:47:15 +09:00
YeonGyu-Kim 9b30817021 fix(ci): prevent shell injection in workflow expressions 2026-04-04 14:18:25 +09:00
YeonGyu-Kim 5946dba47d ci: run publish workflow tests via bun test 2026-04-04 01:51:48 +09:00
YeonGyu-Kim 53eeac3f31 fix(ci): simplify test runner to plain bun test by fixing mock.module() leakage
- Add afterAll(() => { mock.restore() }) to 52 test files missing cleanup
- Rewrite create-tool-guard-hooks.test.ts to use spyOn instead of barrel mock
- Fix skill-mcp-manager OAuth tests with missing mockTokens/mockLogin definitions
- Fix start-work hook: show worktree active block on resume with existing worktree_path
- Extract createWorktreeActiveBlock to worktree-block.ts to avoid circular import
- Replace 80-line isolated test runner CI config with single `bun test` command
2026-04-04 00:34:03 +09:00
YeonGyu-Kim 951bca5399 fix(ci): include nested test files in isolated test execution
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-01 18:19:48 -07:00
YeonGyu-Kim fd281deba7 fix(tests): resolve 25 pre-publish test failures
- Add providerModelsCache/fetchAvailableModels mocks to 20 utils.test.ts
  tests that broke when createBuiltinAgents started reading the cache
- Isolate ALL src/plugin and src/features/background-agent test files in CI
  (mock.module pollution crosses between files in the same bun process)
- Mirror CI isolation changes in publish.yml

25 failures → 0 in CI (all mock-pollution tests run individually)
2026-03-31 18:12:57 +09:00
YeonGyu-Kim d2c576c510 fix: resolve 25 pre-publish blockers
- postinstall.mjs: fix alias package detection
- migrate-legacy-plugin-entry: dedupe + regression tests
- task_system: default consistency across runtime paths
- task() contract: consistent tool behavior
- runtime model selection, tool cap, stale-task cancellation
- recovery sanitization, context-limit gating
- Ralph semantic DONE hardening, Atlas fallback persistence
- native-skill description/content, skill path traversal guard
- publish workflow: platform awaited via reusable workflow job
- release: version edits reapplied before commit/tag
- JSONC plugin migration: top-level plugin key safety
- cold-cache: user fallback models skip disconnected providers
- docs/version/release framing updates

Verified: bun test (4599 pass), tsc --noEmit clean, bun run build clean
2026-03-28 15:24:18 +09:00
YeonGyu-Kim 3be26cb97f fix(#2732): enhance notification for failed/crashed subagent tasks
- completedTaskSummaries now includes status and error info
- notifyParentSession: noReply=false for failed tasks so parent reacts
- Batch notification distinguishes successful vs failed/cancelled tasks
- notification-template updated to show task errors
- task-poller: session-gone tests (85 new lines)
- CI: add Bun shim to PATH for legacy plugin migration tests
2026-03-27 15:48:07 +09:00
YeonGyu-Kim a1b4e97e74 Merge pull request #2856 from potb/fix/publish-version-commitback
fix(publish): restore version commit-back to dev after npm release
2026-03-27 12:30:34 +09:00
YeonGyu-Kim 1c9f4148d0 fix(publish-ci): sync mock-heavy test isolation with ci.yml
Apply the same mock.module() isolation fixes to publish.yml:
- Move shared and session-recovery mock-heavy tests to isolated section
- Use dynamic find + exclusion for remaining src/shared tests
- Include session-recovery tests in remaining batch

Ensures publish workflow has the same test config as main CI run.
2026-03-27 00:56:55 +09:00
YeonGyu-Kim 8dd0191ea5 fix(ci): isolate mock-heavy shared tests to prevent cross-file contamination
Move 4 src/shared tests that use mock.module() to the isolated test section:
- model-capabilities.test.ts (mocks ./connected-providers-cache)
- log-legacy-plugin-startup-warning.test.ts (mocks ./legacy-plugin-warning)
- model-error-classifier.test.ts
- opencode-message-dir.test.ts

Also isolate recover-tool-result-missing.test.ts (mocks ./storage).

Use find + exclusion pattern in remaining tests to dynamically build the
src/shared file list without the isolated mock-heavy files.

Fixes 6 Linux CI failures caused by bun's mock.module() cache pollution
when running in parallel.
2026-03-27 00:08:27 +09:00
Peïo Thibault fb837db90d fix(publish): restore version commit-back to dev after npm release 2026-03-26 12:44:27 +01:00
Ravi Tharuma 5043cc21ac fix(model-capabilities): harden canonical alias guardrails 2026-03-25 22:11:45 +01:00
Ravi Tharuma a15f6076bc feat(model-capabilities): add maintenance guardrails 2026-03-25 16:14:19 +01:00
YeonGyu-Kim f0b5835459 fix(publish): correct repo guard to oh-my-openagent (GitHub renamed repo) 2026-03-25 09:21:38 +09:00
YeonGyu-Kim e0de06851d fix(publish): align repo guard and test topology
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-25 01:17:42 +09:00
YeonGyu-Kim 9b8aca45f9 fix(release): set version when publishing oh-my-openagent
The publish step was updating name and optionalDependencies but not
version, causing npm to try publishing the base package.json version
(3.11.0) instead of the release version (3.12.0).

Error was: 'You cannot publish over the previously published versions: 3.11.0'
2026-03-18 02:15:15 +09:00
YeonGyu-Kim de40caf76d fix(release): add oh-my-openagent dual-publish to platform and main workflows
- publish-platform.yml: Build job now checks BOTH oh-my-opencode and
  oh-my-openagent before skipping. Build only skips when both are published.
  Added 'Publish oh-my-openagent-{platform}' step that renames package.json
  and publishes under the openagent name.

- publish.yml: Added 'Publish oh-my-openagent' step after opencode publish.
  Rewrites package name and optionalDependencies to oh-my-openagent variants,
  then publishes. Restores package.json after.

Previously, oh-my-openagent platform packages were never published because
the build skip check only looked at oh-my-opencode (which was already published),
causing the entire build to be skipped.
2026-03-18 01:45:02 +09:00
YeonGyu-Kim f31f50abec fix(release): revert package identity to oh-my-opencode
Keep installer, config detection, schema generation, and publish workflows aligned with the long-lived oh-my-opencode package so this release does not split across two npm names.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 10:38:55 +09:00
YeonGyu-Kim 88568398ac fix: sync root package.json version before binary compile (#2407) 2026-03-12 01:06:30 +09:00
YeonGyu-Kim a7d8c1cdf4 feat: dual-publish platform binaries for oh-my-openagent
After publishing oh-my-opencode-{platform}, rename package.json and
publish oh-my-openagent-{platform} from the same build artifact.
Download/extract steps now run if either package needs publishing.
2026-03-09 02:56:01 +09:00
YeonGyu-Kim adaeaca8e9 fix: add NODE_AUTH_TOKEN to publish-main job for npm auth
The publish-main job relied on npm trusted publishing (OIDC) which
broke after the repo rename from oh-my-opencode to oh-my-openagent.
Adding explicit NODE_AUTH_TOKEN restores auth while --provenance
still uses OIDC for Sigstore attestation.

Fixes #2373
2026-03-08 03:36:52 +09:00
YeonGyu-Kim e2444031ff ci(publish): deploy both oh-my-opencode and oh-my-openagent simultaneously 2026-03-08 02:31:26 +09:00
YeonGyu-Kim 21c249e8c8 fix(ci): pre-download baseline compile targets to avoid Bun extraction failures
Bun's internal download of baseline compile targets from npm registry
consistently fails on Windows CI runners (ExtractionFailed error).
Pre-download the baseline binary via curl into Bun's cache directory
so the compile step finds it already cached and skips the download.

Also makes publish job resilient with if: always() so one failed
platform doesn't block publishing all other successful platforms.
2026-02-27 04:43:29 +09:00
YeonGyu-Kim 0749a8f138 fix(ci): make platform publish resilient to individual build failures
publish job now runs with if: always() && !cancelled(), and gates
each publish step on download.outcome == 'success'. One flaky target
(e.g. windows-x64-baseline) no longer blocks all other platforms.
2026-02-27 04:39:05 +09:00
YeonGyu-Kim cc5e9d1e9b fix(ci): add baseline CPU variant binaries for legacy hardware support
Closes #2121
2026-02-26 21:00:45 +09:00
YeonGyu-Kim 0d76874632 ci(publish): isolate executor.test.ts to prevent mock contamination 2026-02-22 02:53:38 +09:00
YeonGyu-Kim 30491d769b ci: isolate executor.test.ts to prevent mock contamination in batch runs 2026-02-22 02:46:54 +09:00
YeonGyu-Kim 58b924aabe ci: isolate recovery-hook.test.ts to prevent mock.module leakage
recovery-hook.test.ts uses mock.module() at top level which patches the
executor module in the shared bun module cache. When run in the same
batch as executor.test.ts, executeCompact becomes the mocked no-op version,
causing all lock management tests to fail.

Move it to the isolated step (each file gets its own bun process) and
enumerate the remaining anthropic-context-window-limit-recovery test files
explicitly to avoid including recovery-hook.test.ts in the batch.
2026-02-21 05:11:40 +09:00
YeonGyu-Kim 96ff1e00cc chore: upgrade claude-sonnet-4-5 to claude-sonnet-4-6 across codebase 2026-02-18 15:51:24 +09:00
YeonGyu-Kim 25f2003962 fix(ci): isolate session-manager tests to prevent flakiness
- Move src/tools/session-manager to isolated test section
- Prevents mock.module() pollution across parallel test runs
- Fixes 4 flaky storage tests that failed in CI
2026-02-17 00:03:10 +09:00
YeonGyu-Kim 6dc8b7b875 fix(ci): sync publish.yml test steps with ci.yml to prevent mock pollution 2026-02-15 13:37:25 +09:00