Skip to content

fix(host): resolve pinned pnpm launcher and preflight create/resume - #47

Merged
pmateusz merged 4 commits into
masterfrom
fix/workflow-package-manager-preflight
Sep 7, 2026
Merged

pmateusz merged 4 commits into
masterfrom
fix/workflow-package-manager-preflight

Conversation

@pmateusz

@pmateusz pmateusz commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Creating or testing a workflow requires Node.js and a specific pinned
version of pnpm on the user's machine. Until now we invoked pnpm
blindly, so when the toolchain was missing or misconfigured, the
failure surfaced deep inside a run — after the agent had already
started spending model tokens.

What changed

  • Fail fast on the toolchain. Starting a new workflow, or resuming
    an unfinished one, now checks upfront that Node.js and the pinned
    pnpm are available. If they aren't, the user gets a clear,
    actionable error immediately — no wasted tokens.
  • Smarter pnpm discovery. Instead of assuming pnpm is installed,
    we now try several ways of launching the exact pinned version —
    via Corepack, a direct pnpm install, or an npm download — whichever
    works on the user's machine. Messages guiding users to retry a
    failed step show the exact command that was used.
  • Works on Windows. Package-manager commands are launched in a way
    that works on Windows, not just macOS/Linux.
  • Cleaner failure and cancellation messages. Diagnostic output
    from failed checks is condensed to a readable one-liner instead of
    dumping raw logs into the UI, and cancelling an install or test run
    reports what was actually cancelled.

pmateusz and others added 2 commits September 4, 2026 16:43
Replace the bare pnpm prerequisite probe with a pinned package-manager
resolution chain (corepack → pnpm → npm exec) and centralize spawn
handling (timeout, abort, bounded output, process-group cleanup) in
workflow-package-manager.ts, removing duplicated runners from
workflow-package.ts and workflow-test-verifier.ts.

Preflight package-manager resolution before create and resume of the
built-in create workflow so toolchain failures surface before model
tokens are spent.

Co-Authored-By: Kimchi <noreply@kimchi.dev>
- resolve corepack/pnpm/npm through their .cmd shims on Windows so
  spawn(shell: false) can start them
- add an abortError option so install and verification aborts keep
  their own messages instead of the generic probe wording
- truncate per-candidate probe diagnostics to a single 512-character
  line before aggregating them into the resolution error
- resolve the package manager only when installation is required, and
  render fallback retry commands through the shared formatter

Co-Authored-By: Kimchi <noreply@kimchi.dev>
@kimchi-review

kimchi-review Bot commented Sep 4, 2026

Copy link
Copy Markdown

Kimchi Code Review

A review is being prepared and will be posted shortly.

Property Value
Commit 83b1188
Author @pmateusz
Files changed 15
Review status Pending
What to expect

Kimchi will analyze the changes in this pull request and post:

  • A summary of the overall changes
  • Inline comments on specific lines with findings categorized by issue type

The review typically completes within a few minutes. This comment will be updated once the review is ready.

Interact with Kimchi
  • @getkimchi review — re-trigger a full review on the latest commit
  • @getkimchi summary — regenerate the PR summary
  • @getkimchi ignore — skip this PR (no review will be posted)
  • Reply to any inline comment to ask follow-up questions or request clarification
Configuration

Reviews are configured by your organization admin.
Review instructions, excluded directories, and severity thresholds can be adjusted per repository in the Kimchi dashboard.


Powered by Kimchi — AI-powered code review by CAST AI

pmateusz and others added 2 commits September 6, 2026 11:22
…ree termination

Replace manual .cmd suffixing with cross-spawn for reliable cross-platform
process spawning. Isolate the pnpm --version probe in a temporary neutral
directory so project workspace config and corepack auto-pin cannot
interfere with version detection.

Terminate the entire process tree via taskkill /T /F on Windows when
aborting or timing out — killing cmd.exe alone strands descendants and
keeps inherited output pipes open, preventing settlement.

Always resolve the package manager when installation is skipped so the
verify command reflects the actual launcher.

Co-Authored-By: Kimchi <noreply@kimchi.dev>
- pass NODE_PATH pointing at repo node_modules to bun build --compile so
  the distribution-metadata test resolves dependencies on CI
- raise the run-identity suite timeout to 20s for slower CI runners
- compare the package-manager probe cwd against the realpath of the temp
  application dir to tolerate symlinked tmpdirs (e.g. macOS /var)

Co-Authored-By: Kimchi <noreply@kimchi.dev>
@pmateusz
pmateusz merged commit 8911840 into master Sep 7, 2026
2 checks passed
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