Server keeps watching old local plugin trees after a config path swap
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- backend
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 230k
- Forks
- 31.3k
- Merge medio
- 5 h 32 min
- PR fusionados (30 d)
- 453
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de anomalyco/opencode
-
area/desktop platform/macos status/repro-plausible type/bug version/v2
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
anomalyco/opencode#67064 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Medio día Aptitud para principiantes 82/100
anomalyco/opencode#67009 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
area/web type/feature version/v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
anomalyco/opencode#67001 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
skills: a Claude-compatible SKILL.md that fails to parse is dropped without any logPosiblemente ocupada @liwenjie200543 la tomó hace 2 días. Abiertoarea/plugins platform/linux reproduced type/bug version/v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
anomalyco/opencode#66970 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaksPosiblemente ocupada @argszero la tomó hace 2 días. Abiertoarea/tui platform/wsl status/repro-simulated type/bug version/v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
anomalyco/opencode#66773 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de anomalyco/opencode
Issues similares
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
EPPIcenter/sampledb3#162 ·
-
Particle-1 modelAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
tashfeenahmed/freellmapi#2169 ·
Los mantenedores suelen responder en 1 día
-
via-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
🎙️ task - feat(mechanic): pave git.pull.close, a close of a superseded pull with its why on recordAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ehmpathy/rhachet-roles-ehmpathy#1576 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
vercel-labs/ui#1563 ·
Los mantenedores suelen responder en 1 día