Skip to content

fix(dev): prepare missing Harness runtime before startup - #288

Merged
hm1229 merged 2 commits into
mainfrom
codex/fix-oss-runtime-preparation
Oct 22, 2026
Merged

hm1229 merged 2 commits into
mainfrom
codex/fix-oss-runtime-preparation

Conversation

@hm1229

@hm1229 hm1229 commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

After a source upgrade, scripts/dev_up.sh --detach could restart the application without building the newly required Harness v3 engine, resulting in apps/cli/lib/bin.js missing. The shared development CLI now checks the bundled engine entry point, dependencies and Python SDK, then runs OSS preparation and installs the local SDK into the active environment when needed. Once prepared, later starts skip rebuilding the engine.

Preparation uses the reviewed bundled Node and the project's pinned pnpm through npm's cache, so users do not need to globally install pnpm or enable Corepack. Both preparation entrypoints stay identical. The PowerShell wrapper prefers the existing backend virtualenv so SDK installation and the supervised backend use the same environment.

Runtime preparation and normal frontend builds complete before existing services are stopped. A preparation error exits with the original supervisor and service still running. The existing external engine override is preserved. Startup errors and installation/upgrade docs also explain recovery for directly managed launch.py/uvicorn services.

Validation:

  • 42 focused lifecycle, preparation, worker-configuration and public-boundary tests passed. They cover missing entry/dependencies/SDK, the ready fast path, unsuccessful preparation, false-success output, frontend build failure, service stop ordering, pinned pnpm and the matching exported preparation template.
  • Real macOS POSIX-wrapper acceptance in an owned source tree and isolated backend environment/data: started a baseline service, logged in, and created an employee. After deleting the real engine entry point, an injected preparation failure left the original supervisor PID, health endpoint and employee available.
  • Restored the real preparation script and ran the same dev_up.sh --detach: host/client builds and local SDK installation completed automatically, service startup/route readiness passed, and the saved credential and employee survived the restart.
  • Ran dev_up.sh --detach again: engine entry timestamp was unchanged, no runtime preparation was triggered, and the credential/employee remained valid. The owned supervisor was then stopped; the user's separate local instance remained healthy.
  • New/changed test files pass Ruff; lifecycle/preparation scripts introduce no findings beyond their existing lint baseline. Whitespace and public product-boundary checks passed.
  • Real lifecycle acceptance ran on macOS; PowerShell environment preference is covered by source tests. CI rebuilds the supported native platforms.

The first missing-runtime repair downloads dependencies and builds in the source tree; subsequent complete-runtime starts reuse those outputs. This change does not publish a new release tag.

@hm1229 hm1229 changed the title fix(oss): guide source upgrades through runtime preparation fix(dev): prepare missing Harness runtime before startup Oct 22, 2026
@hm1229
hm1229 marked this pull request as ready for review October 22, 2026 03:51
@hm1229
hm1229 merged commit ccf25ab into main Oct 22, 2026
12 of 15 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