Skip to content

fix: recover remaining CI gaps - #1048

Open
code-yeongyu wants to merge 2 commits into
mainfrom
fix/ci-repair-senpi-v2
Open

fix: recover remaining CI gaps#1048
code-yeongyu wants to merge 2 commits into
mainfrom
fix/ci-repair-senpi-v2

Conversation

@code-yeongyu

@code-yeongyu code-yeongyu commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Rebased onto current main (20cd958c0) and reduced to the fixes main still lacks.

While this work was in flight, main landed an equivalent guard for the cursor-CLI shutdown pid-file race, so that commit is dropped here. Verified against main that neither fix below is present.

What this adds

ci(model-catalog) publish opt-in — the publish job inherits R2 credentials this repository does not define, so every scheduled run failed at the upload step while generation and checking were healthy. Requires vars.PI_MODEL_CATALOG_PUBLISH alongside the existing event conditions; generation and the catalog check stay unconditional.

fix(coding-agent) deleted-cwd guard — exports recoverValidCwd() while keeping the module-level invocation, so a caller can trigger recovery after the working directory is already gone. On macOS the ESM loader wedges when a dynamic import starts after the cwd is unlinked, which hung the child and blocked Vitest's own timeout through an unbounded spawnSync. The guard test now links both modules while the directory is still valid, invokes the preloaded functions afterwards, and carries a bounded deadlock backstop.

Verification

  • npx vitest --run test/valid-cwd-guard.test.ts test/cursor-cli-oauth/shutdown.test.ts — 11 passed / 0 failed.
  • actionlint — clean on the changed workflow.

Supersedes #1047.


Summary by cubic

Stops failing scheduled model-catalog publishes in forks and lets coding-agent recover after the working directory is deleted. Previously, publishing always ran and failed without R2 creds and the cwd guard only ran at module load; now publishing runs only when explicitly opted in and recoverValidCwd() can be called to restore a valid cwd.

  • CI: model-catalog publish opt-in

    • The publish job in .github/workflows/publish-model-catalog.yml now requires vars.PI_MODEL_CATALOG_PUBLISH == 'true'; generation and validation remain unconditional.
    • To re-enable publishing in a fork, set PI_MODEL_CATALOG_PUBLISH to true and provide PI_ARTIFACTS_R2_* secrets.
  • coding-agent: deleted-cwd guard

    • Exports recoverValidCwd() while retaining the module-level invocation; callers can restore a valid cwd after it was unlinked (falls back to homedir() and logs).
    • Test preloads modules to avoid macOS ESM loader wedges and adds a 30s child-process timeout as a backstop.

Written for commit dc2a4fa. Summary will update on new commits.

Review in cubic

The publish job inherits R2 credentials this repository does not define, so
every scheduled run failed at the upload step while generation and checking
were healthy. Require vars.PI_MODEL_CATALOG_PUBLISH alongside the existing
event conditions; generation and the catalog check stay unconditional.
Export recoverValidCwd() while keeping the module-level invocation, so a
caller can trigger recovery after the working directory is already gone.

On macOS the ESM loader wedges when a dynamic import starts after the cwd is
unlinked, so the guard test now links both modules while the directory is
still valid and invokes the preloaded functions afterwards. The child also
carries a bounded deadlock backstop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant