Skip to content

The open-source agent harness - the runtime layer that turns an LLM into a working agent.

feat: preserve supervisord ENTRYPOINT in Daytona buildInfo snapshots (#1056)

Sujai Kumar Gupta36a0bfa2b0aa
diff --git a/.changeset/daytona-buildinfo-supervisord-entrypoint.md b/.changeset/daytona-buildinfo-supervisord-entrypoint.md
new file mode 100644
index 000000000..bd3aab73d
--- /dev/null
+++ b/.changeset/daytona-buildinfo-supervisord-entrypoint.md
@@ -0,0 +1,6 @@
+---
+'@truefoundry/trueforge-core': patch
+'@truefoundry/trueforge': patch
+---
+
+Preserve supervisord ENTRYPOINT on Daytona custom-environment buildInfo snapshots so the sandbox NATS bridge starts (Daytona otherwise defaults to sleep infinity).
diff --git a/packages/trueforge-core/src/core/sandbox/provider/DaytonaProvider.ts b/packages/trueforge-core/src/core/sandbox/provider/DaytonaProvider.ts
index c8376d311..473cf3f51 100644
--- a/packages/trueforge-core/src/core/sandbox/provider/DaytonaProvider.ts
+++ b/packages/trueforge-core/src/core/sandbox/provider/DaytonaProvider.ts
@@ -209,9 +209,15 @@ export class DaytonaSandboxProvider implements SandboxProvider<DaytonaSandboxEnv
/**
* Dockerfile that layers `build_script` onto the release base image.
* JSON-array RUN keeps the script bytes intact (newlines, quotes) without shell-escaping hell.
+ * Explicit ENTRYPOINT (same as sandbox.Dockerfile) is required: Daytona does not inherit it from
+ * FROM for buildInfo snapshots and otherwise defaults to `sleep infinity`.
*/
private dockerfileFromBuildScript({ imageUri, buildScript }: { imageUri: string; buildScript: string }): string {
- return `FROM ${imageUri}\nRUN ["bash", "-lc", ${JSON.stringify(buildScript)}]`;
+ return [
+ `FROM ${imageUri}`,
+ `RUN ["bash", "-lc", ${JSON.stringify(buildScript)}]`,
+ 'ENTRYPOINT ["/usr/bin/supervisord", "-n"]',
+ ].join('\n');
}
/** Body for POST /snapshots — imageName XOR buildInfo (Daytona mutual exclusion). */
diff --git a/packages/trueforge-core/tests/core/sandbox/daytonaSnapshotRegistration.test.ts b/packages/trueforge-core/tests/core/sandbox/daytonaSnapshotRegistration.test.ts
index c7aa7f073..d6a4c3f81 100644
--- a/packages/trueforge-core/tests/core/sandbox/daytonaSnapshotRegistration.test.ts
+++ b/packages/trueforge-core/tests/core/sandbox/daytonaSnapshotRegistration.test.ts
@@ -92,7 +92,11 @@ describe('DaytonaSandboxProvider register-only snapshot create', () => {
memory: 4,
disk: 10,
buildInfo: {
- dockerfileContent: `FROM registry.example.com/sandbox:029ea5ff\nRUN ["bash", "-lc", ${JSON.stringify(buildScript)}]`,
+ dockerfileContent: [
+ 'FROM registry.example.com/sandbox:029ea5ff',
+ `RUN ["bash", "-lc", ${JSON.stringify(buildScript)}]`,
+ 'ENTRYPOINT ["/usr/bin/supervisord", "-n"]',
+ ].join('\n'),
},
});
});