Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open Beginner friendly
#4,395 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@louisss1016 is already working on this.

Since Oct 26, 2026.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript

Research direction

The fix is in apps/vis/server/src/lib/context-projector.ts: do not set swarm active when rec.trigger === 'tool'. Add a legacy tool-trigger test and a user-triggered enter test in apps/vis/server/test/lib/context-projector.test.ts. Run those tests and vis typecheck; done when vis matches engine replay for unmatched tool-triggered enter records.

Written by the indexing model from the issue text.

Description

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

Dominant language
TypeScript
Stars
8k
Forks
1.3k
Avg merge
1d 1h
Merged PRs (30d)
130

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MoonshotAI/kimi-code

All issues in MoonshotAI/kimi-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.