Skip to content

fix: Dockerfile.server COPYs package.json files that don't exist in this repo - #1005

Open
capt-marbles wants to merge 1 commit into
craft-ai-agents:mainfrom
capt-marbles:fix/dockerfile-server-missing-workspaces
Open

fix: Dockerfile.server COPYs package.json files that don't exist in this repo#1005
capt-marbles wants to merge 1 commit into
craft-ai-agents:mainfrom
capt-marbles:fix/dockerfile-server-missing-workspaces

Conversation

@capt-marbles

Copy link
Copy Markdown

Summary

Dockerfile.server and bun.lock reference three workspace packages — packages/craft-cli, packages/craft-agents-commands, and apps/marketing — that aren't present in this repository, so a clean checkout can't build the headless server image.

Problem

docker buildx build -f Dockerfile.server -t craft-agent-server --load .

fails with:

ERROR: failed to calculate checksum of ref ...: "/packages/craft-agents-commands/package.json": not found

ls packages/ apps/ on a fresh git clone confirms those three directories genuinely don't exist in the tree, while bun.lock still lists them as workspace members and Dockerfile.server still COPYs their package.json files. My guess is these are internal-only packages (an internal CLI tool and the marketing site) that get stripped when this repo is exported/synced from an internal monorepo, without the lockfile and Dockerfile being updated to match.

I checked: nothing the headless server actually needs — server, server-core, shared, core, session-tools-core, session-mcp-server, pi-agent-server, ui, messaging-gateway, messaging-whatsapp-worker — depends on any of the three missing packages. packages/craft-cli only depends on packages/craft-agents-commands (both missing, mutually isolated), and apps/marketing has no dependents at all. So excluding all three from the workspace is safe and self-contained.

Changes

  • package.json: exclude the three missing paths via workspaces negation globs (same pattern already used for !apps/online-docs)
  • Dockerfile.server: remove the now-stale COPY lines for their package.json files
  • bun.lock: regenerated via bun install to drop the three workspace entries (90 lines removed, nothing else changed)

Testing

  • docker buildx build -f Dockerfile.server -t craft-agent-server --load . succeeds on a clean --depth 1 clone (previously failed as above)
  • Ran the resulting image (docker run ...), confirmed Craft Agent server listening on ws://0.0.0.0:9100 and that it accepts a connection
  • bun install locally resolves cleanly with no other changes ("Removed: 3", no other package affected)

… repo

packages/craft-cli, packages/craft-agents-commands, and apps/marketing
are listed in bun.lock and copied by Dockerfile.server, but don't exist
in this repository (likely stripped from the internal monorepo before
export without updating the lockfile). This makes `docker buildx build
-f Dockerfile.server .` fail on a clean checkout:

  ERROR: failed to calculate checksum of ref ...:
  "/packages/craft-agents-commands/package.json": not found

None of the packages needed by the headless server (server, server-core,
shared, core, session-tools-core, session-mcp-server, pi-agent-server, ui,
messaging-gateway, messaging-whatsapp-worker) depend on any of the three
missing packages, so excluding them from the workspace list is a safe,
self-contained fix.

Changes:
- Exclude the three missing paths via workspaces negation globs in
  package.json (same pattern already used for !apps/online-docs)
- Remove the now-stale COPY lines for their package.json files from
  Dockerfile.server
- Regenerate bun.lock accordingly

Testing: docker buildx build -f Dockerfile.server -t craft-agent-server
--load . succeeds on a clean --depth 1 clone; ran the resulting image
and confirmed the server starts and accepts connections.
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