Skip to content

web auto-dashboard always reports inactive — subprocess reads in-memory AutoSession state instead of disk #1

@igouss

Description

@igouss

Bug

The web dashboard permanently shows "Auto Mode Inactive" even when auto-mode is actively running.

Root Cause

auto-dashboard-service.ts resolves the module path to auto.ts:

// src/web/auto-dashboard-service.ts
join(packageRoot, "src", "resources", "extensions", "gsd", "auto.ts")

auto.ts instantiates AutoSession at module scope:

const s = new AutoSession();  // line 251

getAutoDashboardData() reads from s:

return {
  active: s.active,       // always false in subprocess
  paused: s.paused,       // always false
  basePath: s.basePath,   // always ""
  currentUnit: s.currentUnit ? { ...s.currentUnit } : null,  // always null
  completedUnits: [...s.completedUnits],  // always []
  totalCost: totals?.cost ?? 0,    // always 0 — getLedger() returns null, initMetrics() never called
  totalTokens: totals?.tokens.total ?? 0,
}

AutoSession is purely in-memory state, populated only when auto-mode is running inside that specific process. The subprocess is a fresh one-shot process — s is always at zero values. getLedger() also returns null because initMetrics() is never called in the subprocess.

The subprocess always returns:

{ "active": false, "paused": false, "basePath": "", "currentUnit": null, "completedUnits": [], "totalCost": 0, "totalTokens": 0 }

The UI reads auto?.active in dashboard.tsx, sidebar.tsx, status-bar.tsx, chat-mode.tsx, and projects-view.tsx to gate the "Auto Mode Active" display and current unit rendering.

Fix

Replace the subprocess call with a disk-state reader. The crash lock file (.gsd/runtime/gsd-lock.json) is written and updated by the running auto-mode process and is the canonical signal of a live session. A new function readAutoDashboardFromDisk(basePath) using readCrashLock + isLockProcessAlive (already in crash-recovery.ts) + loadLedgerFromDisk (already in metrics.ts) gives correct data without in-memory AutoSession dependency.

Note: this bug is paired with the companion issue about missing projectCwd — the subprocess also has no project path in its environment, so any disk-based fix also needs that threaded through.

Affected Files

  • src/web/auto-dashboard-service.ts
  • src/resources/extensions/gsd/auto.ts (should not be loaded here — disk reader needed)
  • web/components/gsd/dashboard.tsx, sidebar.tsx, status-bar.tsx, chat-mode.tsx, projects-view.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions