-
Notifications
You must be signed in to change notification settings - Fork 0
collectAuthoritativeAutoDashboardData never passes projectCwd to subprocess #2
Description
Bug
Even if the auto-dashboard subprocess logic is fixed to read from disk (see #1), it has no way to know which project to read. The subprocess environment contains no project path.
Root Cause
bridge-service.ts calls:
// src/web/bridge-service.ts ~line 652
return await collectAuthoritativeAutoDashboardData(config.packageRoot, {
execPath: deps.execPath ?? process.execPath,
env,
existsSync: deps.existsSync ?? existsSync,
});collectAuthoritativeAutoDashboardData only accepts packageRoot — no projectCwd parameter. The subprocess env passed is {...process.env, GSD_AUTO_DASHBOARD_MODULE: autoModulePath} with no project path injected.
The subprocess runs with cwd: packageRoot (the GSD package root), not the user's project directory. Any disk reads using process.cwd() inside the subprocess would resolve against the package root, not the project.
Fix
Thread projectCwd through the call chain:
collectAuthoritativeAutoDashboardData(packageRoot, projectCwd, options)— add parameter- Pass
GSD_PROJECT_CWD: projectCwdin the subprocess env - The disk-state reader in the subprocess reads
process.env.GSD_PROJECT_CWDasbasePath
The bridge call site already has config.projectCwd available — it just needs to be forwarded.
Affected Files
src/web/auto-dashboard-service.ts—collectAuthoritativeAutoDashboardDatasignature + subprocess envsrc/web/bridge-service.ts— call site at ~line 652
Relationship
Companion to #1. Both must be fixed together for auto-mode status to work correctly in the web dashboard.