[GH-ISSUE #3669] [Issue]: v2.3 migration re-enables agents disabled per chat #1980

Closed
opened 2026-10-21 05:44:21 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Xelvanis on GitHub (Jul 16, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3669

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The one-time legacy capability migration can turn a chat's Enable Agents master switch back on during the v2.3 upgrade. A chat that deliberately has enableAgents: false can therefore resume running its previously selected agents after the migration adds an extracted capability ID.

The enableAgents: true assignment appears intended to keep extracted Hierarchical Maps available, but it also reactivates every other ID already retained in activeAgentIds.

Expected behavior

Upgrading should preserve the chat's existing enableAgents value exactly. Package installation and capability availability should not change the user's per-chat decision to disable agent execution.

Non-pipeline capabilities such as Hierarchical Maps and Conversation games should use capability-specific installed/selected state rather than forcing the global agent master switch on.

Actual behavior

migrateLegacyChatCapabilitySelections() adds legacy capability IDs and, whenever the active ID set grows, writes:

{
  activeAgentIds: [...active],
  enableAgents: true,
}

For Roleplay, Game, and Visual Novel chats, adding hierarchical-maps therefore enables the master switch. Existing selected agents such as Illustrator, Narrative Director, trackers, or custom agents can run again on the next generation.

The behavior is also conditional: if the capability ID is already present, the function exits before changing enableAgents. That makes the preserved switch state depend on whether the migration happened to add an ID.

Steps to reproduce

  1. Start with pre-v2.3 user data containing a Roleplay chat whose metadata includes enableAgents: false and at least one selected agent in activeAgentIds, such as illustrator.
  2. Upgrade and run the first-start legacy capability migration.
  3. Observe that the migration adds hierarchical-maps to activeAgentIds.
  4. Reload the chat and inspect its metadata or Chat Settings → Agents.
  5. Observe that Enable Agents is now on and the previously selected agent is eligible to run again.

Minimal state transition:

Before:
enableAgents: false
activeAgentIds: ["illustrator"]

After migration:
enableAgents: true
activeAgentIds: ["illustrator", "hierarchical-maps"]

Environment

  • Marinara Engine version: 2.3.1 (staging at 77f9f2a61e3647cad9f41399430648a00a735210)
  • Install type: source; the migration logic is install-type independent
  • OS + version: platform independent
  • Browser or app shell: not applicable; server-side startup migration

Logs, screenshots, or video

No log error is produced. The migration reports only the number of chats updated.

Relevant implementation:

Additional context

This was introduced by commit 5610c23f in PR #3613.

The stated compatibility contract points in the opposite direction:

  • Issue #3612 requires existing users to retain prior agents/features and preserve custom agents.
  • PR #3613 says existing chat selections and settings are preserved.
  • docs/development/optional-agent-packages.md says existing per-chat configuration remains in place.
  • docs/agents/agents-overview.md defines Enable Agents as the master switch and says no agent runs while it is off.

Conversation games already derive availability from installed capability packages without using enableAgents, so forcing the master switch is not needed for that migration branch. Hierarchical Maps currently uses both the capability ID and master switch, which appears to be the coupling that led to this side effect.

Suggested correction:

  1. Preserve an existing boolean enableAgents value unchanged during migration.
  2. Separate non-pipeline capability availability/selection from the agent execution master switch.
  3. Add a migration regression covering enableAgents: false with retained built-in and custom agent IDs.

Impact: an upgrade can silently resume paid model calls and agent side effects that the user explicitly disabled.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (Jul 16, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3669 Originally assigned to: @SpicyMarinara on GitHub. ## Summary The one-time legacy capability migration can turn a chat's **Enable Agents** master switch back on during the v2.3 upgrade. A chat that deliberately has `enableAgents: false` can therefore resume running its previously selected agents after the migration adds an extracted capability ID. The `enableAgents: true` assignment appears intended to keep extracted Hierarchical Maps available, but it also reactivates every other ID already retained in `activeAgentIds`. ## Expected behavior Upgrading should preserve the chat's existing `enableAgents` value exactly. Package installation and capability availability should not change the user's per-chat decision to disable agent execution. Non-pipeline capabilities such as Hierarchical Maps and Conversation games should use capability-specific installed/selected state rather than forcing the global agent master switch on. ## Actual behavior `migrateLegacyChatCapabilitySelections()` adds legacy capability IDs and, whenever the active ID set grows, writes: ```ts { activeAgentIds: [...active], enableAgents: true, } ``` For Roleplay, Game, and Visual Novel chats, adding `hierarchical-maps` therefore enables the master switch. Existing selected agents such as Illustrator, Narrative Director, trackers, or custom agents can run again on the next generation. The behavior is also conditional: if the capability ID is already present, the function exits before changing `enableAgents`. That makes the preserved switch state depend on whether the migration happened to add an ID. ## Steps to reproduce 1. Start with pre-v2.3 user data containing a Roleplay chat whose metadata includes `enableAgents: false` and at least one selected agent in `activeAgentIds`, such as `illustrator`. 2. Upgrade and run the first-start legacy capability migration. 3. Observe that the migration adds `hierarchical-maps` to `activeAgentIds`. 4. Reload the chat and inspect its metadata or **Chat Settings → Agents**. 5. Observe that **Enable Agents** is now on and the previously selected agent is eligible to run again. Minimal state transition: ```text Before: enableAgents: false activeAgentIds: ["illustrator"] After migration: enableAgents: true activeAgentIds: ["illustrator", "hierarchical-maps"] ``` ## Environment - Marinara Engine version: 2.3.1 (`staging` at `77f9f2a61e3647cad9f41399430648a00a735210`) - Install type: source; the migration logic is install-type independent - OS + version: platform independent - Browser or app shell: not applicable; server-side startup migration ## Logs, screenshots, or video No log error is produced. The migration reports only the number of chats updated. Relevant implementation: - [`legacy-capability-chat-migration.ts`](https://github.com/Pasta-Devs/Marinara-Engine/blob/77f9f2a61e3647cad9f41399430648a00a735210/packages/server/src/services/capability-packages/legacy-capability-chat-migration.ts#L25-L54) - [`app.ts` migration caller](https://github.com/Pasta-Devs/Marinara-Engine/blob/77f9f2a61e3647cad9f41399430648a00a735210/packages/server/src/app.ts#L102-L142) - [`GameSurface.tsx` Maps gate](https://github.com/Pasta-Devs/Marinara-Engine/blob/77f9f2a61e3647cad9f41399430648a00a735210/packages/client/src/components/game/GameSurface.tsx#L2364-L2370) ## Additional context This was introduced by commit [`5610c23f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5610c23f9031fbbdcb73a09182cfa266a70ff3f9) in PR #3613. The stated compatibility contract points in the opposite direction: - Issue #3612 requires existing users to retain prior agents/features and preserve custom agents. - PR #3613 says existing chat selections and settings are preserved. - `docs/development/optional-agent-packages.md` says existing per-chat configuration remains in place. - `docs/agents/agents-overview.md` defines **Enable Agents** as the master switch and says no agent runs while it is off. Conversation games already derive availability from installed capability packages without using `enableAgents`, so forcing the master switch is not needed for that migration branch. Hierarchical Maps currently uses both the capability ID and master switch, which appears to be the coupling that led to this side effect. Suggested correction: 1. Preserve an existing boolean `enableAgents` value unchanged during migration. 2. Separate non-pipeline capability availability/selection from the agent execution master switch. 3. Add a migration regression covering `enableAgents: false` with retained built-in and custom agent IDs. Impact: an upgrade can silently resume paid model calls and agent side effects that the user explicitly disabled. ## Template check - [ ] I DID NOT read this template and provide the requested details.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 16, 2026):

Resolved in #3678: legacy capability selection migration now preserves the existing Enable Agents master switch while keeping selected Hierarchical Maps available. Migration regressions and the full validation suite pass.

<!-- gh-comment-id:4990211941 --> @SpicyMarinara commented on GitHub (Jul 16, 2026): Resolved in #3678: legacy capability selection migration now preserves the existing Enable Agents master switch while keeping selected Hierarchical Maps available. Migration regressions and the full validation suite pass.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1980
No description provided.