Context
PR #2191 wholesale-restored src/commands/status.scan.ts, status.command.ts, status.summary.ts, and sessions.ts. This discarded performance and feature improvements from v2026.3.1/v2026.3.2.
Audit report: hq/engineering/notes/post-remediation-audit-b3b4.md
Findings
Performance (HIGH)
-
DeferredResult<T> pattern (status.scan.ts, v2026.3.1): Generic deferred result for parallelizing async ops — launch early, await later. Reusable utility.
-
scanStatusJsonFast fast path (status.scan.ts, v2026.3.1): Dedicated optimized path for --json mode that avoids progress spinner overhead and runs operations more efficiently in parallel.
-
Parallelized async operations (status.scan.ts, v2026.3.1): Launches tailscaleDnsPromise, updatePromise, agentStatusPromise, summaryPromise concurrently before awaiting. Reduces status scan wall time.
-
Security audit parallelization (status.command.ts, v2026.3.1): JSON mode runs scan + security audit in Promise.all. Non-JSON uses sequential with progress. Reduces status --json latency.
Features (MEDIUM)
-
installKind, gitTag, gitBranch in status (status.command.ts, v2026.3.1): Shows how the tool was installed and git details in status output.
-
formatGitInstallLabel (status.command.ts, v2026.3.1): Git install label row in human-readable status table.
-
Model-aware context token resolution (sessions.ts + status.summary.ts, v2026.3.2): lookupContextTokens(model) replaces hardcoded 200K. Different models have different context windows (128K, 200K, 1M). Fixes incorrect context token display.
-
Configured model display (status.summary.ts, v2026.3.2): Shows actual configured model name instead of "unknown" in status summary.
Code Quality (LOW)
-
resolveGatewayProbeSnapshot (status.scan.ts, v2026.3.2): DRY extraction — gateway probe setup logic.
-
resolveChannelsStatus (status.scan.ts, v2026.3.2): DRY extraction — channel status fetch logic.
-
groupChannelIssuesByChannel (status.command.ts, v2026.3.2): Extracts inline IIFE grouping logic.
-
resolveSessionStoreTargetsOrExit (sessions.ts, v2026.3.2): Replaces try/catch pattern with exit-on-failure function.
Exit Criterion
Status scan JSON mode uses parallelized operations. lookupContextTokens resolves per-model. Existing tests pass.
Context
PR #2191 wholesale-restored
src/commands/status.scan.ts,status.command.ts,status.summary.ts, andsessions.ts. This discarded performance and feature improvements from v2026.3.1/v2026.3.2.Audit report:
hq/engineering/notes/post-remediation-audit-b3b4.mdFindings
Performance (HIGH)
DeferredResult<T>pattern (status.scan.ts, v2026.3.1): Generic deferred result for parallelizing async ops — launch early, await later. Reusable utility.scanStatusJsonFastfast path (status.scan.ts, v2026.3.1): Dedicated optimized path for--jsonmode that avoids progress spinner overhead and runs operations more efficiently in parallel.Parallelized async operations (status.scan.ts, v2026.3.1): Launches
tailscaleDnsPromise,updatePromise,agentStatusPromise,summaryPromiseconcurrently before awaiting. Reduces status scan wall time.Security audit parallelization (status.command.ts, v2026.3.1): JSON mode runs scan + security audit in
Promise.all. Non-JSON uses sequential with progress. Reducesstatus --jsonlatency.Features (MEDIUM)
installKind,gitTag,gitBranchin status (status.command.ts, v2026.3.1): Shows how the tool was installed and git details in status output.formatGitInstallLabel(status.command.ts, v2026.3.1): Git install label row in human-readable status table.Model-aware context token resolution (sessions.ts + status.summary.ts, v2026.3.2):
lookupContextTokens(model)replaces hardcoded 200K. Different models have different context windows (128K, 200K, 1M). Fixes incorrect context token display.Configured model display (status.summary.ts, v2026.3.2): Shows actual configured model name instead of "unknown" in status summary.
Code Quality (LOW)
resolveGatewayProbeSnapshot(status.scan.ts, v2026.3.2): DRY extraction — gateway probe setup logic.resolveChannelsStatus(status.scan.ts, v2026.3.2): DRY extraction — channel status fetch logic.groupChannelIssuesByChannel(status.command.ts, v2026.3.2): Extracts inline IIFE grouping logic.resolveSessionStoreTargetsOrExit(sessions.ts, v2026.3.2): Replaces try/catch pattern with exit-on-failure function.Exit Criterion
Status scan JSON mode uses parallelized operations.
lookupContextTokensresolves per-model. Existing tests pass.