Skip to content

Stop collecting goosed stderr after startup#7814

Merged
DOsinga merged 1 commit intomainfrom
fix/stop-errorlog-after-startup
Mar 11, 2026
Merged

Stop collecting goosed stderr after startup#7814
DOsinga merged 1 commit intomainfrom
fix/stop-errorlog-after-startup

Conversation

@DOsinga
Copy link
Collaborator

@DOsinga DOsinga commented Mar 11, 2026

Fixes #7793

errorLog in goosed.ts grows unbounded over long sessions — every line goosed emits to stderr gets pushed into an array and never removed. Over 20+ hour sessions this means hundreds of thousands of retained strings, plus every non-fatal line was being re-logged via logger.info() causing additional string allocation.

The array is only used during the ~10 second startup health check to detect fatal errors, and in the error dialog if startup fails. After startup succeeds it serves no purpose.

Changes:

  • Add stopErrorLogCollection() to GoosedResult — sets a flag that makes the stderr handler return immediately
  • Call it in main.ts after checkServerStatus succeeds, and clear the array
  • Stop re-logging non-fatal stderr lines (goosed already writes to its own log files)

This is defensive cleanup rather than a confirmed crash fix — the EXC_BREAKPOINT crash in #7793 is deep in V8 GC internals and may require an Electron upgrade to fully resolve. But the unbounded growth is a real memory leak that should be fixed regardless.

errorLog grows unbounded over long sessions — every line goosed emits to
stderr gets pushed into an array and never removed. Over 20+ hour sessions
this means hundreds of thousands of retained strings.

The array is only used during the ~10 second startup health check to detect
fatal errors, and in the error dialog if startup fails. After startup
succeeds it serves no purpose.

Stop collecting after startup and clear the array. Also stop re-logging
non-fatal stderr lines since goosed already writes to its own log files.
@DOsinga DOsinga force-pushed the fix/stop-errorlog-after-startup branch from edca0a3 to df621a4 Compare March 11, 2026 17:15
Copy link
Collaborator

@jamadeo jamadeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works but looks like it could be cleaned up too. If we only use the errorLog to pass to checkServerStatus, maybe that checkServerStatus should be merged into the return value of startGoosed and unsubscribe itself once it returns ready

@DOsinga DOsinga added this pull request to the merge queue Mar 11, 2026
Merged via the queue into main with commit b2e20c2 Mar 11, 2026
20 of 21 checks passed
@DOsinga DOsinga deleted the fix/stop-errorlog-after-startup branch March 11, 2026 18:24
lifeizhou-ap added a commit that referenced this pull request Mar 12, 2026
* main: (270 commits)
  test(acp): align provider and server test parity (#7822)
  fix(acp): register MCP extensions when resuming a session (#7806)
  fix(goose): load .gitignore in prompt_manager for hint file filtering (#7795)
  fix: remap max_completion_tokens to max_tokens for OpenAI-compatible providers (#7765)
  fix(openai): preserve Responses API tool call/output linkage (#7759)
  chore(deps): bump @hono/node-server from 1.19.9 to 1.19.11 in /evals/open-model-gym/mcp-harness (#7687)
  fix: return ContextLengthExceeded when prompt exceeds effective KV cache size (#7815)
  feat: MCP Roots support (#7790)
  fix(google): use `includeThoughts/part.thought` for thinking handling (#7593)
  refactor: simplify tokenizer initialization — remove unnecessary Result wrapper (#7744)
  Fix model selector showing wrong model in tabs (#7784)
  Stop collecting goosed stderr after startup (#7814)
  fix: avoid word splitting by space for windows shell commands (#7781) (#7810)
  Simplify and make it not break on linux (#7813)
  Add preferred microphone selection  (#7805)
  Remove dependency on posthog-rs (#7811)
  feat: load hints in nested subdirs (#7772)
  feat(acp): add read tool and delegate filesystem I/O to ACP clients (#7668)
  Support secret interpolation in streamable HTTP extension URLs (#7782)
  More logging for command injection classifier model training (#7779)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Goose Desktop crash: EXC_BREAKPOINT (SIGTRAP) in Electron Framework after ~22 hours uptime

2 participants