Server keeps watching old local plugin trees after a config path swap
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- backend
Direzione di ricerca
Start with packages/core/src/plugin/module.ts, packages/core/src/config/plugin/source.ts, and packages/core/src/filesystem/watcher.ts to understand watch ownership and shared subscriptions. Reproduce the config-path swap, then add a regression test that directly counts active JS streams. Done means obsolete source paths are unsubscribed after reconciliation, while shared helpers and recoverable configured sources remain watched.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Changing plugins from one local source tree to another activates the replacement, but the running server keeps the old tree's file-watcher streams until the owning project location closes. Repeated swaps to new paths add more retained streams. Returning to a previously seen path does not add a second set for that path.
How to reproduce: Configure a local plugin outside the config discovery directories. Give it an entrypoint that imports a local helper. Copy the tree to a second path, then change plugins to point to the copy without restarting the server. Wait for the replacement to become active. Check for active streams under both trees, or check for watcher stopped records for the old tree after settling. Repeat with a third path. The old tree should stop being watched unless another active plugin needs one of its files.
What we measured: On a Linux service based on 2.4.2, with 12 local plugins across 20 loaded project directories, each tree generated 4,480 in-process subscribe requests across 224 watched paths. The first swap left all 224 outgoing native watch resources active; they stopped only at service shutdown. The patched build released all 224 outgoing paths on each of three swaps. Equivalent consumers already share native watch resources; 4,480 is a count of JS subscribe requests, not a kernel watch count or a direct census of live JS objects. A smaller regression test counted active JS streams directly and found the old root, entrypoint and helper still subscribed before the fix.
Source: The path is present on dev at e1d864a24dec1507160e430597eae53487358c21. PluginModule.watch forks each source-file stream into the supervisor's scope and never removes its path from watched. watchConfiguredSources does the same for configured roots. The watcher shares an underlying resource but adds a PubSub subscription for each consuming stream.
Proposed fix: Track watch fibers by path. After reconciliation, stop the streams and drop the source records no longer needed by any active or recoverable failed local source. Keep shared helpers watched, and reconcile configured root watches separately so manifest edits still work. This also covers the stale-watch lifetime noted in #62894 for missing imports, without removing automatic recovery for a still-configured source. We can share the patch and regression test.
- Lingua principale
- TypeScript
- Stelle
- 230k
- Fork
- 31.3k
- Merge medio
- 5h 32m
- PR unite (30g)
- 453
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di anomalyco/opencode
-
area/desktop platform/macos status/repro-plausible type/bug version/v2
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
anomalyco/opencode#67064 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 82/100
anomalyco/opencode#67009 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
area/web type/feature version/v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
anomalyco/opencode#67001 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
skills: a Claude-compatible SKILL.md that fails to parse is dropped without any logForse già presa @liwenjie200543 l’ha presa 2 giorni fa. Apertaarea/plugins platform/linux reproduced type/bug version/v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
anomalyco/opencode#66970 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaksForse già presa @argszero l’ha presa 2 giorni fa. Apertaarea/tui platform/wsl status/repro-simulated type/bug version/v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
anomalyco/opencode#66773 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di anomalyco/opencode
Issue simili
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
EPPIcenter/sampledb3#162 ·
-
Particle-1 modelAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
tashfeenahmed/freellmapi#2169 ·
I maintainer di solito rispondono entro 1 giorno
-
via-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
🎙️ task - feat(mechanic): pave git.pull.close, a close of a superseded pull with its why on recordAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ehmpathy/rhachet-roles-ehmpathy#1576 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
vercel-labs/ui#1563 ·
I maintainer di solito rispondono entro 1 giorno