fix(types): resolve the automations export from source like every other subpath - #3558
Merged
Merged
Conversation
…er subpath Alpha Channel and Dev Daytona Snapshot have failed on every dev push since 4d50c7f with: error: Could not resolve: "@openwork/types/automations" apps/server bundles its OpenCode plugins with `bun build --target node`, which picks the `node` export condition. `./automations` was the only one of the package's seventeen subpaths pointing at `dist/`, so the bundle needed packages/types to have been built first — which neither the Docker nor the alpha pipeline guarantees. Point it at source like its sixteen neighbours, including den/inference, which carries runtime values and has resolved from source in production Den all along. Nothing caught this before merge: both workflows are push-only, and the PR lane's typechecks and bun tests never take the `--target node` route. Bundling the plugins from a tree with no packages/types/dist now runs in the PR lane, and a unit test fails if any subpath goes back to resolving through dist. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
benjaminshafii
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the two workflows that have failed on every
devpush since4d50c7f5: Alpha Channel (macOS arm64) and Dev Daytona Snapshot.Root cause
apps/server'sbuildscript bundles the OpenCode plugins with--target node:--target nodeselects thenodeexport condition, and./automationswas the only one of the package's seventeen subpaths that pointed at a build artifact:Neither the Daytona Dockerfile nor the alpha Electron build guarantees
packages/typesis built before the server bundle runs, sodist/automations.jswas missing and resolution failed.The trigger was #3552, which added the first runtime-value import from
@openwork/typesinto that bundle (automationProposalSchema). Every earlier import —openwork-affordance,openwork-context,openwork-provider— is type-only and maps to./src/*.tsin every condition, so nothing had ever exercised thenodecondition on a dist-backed subpath. #3554 and #3556 inherited the breakage; they did not cause it.The fix
Point
./automationsat source, matching its sixteen neighbours:Why this is safe for Den, which runs
node dist/main.jsonnode:22-bookworm-slimand resolves@openwork/typesat runtime rather than bundling it: five sibling subpaths already resolve from source in that exact path today — including@openwork/types/den/inference, which exports runtime values (INFERENCE_MODEL_ALIASES) and appears in Den's compileddist/. This change makesautomationsbehave like the imports Den already depends on in production, rather than introducing a new pattern. I also confirmed both subpaths import cleanly under default conditions (locally on Node 26; the production image is Node 22, where the same five siblings already prove it), and thatpnpm --filter @openwork-ee/den-api buildstill succeeds.Why CI missed it, and what now catches it
Two independent gaps:
push-only — they run on push todev, never onpull_request. feat(automations): propose an Automation from chat #3552 went green on all 23 PR checks without either one running.buncondition and read source. My own pre-merge verification hit the same blind spot — I built with--target bun-darwin-arm64, which resolves fine even withdistdeleted.So the fix ships with two guards:
packages/types/distand runspnpm --filter openwork-server build, exercising the exact--target noderesolution the packaged builds use.types-package-exports.test.tsfails if any subpath goes back to resolving throughdist/, so the next runtime module added to this package cannot reintroduce the trap.Verification
Reproduced the failure locally first (clean tree, no
packages/types/dist,--target node) — identical error. After the fix, from the same clean tree:pnpm --filter openwork-server build— passes with nopackages/types/distpresentpnpm --filter @openwork-ee/den-api build— passespnpm --dir apps/server typecheck,pnpm --filter @openwork/app typecheck,pnpm --filter @openwork-ee/den-api typecheck:automations— pass@openwork/types/automationsand@openwork/types/den/inferenceunder default conditions — both resolvenode:sqliteresolution error that reproduces identically on unmodifieddev. Not introduced here, not claimed as passing.No dependency changes, so
pnpm-lock.yamlis untouched.🤖 Generated with Claude Code