[PR #1803] [MERGED] Fix agent enabled state #5281

Closed
opened 2026-10-22 04:14:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1803
Author: @Xelvanis
Created: 6/1/2026
Status: ✅ Merged
Merged: 6/1/2026
Merged by: @Xelvanis

Base: refactor ← Head: issue-1791-agent-enabled-state


📝 Commits (5)

  • 354b63e Fix agent enabled state
  • fd34382 Address agent review feedback
  • 05adac5 Merge refactor into agent enabled state
  • 3700c09 Merge remote-tracking branch 'origin/refactor' into issue-1791-agent-enabled-state
  • 52299c0 Fix sprite validation export

📊 Changes

10 files changed (+309 additions, -71 deletions)

View changed files

📝 src/engine/generation/agent-runner.ts (+12 -2)
📝 src/engine/generation/sprite-expression-validation.ts (+1 -1)
📝 src/features/catalog/agents/components/AgentEditor.test.tsx (+13 -1)
📝 src/features/catalog/agents/components/AgentEditor.tsx (+45 -2)
📝 src/features/catalog/agents/components/AgentsPanel.tsx (+198 -50)
📝 src/features/catalog/agents/hooks/use-agents.ts (+14 -5)
📝 src/features/modes/roleplay/components/RoleplayHUD.tsx (+3 -3)
📝 src/features/modes/roleplay/components/RoleplayHUDActionsMenu.tsx (+8 -2)
📝 src/features/modes/roleplay/components/RoleplayModeRoute.tsx (+12 -2)
📝 src/features/modes/shared/chat-ui/components/EchoChamberPanel.tsx (+3 -3)

📄 Description

Linked issue

Closes #1791

Why this change

  • Agent enabled/disabled state was not preserved consistently after the refactor. The editor saved agents as enabled, the Agents panel did not expose or toggle the stored state, and some runtime paths could still run configured agents that had been disabled.

What changed

  • Added shared agent enabled-state normalization for boolean, numeric, and legacy string values.
  • Preserved enabled state in the Agent Editor and added an Agent Status control.
  • Surfaced enabled/disabled badges and toggles in the Agents panel for built-in and custom agents.
  • Filtered disabled agents in roleplay HUD/action UI, Echo Chamber visibility, and engine generation resolution so disabled configured agents do not run through global, scoped, or explicitly requested paths.

Refactor impact

Primary owner:

Catalog agents, shared mode UI, roleplay mode, and engine generation.

Impact areas reviewed:

  • Agent config storage shape and React Query hooks.
  • Agent editor save payloads.
  • Agents panel category/status views and built-in fallback config creation.
  • Roleplay HUD actions and per-chat active agent filtering.
  • Echo Chamber global enable fallback.
  • Engine agent resolution for requested, scoped, global, and built-in fallback agents.

Boundary notes:

  • React UI changes stay in src/features.
  • Runtime execution filtering stays in src/engine/generation.
  • No new raw Tauri invokes, remote runtime fetches, Rust commands, or cross-layer imports were added.

Pressure points touched:

  • Shared mode UI: EchoChamberPanel.
  • Roleplay mode route/HUD action surfaces.
  • Engine generation agent resolution.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • pnpm check passes locally before PR push/handoff, including the unused-code check
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Browser screenshot/recording evidence added when UI/browser state is the claim
  • Remote runtime smoke checked when relevant

Manual verification notes

  • pnpm typecheck passed.
  • Targeted eslint passed for the touched agent, roleplay HUD/action, Echo Chamber, and engine generation files.
  • pnpm exec vitest run src/features/catalog/agents/components/AgentEditor.test.tsx src/features/catalog/agents/components/AgentsPanel.test.tsx passed.
  • git diff --check passed.
  • pnpm check passed, including line endings, architecture, TypeScript, Rust workspace check, docs, discovery metadata, and unused-code checks.
  • Native Tauri QA passed with pnpm tauri dev --no-watch --config scratch\tauri-qa.config.json: Agents panel rendered status badges, Continuity Checker disabled/re-enabled from the panel, editor opened with Agent Status = Disabled, editor save restored Enabled, and By Status grouped the disabled row with an Enable agent control.
  • Live-provider native QA passed with LM Studio Gemma 4: the app selected QA LM Studio Gemma 4 for a fresh Conversation chat, sent through the native composer, and rendered a model response containing LIVE_PROVIDER_QA_PASS and LIVE_PROVIDER_QA_PASS_2.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • N/A: this restores and wires existing agent enabled/disabled behavior rather than adding a new discoverable feature.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

No docs changes needed: this is a focused bugfix for existing agent configuration behavior and does not change contributor workflow, setup, architecture docs, or public release claims.

UI evidence

  • Native Tauri screenshots were captured locally during QA for the Agents panel/editor/status-tab and live LM Studio response paths.

Summary by CodeRabbit

  • New Features

    • Agents can now be enabled and disabled through the UI.
    • Added Agent Status section in the agent editor to toggle individual agent enablement.
    • Agent enable/disable settings are now persisted and respected across the application.
  • Bug Fixes

    • Improved agent configuration handling for consistent enabled/disabled state interpretation.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1803 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/1/2026 **Status:** ✅ Merged **Merged:** 6/1/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `issue-1791-agent-enabled-state` --- ### 📝 Commits (5) - [`354b63e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/354b63e6c092193cf453b394d9daaf314ac681c3) Fix agent enabled state - [`fd34382`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fd34382efbd4421eee1bf026f1b72da2e073645b) Address agent review feedback - [`05adac5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/05adac51c86c5529f011a2a5605fbab8f1475b4b) Merge refactor into agent enabled state - [`3700c09`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3700c091bbde0571a1a87e6fe242c8a21f99d8cd) Merge remote-tracking branch 'origin/refactor' into issue-1791-agent-enabled-state - [`52299c0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/52299c07b79f260283eae9c10c9bbb4c9152540c) Fix sprite validation export ### 📊 Changes **10 files changed** (+309 additions, -71 deletions) <details> <summary>View changed files</summary> 📝 `src/engine/generation/agent-runner.ts` (+12 -2) 📝 `src/engine/generation/sprite-expression-validation.ts` (+1 -1) 📝 `src/features/catalog/agents/components/AgentEditor.test.tsx` (+13 -1) 📝 `src/features/catalog/agents/components/AgentEditor.tsx` (+45 -2) 📝 `src/features/catalog/agents/components/AgentsPanel.tsx` (+198 -50) 📝 `src/features/catalog/agents/hooks/use-agents.ts` (+14 -5) 📝 `src/features/modes/roleplay/components/RoleplayHUD.tsx` (+3 -3) 📝 `src/features/modes/roleplay/components/RoleplayHUDActionsMenu.tsx` (+8 -2) 📝 `src/features/modes/roleplay/components/RoleplayModeRoute.tsx` (+12 -2) 📝 `src/features/modes/shared/chat-ui/components/EchoChamberPanel.tsx` (+3 -3) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #1791 ## Why this change - Agent enabled/disabled state was not preserved consistently after the refactor. The editor saved agents as enabled, the Agents panel did not expose or toggle the stored state, and some runtime paths could still run configured agents that had been disabled. ## What changed - Added shared agent enabled-state normalization for boolean, numeric, and legacy string values. - Preserved enabled state in the Agent Editor and added an Agent Status control. - Surfaced enabled/disabled badges and toggles in the Agents panel for built-in and custom agents. - Filtered disabled agents in roleplay HUD/action UI, Echo Chamber visibility, and engine generation resolution so disabled configured agents do not run through global, scoped, or explicitly requested paths. ## Refactor impact Primary owner: Catalog agents, shared mode UI, roleplay mode, and engine generation. Impact areas reviewed: - Agent config storage shape and React Query hooks. - Agent editor save payloads. - Agents panel category/status views and built-in fallback config creation. - Roleplay HUD actions and per-chat active agent filtering. - Echo Chamber global enable fallback. - Engine agent resolution for requested, scoped, global, and built-in fallback agents. Boundary notes: - React UI changes stay in `src/features`. - Runtime execution filtering stays in `src/engine/generation`. - No new raw Tauri invokes, remote runtime fetches, Rust commands, or cross-layer imports were added. Pressure points touched: - Shared mode UI: `EchoChamberPanel`. - Roleplay mode route/HUD action surfaces. - Engine generation agent resolution. ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> <!-- Do not submit *.test.ts or *.test.tsx files as PR proof; cite existing checks, command output, app/browser/Tauri verification, or manual notes instead. --> - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] `pnpm check` passes locally before PR push/handoff, including the unused-code check - [x] `pnpm typecheck` passes locally - [x] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Browser screenshot/recording evidence added when UI/browser state is the claim - [ ] Remote runtime smoke checked when relevant ### Manual verification notes - `pnpm typecheck` passed. - Targeted eslint passed for the touched agent, roleplay HUD/action, Echo Chamber, and engine generation files. - `pnpm exec vitest run src/features/catalog/agents/components/AgentEditor.test.tsx src/features/catalog/agents/components/AgentsPanel.test.tsx` passed. - `git diff --check` passed. - `pnpm check` passed, including line endings, architecture, TypeScript, Rust workspace check, docs, discovery metadata, and unused-code checks. - Native Tauri QA passed with `pnpm tauri dev --no-watch --config scratch\tauri-qa.config.json`: Agents panel rendered status badges, Continuity Checker disabled/re-enabled from the panel, editor opened with Agent Status = Disabled, editor save restored Enabled, and By Status grouped the disabled row with an Enable agent control. - Live-provider native QA passed with LM Studio Gemma 4: the app selected `QA LM Studio Gemma 4` for a fresh Conversation chat, sent through the native composer, and rendered a model response containing `LIVE_PROVIDER_QA_PASS` and `LIVE_PROVIDER_QA_PASS_2`. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - N/A: this restores and wires existing agent enabled/disabled behavior rather than adding a new discoverable feature. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims No docs changes needed: this is a focused bugfix for existing agent configuration behavior and does not change contributor workflow, setup, architecture docs, or public release claims. ## UI evidence - Native Tauri screenshots were captured locally during QA for the Agents panel/editor/status-tab and live LM Studio response paths. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Agents can now be enabled and disabled through the UI. * Added Agent Status section in the agent editor to toggle individual agent enablement. * Agent enable/disable settings are now persisted and respected across the application. * **Bug Fixes** * Improved agent configuration handling for consistent enabled/disabled state interpretation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:14:54 +07:00
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#5281
No description provided.