Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

FEAT-133: Add gateway diagnostics logging with UI - #39

Merged
shafty023 merged 2 commits into
mainfrom
FEAT-145
Mar 24, 2026
Merged

FEAT-133: Add gateway diagnostics logging with UI#39
shafty023 merged 2 commits into
mainfrom
FEAT-145

Conversation

@shafty023

Copy link
Copy Markdown
Contributor
  • Add GatewayLogger class with info/warn/error/debug levels and in-memory ring buffer (500 entries) for UI display
  • Add structured logging to Socket.IO lifecycle (connect, disconnect, auth errors, hello ack, hello timeout)
  • Add logging to cloud command executor (enqueue, execute, gateway HTTP errors, timeout, failure)
  • Add logging to symphony loop harness (request source relay/local, process spawn, exit code, event POST errors, artifact upload errors)
  • Split logging: lifecycle events and errors always visible, granular per-step details gated behind verbose toggle
  • Suppress consecutive identical log messages (dedup presence spam)
  • Add Diagnostics tab with auto-refresh, verbose toggle, and color-coded error/warn row highlighting
  • Rename Activity Log tab to Requests for clarity
  • Add verboseLogging to DesktopSettings with persistence

Testing:

  • just desktop-typecheck passes
  • just desktop-test passes (288/288)
  • just desktop-lint passes

Risks:

  • Logging adds minor overhead to hot paths (suppressed by dedup)
  • In-memory buffer capped at 500 entries, no disk persistence

- Add GatewayLogger class with info/warn/error/debug levels and
  in-memory ring buffer (500 entries) for UI display
- Add structured logging to Socket.IO lifecycle (connect, disconnect,
  auth errors, hello ack, hello timeout)
- Add logging to cloud command executor (enqueue, execute, gateway
  HTTP errors, timeout, failure)
- Add logging to symphony loop harness (request source relay/local,
  process spawn, exit code, event POST errors, artifact upload errors)
- Split logging: lifecycle events and errors always visible, granular
  per-step details gated behind verbose toggle
- Suppress consecutive identical log messages (dedup presence spam)
- Add Diagnostics tab with auto-refresh, verbose toggle, and
  color-coded error/warn row highlighting
- Rename Activity Log tab to Requests for clarity
- Add verboseLogging to DesktopSettings with persistence

Testing:
- just desktop-typecheck passes
- just desktop-test passes (288/288)
- just desktop-lint passes

Risks:
- Logging adds minor overhead to hot paths (suppressed by dedup)
- In-memory buffer capped at 500 entries, no disk persistence
Comment thread apps/desktop/src/renderer/index.html Outdated
Comment thread apps/desktop/src/main/gateway-logger.ts
Comment thread apps/desktop/src/renderer/index.html Outdated
Comment thread apps/desktop/src/renderer/index.html Outdated
Comment thread apps/desktop/src/main/gateway-logger.ts Outdated
@closedloop-ai-stage

Copy link
Copy Markdown

Code Review Summary

Status: Approved

Reviewers: Bug Hunter A, Bug Hunter B, Unified Auditor, Premise Reviewer, Cloud Command Executor Specialist

Findings

Severity Count
Blocking 0
High 0
Medium 5

MEDIUM Issues (consider)

  1. [[P3] [apps/desktop/src/renderer/index.html:2825] LOG_LEVEL_COLORS constant defined but never used
  2. [[P2] [apps/desktop/src/main/gateway-logger.ts:60] clear() does not reset lastMessage, causing first post-clear duplicate to be silently dropped
  3. [[P2] [apps/desktop/src/renderer/index.html:2852] e.tag rendered without HTML escaping in logsList innerHTML
  4. [[P2] [apps/desktop/src/renderer/index.html:2855] renderLogs unconditionally scrolls to bottom on every auto-refresh, disrupting user reading position
  5. [[P2] [apps/desktop/src/main/gateway-logger.ts:62] clear() passes live mutable buffer reference to onChange, inconsistent with log() which passes a copy

Validation Stats

  • Agent failures: 0 partitions skipped
  • Cross-file grouped: 0 findings consolidated
  • Duplicates merged: 2

Recommendation: Approve. No blocking or high issues. The clear()/lastMessage bug and scroll-lock UX are the most impactful medium items.

- Reset lastMessage on clear() so first post-clear log is not dropped
- Pass copy (not mutable ref) from clear() onChange callback
- Remove unused LOG_LEVEL_COLORS constant
- Escape e.tag in log row innerHTML to prevent XSS
- Only auto-scroll to bottom if user was already at bottom
@shafty023
shafty023 merged commit 1daf8df into main Mar 24, 2026
2 checks passed
@shafty023
shafty023 deleted the FEAT-145 branch March 24, 2026 20:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant