Skip to content

Commit ac92a20

Browse files
committed
remove crumbs
1 parent e140f62 commit ac92a20

File tree

4 files changed

+0
-33
lines changed

4 files changed

+0
-33
lines changed

packages/cli-v3/src/dev/backgroundWorker.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import { prettyError } from "../utilities/cliOutput.js";
66
import { writeJSONFile } from "../utilities/fileSystem.js";
77
import { logger } from "../utilities/logger.js";
88
import type { Metafile } from "esbuild";
9-
import { trail } from "agentcrumbs"; // @crumbs
10-
const crumb = trail("cli"); // @crumbs
119

1210
export type BackgroundWorkerOptions = {
1311
env: Record<string, string>;
@@ -39,7 +37,6 @@ export class BackgroundWorker {
3937
}
4038

4139
stop() {
42-
crumb("BackgroundWorker.stop", { version: this.serverWorker?.version, outputPath: this.build.outputPath }); // @crumbs
4340
logger.debug("[BackgroundWorker] Stopping worker", {
4441
version: this.serverWorker?.version,
4542
outputPath: this.build.outputPath,

packages/cli-v3/src/dev/devSession.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ import {
2828
import { startDevOutput } from "./devOutput.js";
2929
import { startWorkerRuntime } from "./devSupervisor.js";
3030
import { startMcpServer, stopMcpServer } from "./mcpServer.js";
31-
import { trail } from "agentcrumbs"; // @crumbs
32-
const crumb = trail("cli"); // @crumbs
3331
import { writeJSONFile } from "../utilities/fileSystem.js";
3432
import { join } from "node:path";
3533

@@ -61,7 +59,6 @@ export async function startDevSession({
6159
const destination = getTmpDir(rawConfig.workingDir, "build", keepTmpFiles);
6260
// Create shared store directory for deduplicating chunk files across rebuilds
6361
const storeDir = getStoreDir(rawConfig.workingDir, keepTmpFiles);
64-
crumb("devSession started", { destinationPath: destination.path, storeDir, workingDir: rawConfig.workingDir }); // @crumbs
6562

6663
const runtime = await startWorkerRuntime({
6764
name,
@@ -104,7 +101,6 @@ export async function startDevSession({
104101
const pluginsFromExtensions = resolvePluginsForContext(buildContext);
105102

106103
async function updateBundle(bundle: BundleResult, workerDir?: EphemeralDirectory) {
107-
crumb("updateBundle", { isRebuild: !!workerDir, workerDirPath: workerDir?.path, destinationPath: destination.path }); // @crumbs
108104
let buildManifest = await createBuildManifestFromBundle({
109105
bundle,
110106
destination: destination.path,
@@ -185,7 +181,6 @@ export async function startDevSession({
185181
}
186182

187183
const workerDir = getTmpDir(rawConfig.workingDir, "build", keepTmpFiles);
188-
crumb("rebuild: new workerDir", { path: workerDir.path }); // @crumbs
189184
await updateBuild(result, workerDir);
190185
});
191186
},
@@ -229,7 +224,6 @@ export async function startDevSession({
229224

230225
return {
231226
stop: () => {
232-
crumb("devSession stopping", { destinationPath: destination.path }); // @crumbs
233227
logger.debug("Stopping dev session");
234228

235229
destination.remove();

packages/cli-v3/src/dev/devSupervisor.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ import {
2828
} from "@trigger.dev/core/v3/workers";
2929
import pLimit from "p-limit";
3030
import { resolveLocalEnvVars } from "../utilities/localEnvVars.js";
31-
import { trail } from "agentcrumbs"; // @crumbs
32-
const crumb = trail("cli"); // @crumbs
3331
import type { Metafile } from "esbuild";
3432
import { TaskRunProcessPool } from "./taskRunProcessPool.js";
3533
import { tryCatch } from "@trigger.dev/core/utils";
@@ -435,8 +433,6 @@ class DevSupervisor implements WorkerRuntime {
435433
for (const message of result.data.dequeuedMessages) {
436434
const worker = this.workers.get(message.backgroundWorker.friendlyId);
437435

438-
crumb("dequeue run", { runId: message.run.friendlyId, targetWorkerId: message.backgroundWorker.friendlyId, workerFound: !!worker, workerDeprecated: worker?.deprecated, availableWorkers: Array.from(this.workers.keys()) }); // @crumbs
439-
440436
if (!worker) {
441437
logger.debug(
442438
`[DevSupervisor] dequeueRuns. Dequeued a run but there's no BackgroundWorker so we can't execute it`,
@@ -510,7 +506,6 @@ class DevSupervisor implements WorkerRuntime {
510506
taskRunProcessPool: this.taskRunProcessPool,
511507
cwd,
512508
onFinished: () => {
513-
crumb("run finished", { runId: message.run.friendlyId, workerId: message.backgroundWorker.friendlyId, workerDeprecated: worker.deprecated }); // @crumbs
514509

515510
logger.debug("[DevSupervisor] Run finished", { runId: message.run.friendlyId });
516511

@@ -522,7 +517,6 @@ class DevSupervisor implements WorkerRuntime {
522517

523518
//stop the worker if it is deprecated and there are no more runs
524519
if (worker.deprecated) {
525-
crumb("run finished on deprecated worker, scheduling cleanup", { workerId: message.backgroundWorker.friendlyId }); // @crumbs
526520
this.#tryDeleteWorker(message.backgroundWorker.friendlyId).finally(() => {});
527521
}
528522
},
@@ -613,15 +607,12 @@ class DevSupervisor implements WorkerRuntime {
613607
return;
614608
}
615609

616-
crumb("registerWorker", { newWorkerId: worker.serverWorker.id, version: worker.serverWorker.version, existingWorkers: Array.from(this.workers.keys()) }); // @crumbs
617-
618610
//deprecate other workers
619611
for (const [workerId, existingWorker] of this.workers.entries()) {
620612
if (workerId === worker.serverWorker.id) {
621613
continue;
622614
}
623615

624-
crumb("deprecating worker", { workerId, hasActiveRuns: Array.from(this.runControllers.values()).some(c => { try { return c.workerFriendlyId === workerId; } catch { return false; } }) }); // @crumbs
625616
existingWorker.deprecate();
626617
this.#tryDeleteWorker(workerId).finally(() => {});
627618
}
@@ -750,23 +741,17 @@ class DevSupervisor implements WorkerRuntime {
750741
static readonly MAX_DEPRECATED_WORKERS = 2;
751742

752743
async #tryDeleteWorker(friendlyId: string) {
753-
crumb("tryDeleteWorker: waiting 5s", { friendlyId }); // @crumbs
754744
await awaitTimeout(5_000);
755745
this.#cleanupWorker(friendlyId);
756746
}
757747

758748
#cleanupWorker(friendlyId: string) {
759749
const worker = this.workers.get(friendlyId);
760750
if (!worker) {
761-
crumb("cleanupWorker: worker not found in map", { friendlyId }); // @crumbs
762751
return;
763752
}
764753

765754
// Check if any active runs still reference this worker
766-
const activeRunIds = Array.from(this.runControllers.entries()).filter(([, c]) => { try { return c.workerFriendlyId === friendlyId; } catch { return false; } }).map(([id]) => id); // @crumbs
767-
const hasActiveRuns = activeRunIds.length > 0; // @crumbs
768-
769-
crumb("cleanupWorker", { friendlyId, hasActiveRuns, activeRunIds, version: worker.serverWorker?.version, outputPath: worker.build.outputPath }); // @crumbs
770755

771756
if (hasActiveRuns) {
772757
logger.debug("[DevSupervisor] Worker still has active runs, skipping cleanup", {
@@ -804,8 +789,6 @@ class DevSupervisor implements WorkerRuntime {
804789
}
805790
}
806791

807-
crumb("pruneDeprecatedWorkers", { total: deprecatedWorkers.length, max: DevSupervisor.MAX_DEPRECATED_WORKERS, ids: deprecatedWorkers.map(w => w.id) }); // @crumbs
808-
809792
// Keep the most recent deprecated workers, remove the rest
810793
if (deprecatedWorkers.length <= DevSupervisor.MAX_DEPRECATED_WORKERS) {
811794
return;
@@ -818,7 +801,6 @@ class DevSupervisor implements WorkerRuntime {
818801
);
819802

820803
for (const { id, worker } of toRemove) {
821-
crumb("pruning worker", { id, version: worker.serverWorker?.version, outputPath: worker.build.outputPath }); // @crumbs
822804

823805
logger.debug("[DevSupervisor] Pruning old deprecated worker and cleaning up build dir", {
824806
workerId: id,

packages/cli-v3/src/dev/devWatchdog.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
import { readFileSync, writeFileSync, unlinkSync, existsSync, mkdirSync, rmSync } from "node:fs";
2222
import { dirname } from "node:path";
2323
// @crumbs - watchdog runs as detached process, trail imported directly
24-
let crumb: (msg: string, data?: Record<string, unknown>) => void = () => {}; // @crumbs
25-
try { const { trail } = await import("agentcrumbs"); crumb = trail("cli"); } catch {} // @crumbs
2624

2725
const POLL_INTERVAL_MS = 1000;
2826

@@ -81,12 +79,9 @@ function cleanup() {
8179

8280
function cleanupTmpDir() {
8381
if (!tmpDir) return;
84-
crumb("watchdog: cleaning up tmp dir", { tmpDir }); // @crumbs
8582
try {
8683
rmSync(tmpDir, { recursive: true, force: true });
87-
crumb("watchdog: tmp dir removed", { tmpDir }); // @crumbs
8884
} catch {
89-
crumb("watchdog: tmp dir cleanup failed", { tmpDir }); // @crumbs
9085
// Best effort — may fail on Windows with EBUSY
9186
}
9287
}
@@ -129,7 +124,6 @@ const MAX_DISCONNECT_ATTEMPTS = 5;
129124
const INITIAL_BACKOFF_MS = 500;
130125

131126
async function onParentDied(): Promise<void> {
132-
crumb("watchdog: parent died", { parentPid, tmpDir }); // @crumbs
133127
const runFriendlyIds = readActiveRuns();
134128

135129
if (runFriendlyIds.length > 0) {

0 commit comments

Comments
 (0)