fix(railway): remove dead root railway.json hijacking template builds#523
Merged
fix(railway): remove dead root railway.json hijacking template builds#523
Conversation
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>
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.
Summary
Follow-up to #522. Verified that the repo-root
railway.jsonis 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-templateRailway template (e.g. thegithub-buddyproject created today) fails on theexample nodeservice with:Root cause
Verified across the published Railway templates:
controlplane-templateagentfield/control-plane:latestsec-afagentfield/control-plane:latestswe-afagentfield/control-plane:latestcontract-afagentfield/control-plane:latestcloudsecurity-afagentfield/control-plane:latestagentfield-deep-researchagentfield/control-plane:latestEvery control-plane service uses a prebuilt image. Verified the same across every live
control-planedeployment in the workspace (9 projects). Other agent services in those templates source from their own repos (sec-af, swe-af, etc.), not fromAgent-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/agentfieldiscontrolplane-template'sexample node, withrootDirectory: /examples/ts-node-examples/init-exampleand no explicitrailwayConfigFile. Railway falls back to repo-root/railway.json, which says "builddeployments/docker/Dockerfile.control-plane". That Dockerfile expects the repo root as build context (itCOPYscontrol-plane/web/client/...), but Railway scopes the context to the service's rootDirectory — wherecontrol-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 keptrailway.json"just in case." That same PR explored a per-examplerailway.tomloverride (commit0ba92fbf— "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
railway.json. Nothing depends on it, and its presence breaks the example node service.railway.jsonfrom fix(examples/init-example): pin Railway build to local Dockerfile #522. With root config gone, Railway falls through to auto-detecting the localDockerfilein the rootDirectory — which is what the example was always meant to use, and what the existing local Dockerfile provides (simplenode:20-alpine+npm start).Test plan
example nodeservice in thegithub-buddyRailway project against this branch and confirm the build usesexamples/ts-node-examples/init-example/Dockerfile(notDockerfile.control-plane) and succeeds.controlplane-templatetemplate fresh in a throwaway project and verifying all 3 services come up.