Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Bug] vis reports legacy tool-triggered swarm sessions as active

Aperta Adatta ai principianti
#4,395 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

La fix è in apps/vis/server/src/lib/context-projector.ts: non impostare swarm active quando rec.trigger === 'tool'. Aggiungi un test legacy tool-trigger e un test user-triggered enter in apps/vis/server/test/lib/context-projector.test.ts. Esegui questi test e vis typecheck; fatto quando vis corrisponde a engine replay per unmatched tool-triggered enter records.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

The engine replay and foldWireRecordFacts now ignore a legacy unmatched swarm_mode.enter record whose trigger is tool, so an interrupted session written by an older version resumes with swarm mode off. The visual debugger has an independent projection path: apps/vis/server/src/lib/context-projector.ts still handles every swarm_mode.enter as swarm = { active: true, trigger: rec.trigger }, and ContextTab renders that state as a swarm mode pill.

The same persisted session can therefore be reported as swarm-off by the engine and transcript history, but swarm-on by vis until a later exit record appears.

Reproduction

  1. Open vis for an older wire containing swarm_mode.enter with trigger: 'tool' and no matching swarm_mode.exit.
  2. Open the Context tab.
  3. Observe that projectContext(...).swarm.active is true and the UI shows swarm mode, while engine replay and foldWireRecordFacts leave swarm mode off.

Expected: vis mirrors the engine and transcript behavior for this legacy record. Actual: only vis reports swarm mode as active.

Affected population and severity

This affects vis users inspecting sessions written by versions that allowed model-started swarms, specifically wires with an unmatched tool-triggered enter record. It does not change engine execution or the released CLI behavior, but it can mislead debugging by showing a mode that is not actually active.

Suggested fix and tests

  • In apps/vis/server/src/lib/context-projector.ts, do not activate swarm for swarm_mode.enter when rec.trigger === 'tool'; preserve the existing behavior for manual/task triggers and exit records.
  • Extend apps/vis/server/test/lib/context-projector.test.ts beside tracks swarm mode enter/exit with a legacy tool-trigger case that remains inactive, plus coverage that a subsequent user-triggered enter still activates swarm mode.
  • Run the vis server context-projector tests and vis typecheck.

Why this is separate from #4387

https://github.com/MoonshotAI/kimi-code/pull/4387 only back-syncs the already-released 2.3.2 hotfix. The vis projector and its test are unchanged between that PR's base and HEAD. Adding a new vis behavior fix to the back-sync would make main diverge from the released hotfix and expand its scope, so it is tracked here for a separate fix and release decision instead.


ticket: #813895

Lingua principale
TypeScript
Stelle
7.9k
Fork
1.3k
Merge medio
1g 7h
PR unite (30g)
96

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MoonshotAI/kimi-code

Tutte le issue di MoonshotAI/kimi-code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.