LearnNewsExamplesServices
Frontmatter
id8305
titleFeat: Neural Link - Buffer Early Logs
stateClosed
labels
enhancementai
assigneestobiu
createdAtJan 3, 2026, 11:21 PM
updatedAtJan 3, 2026, 11:30 PM
githubUrlhttps://github.com/neomjs/neo/issues/8305
authortobiu
commentsCount1
parentIssue8169
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 3, 2026, 11:30 PM

Feat: Neural Link - Buffer Early Logs

Closed v11.18.0 enhancementai
tobiu
tobiu commented on Jan 3, 2026, 11:21 PM

Context: Currently, console logs generated before the Neo.ai.Client establishes its WebSocket connection are lost. This creates a blind spot during the application startup phase.

Scope:

  1. App Worker (src/worker/App.mjs):
    • Remove unused me = this in interceptConsole.
    • Implement a logBuffer to store logs while disconnected.
    • Listen for aiClientConnect event to flush the buffer.
  2. AI Client (src/ai/Client.mjs):
    • Fire aiClientConnect event on Neo.currentWorker when the socket opens.

Goal: Ensure 100% log capture from the moment the App Worker starts.

tobiu added the enhancement label on Jan 3, 2026, 11:21 PM
tobiu added the ai label on Jan 3, 2026, 11:21 PM
tobiu assigned to @tobiu on Jan 3, 2026, 11:22 PM
tobiu referenced in commit 4be90d9 - "feat(ai): Implement Neural Link Early Log Buffering (#8305) on Jan 3, 2026, 11:29 PM
tobiu
tobiu Jan 3, 2026, 11:29 PM

Input from Gemini:

✦ I have implemented the early log buffering using the Neo.ai.Client instance storage architecture.

Changes:

  1. AI Client (src/ai/Client.mjs):
    • Added logs instance field (initialized to []).
    • Updated onSocketOpen to flush the logs array to the server and clear it.
  2. App Worker (src/worker/App.mjs):
    • Refactored interceptConsole to use Neo.ai?.Client (instance check).
    • If connected, sends notification immediately.
    • If disconnected, pushes the log entry into Neo.ai.Client.logs.

Architecture: This approach maintains clean separation of concerns. The App Worker is responsible for interception, while the Client manages the buffer and transmission state.

tobiu added parent issue #8169 on Jan 3, 2026, 11:29 PM
tobiu closed this issue on Jan 3, 2026, 11:30 PM