Stop collecting goosed stderr after startup#7814
Merged
Conversation
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.
edca0a3 to
df621a4
Compare
jamadeo
approved these changes
Mar 11, 2026
Collaborator
jamadeo
left a comment
There was a problem hiding this comment.
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
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) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7793
errorLogingoosed.tsgrows 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 vialogger.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:
stopErrorLogCollection()toGoosedResult— sets a flag that makes the stderr handler return immediatelymain.tsaftercheckServerStatussucceeds, and clear the arrayThis is defensive cleanup rather than a confirmed crash fix — the
EXC_BREAKPOINTcrash 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.