Repository navigation
feat: launch the backend silently at startup, drop the visible startup tab - #1
Merged
Merged
Conversation
…p tab The startup health-check launch now takes the exact path recovery launches have used since 4.1.0: resolve the newest dist/cli.mjs and spawn node directly on it - no wt.exe, no terminal tab, no focus steal, ever. The 4.2.0 rollback to a visible startup tab was triggered by console flashes at OpenCode startup that are actually caused by OpenCode's own local-MCP spawns (cmd.exe /d /s /c npx ... allocates a console per server, and every OpenCode server instance spawns the whole local fleet). Live process-tree audits show the plugin's spawned tree (node -> cli.mjs -> iii.exe) carries no cmd.exe/conhost at all. Startup launches still do not count toward the failure backoff, and launch diagnostics stay in the plugin log (warn) plus agentmemory doctor.
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.
Description
Every backend launch — the startup health-check launch and every 60s-supervision (re)launch alike — now spawns
nodedirectly on the resolved CLI entry. The visible Windows Terminal startup tab (wt.exe -w 0 nt --title agentmemory …) is removed.Why the 4.2.0 rollback to a visible tab was misattributed. The console flashes seen at OpenCode startup come from OpenCode's own local-MCP spawn mechanism, not from this plugin:
cmd.exe /d /s /c "npx …"with its own conhost.exe (sciverse, playwright,@agentmemory/mcp, zai-vision, codegraph, rea, officecli,uvx×2, …), and every OpenCode server instance spawns the whole local fleet → repeated console-window allocations at startup and on MCP restarts.node → cli.mjs → iii.exe, direct child ofopencode.exe) has no cmd.exe and no conhost anywhere in its tree — this launch path cannot allocate a window.dev): local MCP servers spawn through cross-spawn (packages/util/src/cross-spawn-spawner.ts), which rewritesnpx→cmd.exe /d /s /c "npx …". The background serviceopencode.exe serve --serviceis started detached and ends up without a console, so every console-subsystem child allocates a NEW console on start —windowsHideon the child spawn does not prevent that allocation. Open upstream issues with matching traces: #51887 · #52266 · #52281 · #56704; the fix PR #52594 ("give the Windows service a hidden console") was closed unmerged on 2026-10-12, so v2.1.4 still ships the behavior.Startup launches still do not count toward the failure backoff (a failed startup is retried ~90s later, not 180s). Launch diagnostics move entirely to the plugin
warnlog plusnpx @agentmemory/agentmemory doctor(the tab'scloseOnExit: gracefulerror-visibility is gone with the tab).Type of Change
Checklist
npm run typecheckpassesnpm run buildsucceedsEvidence
Before (4.2.1): a startup launch (backend down when the plugin loads) runs
wt.exe -w 0 nt --title agentmemory … node <cli>→ a visible Windows Terminal tab appears and takes focus once.After (this branch) — backend stopped via
npx @agentmemory/agentmemory stop, then the freshly built plugin loaded through a standalone harness:Merge danger: two-way door — revert restores the 4.2.x two-mode behavior; no persisted state changes. Blast radius is the Windows launch UX only: supervision loop, lock/backoff logic, and non-Windows paths are untouched (
spawnSilentis the recovery path already shipped since 4.1.0).Related Issues
Upstream (root cause of the flashing this PR's history was blamed on): anomalyco/opencode #51887 · #52266 · #52281 · #56704 · closed-unmerged fix PR #52594.
Screenshots (if applicable)
N/A — evidence is process-tree based (no window is the point).