@vellumai/cli 0.10.7-dev.202607082034.5ac40b3 → 0.10.7-dev.202607082203.bf32263
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/__tests__/sleep.test.ts +1 -2
- package/src/commands/recover.ts +3 -3
- package/src/commands/sleep.ts +2 -3
- package/src/commands/upgrade.ts +2 -2
- package/src/commands/wake.ts +3 -4
- package/src/lib/__tests__/local-ces.test.ts +0 -1
- package/src/lib/hatch-local.ts +3 -3
- package/src/lib/local.ts +5 -9
- package/src/lib/retire-local.ts +2 -3
package/package.json
CHANGED
|
@@ -172,8 +172,7 @@ describe("sleep command", () => {
|
|
|
172
172
|
undefined,
|
|
173
173
|
7000,
|
|
174
174
|
);
|
|
175
|
-
// The CES sibling
|
|
176
|
-
// no-op when absent on the default topology.
|
|
175
|
+
// The CES sibling is stopped by its PID file; a no-op when absent.
|
|
177
176
|
expect(stopProcessByPidFileMock).toHaveBeenNthCalledWith(
|
|
178
177
|
3,
|
|
179
178
|
join(assistantRootDir, "ces.pid"),
|
package/src/commands/recover.ts
CHANGED
|
@@ -118,9 +118,9 @@ export async function recover(): Promise<void> {
|
|
|
118
118
|
entry.guardianBootstrapSecret = bootstrapSecret;
|
|
119
119
|
saveAssistantEntry(entry);
|
|
120
120
|
|
|
121
|
-
// 8. Start CES sibling
|
|
122
|
-
// Docker topology brings its sibling processes up together. startCes
|
|
123
|
-
//
|
|
121
|
+
// 8. Start CES sibling + daemon + gateway in parallel, the way the
|
|
122
|
+
// Docker topology brings its sibling processes up together. startCes
|
|
123
|
+
// always launches the CES sibling.
|
|
124
124
|
await Promise.all([
|
|
125
125
|
startCes(false, entry.resources),
|
|
126
126
|
startLocalDaemon(false, entry.resources, { signingKey }),
|
package/src/commands/sleep.ts
CHANGED
|
@@ -168,9 +168,8 @@ export async function sleep(): Promise<void> {
|
|
|
168
168
|
console.log("Gateway stopped.");
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
// Stop the CES sibling
|
|
172
|
-
// PID file is absent
|
|
173
|
-
// stdio child and it exits with the daemon.
|
|
171
|
+
// Stop the CES sibling — it is stopped by its PID file, a no-op when the
|
|
172
|
+
// PID file is absent (e.g. the sibling was never started or already exited).
|
|
174
173
|
const cesPidFile = join(vellumDir, "ces.pid");
|
|
175
174
|
const cesStopped = await stopProcessByPidFile(
|
|
176
175
|
cesPidFile,
|
package/src/commands/upgrade.ts
CHANGED
|
@@ -1018,8 +1018,8 @@ async function upgradeLocal(
|
|
|
1018
1018
|
process.env.APP_VERSION = stripVersionPrefix(targetVersion);
|
|
1019
1019
|
try {
|
|
1020
1020
|
// Bring CES, daemon, and gateway up in parallel, the way the Docker
|
|
1021
|
-
// topology starts its sibling processes together. startCes
|
|
1022
|
-
//
|
|
1021
|
+
// topology starts its sibling processes together. startCes always
|
|
1022
|
+
// launches the CES sibling.
|
|
1023
1023
|
await Promise.all([
|
|
1024
1024
|
startCes(false, entry.resources),
|
|
1025
1025
|
startLocalDaemon(false, entry.resources, { signingKey }),
|
package/src/commands/wake.ts
CHANGED
|
@@ -210,9 +210,8 @@ export async function wake(): Promise<void> {
|
|
|
210
210
|
// CES socket during startup (discoverCesWithRetry), so it tolerates CES
|
|
211
211
|
// still binding. CES's lifecycle tracks the daemon (its only consumer):
|
|
212
212
|
// restarting it under a live daemon would sever the daemon's open
|
|
213
|
-
// connection, so it is only (re)started alongside the daemon. startCes
|
|
214
|
-
//
|
|
215
|
-
// CES itself as today.
|
|
213
|
+
// connection, so it is only (re)started alongside the daemon. startCes
|
|
214
|
+
// always launches the CES sibling unconditionally.
|
|
216
215
|
await Promise.all([
|
|
217
216
|
startCes(watch, resources),
|
|
218
217
|
startLocalDaemon(watch, resources, { foreground, signingKey }),
|
|
@@ -229,7 +228,7 @@ export async function wake(): Promise<void> {
|
|
|
229
228
|
// died independently (crash, OOM kill). A dead ces.pid under a live daemon
|
|
230
229
|
// means credential operations will fail until the next wake. Relaunch the
|
|
231
230
|
// sibling so the daemon's lazy reconnect (secure-keys.ts) picks it up on
|
|
232
|
-
// the next credential read. startCes
|
|
231
|
+
// the next credential read. startCes always launches the sibling.
|
|
233
232
|
const vellumDir = join(resources.instanceDir, ".vellum");
|
|
234
233
|
const cesPidFile = join(vellumDir, "ces.pid");
|
|
235
234
|
const cesAlive = isProcessAlive(cesPidFile).alive;
|
|
@@ -92,7 +92,6 @@ describe("startCes", () => {
|
|
|
92
92
|
|
|
93
93
|
// Verify env vars
|
|
94
94
|
const env = lastSpawnCall!.options.env!;
|
|
95
|
-
expect(env["CES_STANDALONE"]).toBe("1");
|
|
96
95
|
expect(env["CES_LOCAL_SOCKET"]).toBeDefined();
|
|
97
96
|
expect(env["CREDENTIAL_SECURITY_DIR"]).toBeDefined();
|
|
98
97
|
expect(env["VELLUM_WORKSPACE_DIR"]).toBeDefined();
|
package/src/lib/hatch-local.ts
CHANGED
|
@@ -227,9 +227,9 @@ export async function hatchLocal(
|
|
|
227
227
|
const signingKey = generateLocalSigningKey();
|
|
228
228
|
const bootstrapSecret = generateLocalSigningKey();
|
|
229
229
|
// Launch the CES sibling alongside the daemon, in parallel — matching the
|
|
230
|
-
// Docker topology.
|
|
231
|
-
//
|
|
232
|
-
// startCes
|
|
230
|
+
// Docker topology. The assistant does not spawn its own CES, so a freshly
|
|
231
|
+
// hatched instance would otherwise come up with CES unavailable.
|
|
232
|
+
// startCes always launches the CES sibling.
|
|
233
233
|
await Promise.all([
|
|
234
234
|
startCes(watch, resources),
|
|
235
235
|
startLocalDaemon(watch, resources, {
|
package/src/lib/local.ts
CHANGED
|
@@ -577,7 +577,6 @@ function applyDaemonEnvOverrides(
|
|
|
577
577
|
// regardless of any stale CES_LOCAL_SOCKET inherited from the parent
|
|
578
578
|
// environment. The assistant connects to the sibling instead of spawning
|
|
579
579
|
// its own CES.
|
|
580
|
-
env.CES_STANDALONE = "1";
|
|
581
580
|
env.CES_LOCAL_SOCKET = resolveCesSocketPath(resources);
|
|
582
581
|
applyIpcSocketDirOverride(env);
|
|
583
582
|
}
|
|
@@ -852,10 +851,9 @@ function resolveCesSocketPath(resources?: LocalInstanceResources): string {
|
|
|
852
851
|
* the default topology for local (non-containerized) instances, matching how
|
|
853
852
|
* containerized homes already run CES.
|
|
854
853
|
*
|
|
855
|
-
* The sibling runs
|
|
856
|
-
* SIGTERM
|
|
857
|
-
*
|
|
858
|
-
* `sleep`.
|
|
854
|
+
* The sibling runs as an independent process with its lifecycle anchored to
|
|
855
|
+
* SIGTERM, mirroring the gateway: a CLI-owned process with a PID file under
|
|
856
|
+
* `.vellum/ces.pid`, started by `wake` and stopped by `sleep`.
|
|
859
857
|
*/
|
|
860
858
|
export async function startCes(
|
|
861
859
|
watch: boolean = false,
|
|
@@ -891,7 +889,6 @@ export async function startCes(
|
|
|
891
889
|
|
|
892
890
|
const cesEnv: Record<string, string | undefined> = {
|
|
893
891
|
...process.env,
|
|
894
|
-
CES_STANDALONE: "1",
|
|
895
892
|
CES_LOCAL_SOCKET: socketPath,
|
|
896
893
|
CREDENTIAL_SECURITY_DIR: securityDir,
|
|
897
894
|
VELLUM_WORKSPACE_DIR: workspaceDir,
|
|
@@ -1701,9 +1698,8 @@ export async function stopLocalProcesses(
|
|
|
1701
1698
|
const gatewayPidFile = join(vellumDir, "gateway.pid");
|
|
1702
1699
|
await stopProcessByPidFile(gatewayPidFile, "gateway", undefined, 7000);
|
|
1703
1700
|
|
|
1704
|
-
// Stop the CES sibling if one was launched
|
|
1705
|
-
// PID file is absent
|
|
1706
|
-
// assistant owns CES as an stdio child.
|
|
1701
|
+
// Stop the CES sibling if one was launched. No-op when the
|
|
1702
|
+
// PID file is absent.
|
|
1707
1703
|
const cesPidFile = join(vellumDir, "ces.pid");
|
|
1708
1704
|
await stopProcessByPidFile(cesPidFile, "credential-executor");
|
|
1709
1705
|
|
package/src/lib/retire-local.ts
CHANGED
|
@@ -66,9 +66,8 @@ export async function retireLocal(
|
|
|
66
66
|
const gatewayPidFile = join(vellumDir, "gateway.pid");
|
|
67
67
|
await stopProcessByPidFile(gatewayPidFile, "gateway", undefined, 7000);
|
|
68
68
|
|
|
69
|
-
// Stop the CES sibling
|
|
70
|
-
// PID file is absent
|
|
71
|
-
// stdio child and it exits with the daemon.
|
|
69
|
+
// Stop the CES sibling — it is stopped by its PID file, a no-op when the
|
|
70
|
+
// PID file is absent (e.g. the sibling was never started or already exited).
|
|
72
71
|
const cesPidFile = join(vellumDir, "ces.pid");
|
|
73
72
|
const cesStopped = await stopProcessByPidFile(
|
|
74
73
|
cesPidFile,
|