Skip to content

fix(railway): remove dead root railway.json hijacking template builds#523

Merged
AbirAbbas merged 2 commits intomainfrom
fix/remove-dead-root-railway-config
May 3, 2026
Merged

fix(railway): remove dead root railway.json hijacking template builds#523
AbirAbbas merged 2 commits intomainfrom
fix/remove-dead-root-railway-config

Conversation

@AbirAbbas
Copy link
Copy Markdown
Contributor

Summary

Follow-up to #522. Verified that the repo-root railway.json is dead weight and the actual cause of the Railway template regression — removing it (and the now-redundant per-example file added in #522).

What's actually broken

Every fresh deploy of the controlplane-template Railway template (e.g. the github-buddy project created today) fails on the example node service with:

failed to compute cache key: "/control-plane/web/client": not found

Root cause

Verified across the published Railway templates:

Template control-plane source
controlplane-template image agentfield/control-plane:latest
sec-af image agentfield/control-plane:latest
swe-af image agentfield/control-plane:latest
contract-af image agentfield/control-plane:latest
cloudsecurity-af image agentfield/control-plane:latest
agentfield-deep-research image agentfield/control-plane:latest

Every control-plane service uses a prebuilt image. Verified the same across every live control-plane deployment in the workspace (9 projects). Other agent services in those templates source from their own repos (sec-af, swe-af, etc.), not from Agent-Field/agentfield. The deployment guide (deployments/railway/README.md) instructs image-based deploys only.

The only service in the entire footprint that sources from Agent-Field/agentfield is controlplane-template's example node, with rootDirectory: /examples/ts-node-examples/init-example and no explicit railwayConfigFile. Railway falls back to repo-root /railway.json, which says "build deployments/docker/Dockerfile.control-plane". That Dockerfile expects the repo root as build context (it COPYs control-plane/web/client/...), but Railway scopes the context to the service's rootDirectory — where control-plane/ doesn't exist. Boom.

Why now

PR #151 (Jan 21) switched the template's control-plane to a prebuilt image and removed railway.toml, but kept railway.json "just in case." That same PR explored a per-example railway.toml override (commit 0ba92fbf"Add railway.toml to init-example to override root config"), then reverted it (6d71540f) when the image switchover was deemed sufficient. It wasn't — the example node service was still building from the repo, just with no local override. The bug was latent until someone deployed the template fresh today.

Fix

  • Commit 1 — delete repo-root railway.json. Nothing depends on it, and its presence breaks the example node service.
  • Commit 2 — drop the per-example railway.json from fix(examples/init-example): pin Railway build to local Dockerfile #522. With root config gone, Railway falls through to auto-detecting the local Dockerfile in the rootDirectory — which is what the example was always meant to use, and what the existing local Dockerfile provides (simple node:20-alpine + npm start).

Test plan

  • Trigger a redeploy of the example node service in the github-buddy Railway project against this branch and confirm the build uses examples/ts-node-examples/init-example/Dockerfile (not Dockerfile.control-plane) and succeeds.
  • Confirm the agent registers with the control plane and shows healthy.
  • Smoke-test by deploying the controlplane-template template fresh in a throwaway project and verifying all 3 services come up.

AbirAbbas and others added 2 commits May 3, 2026 19:14
Every Railway template that ships AgentField (controlplane-template,
sec-af, swe-af, contract-af, cloudsecurity-af, agentfield-deep-research)
deploys the control plane via the prebuilt image
agentfield/control-plane:latest, not by building this repo. No live
service in the workspace builds the agentfield repo as a control plane,
and deployments/railway/README.md documents image-based deploys only.

This file was a leftover from before the switchover to prebuilt images.
Worse, it actively breaks any service that points at a sub-path of the
repo via rootDirectory: Railway falls back to /railway.json, finds
"dockerfilePath: deployments/docker/Dockerfile.control-plane", and tries
to build the control plane Dockerfile against the sub-path's context —
which has no control-plane/ directory, so the first COPY fails with:

    failed to compute cache key: "/control-plane/web/client": not found

That's exactly what the controlplane-template's "example node" service
(rootDirectory /examples/ts-node-examples/init-example) hit on every
fresh template instantiation since PR #151. With this file gone Railway
falls through to auto-detecting the local Dockerfile in the service's
rootDirectory, which is what the example was always meant to use.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Added in #522 as a defensive override against the dead repo-root
railway.json. With that root file removed in the previous commit,
Railway auto-detects the local Dockerfile in the service's rootDirectory
on its own, so this per-example config is dead weight too.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@AbirAbbas AbirAbbas requested a review from a team as a code owner May 3, 2026 23:15
@AbirAbbas AbirAbbas merged commit 5338ac5 into main May 3, 2026
16 checks passed
@AbirAbbas AbirAbbas deleted the fix/remove-dead-root-railway-config branch May 3, 2026 23:17
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