[PR #2244] [MERGED] Restore global agent enable controls #5506

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2244
Author: @cha1latte
Created: 6/4/2026
Status: ✅ Merged
Merged: 6/4/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-2166-agent-enabled-status


📝 Commits (4)

  • 9cb8a11 Restore global agent enable toggles
  • 118997c Align agent status fallback semantics
  • 21e48d7 Respect built-in agent enabled defaults
  • 34fab00 Keep immersive HTML enabled by default

📊 Changes

6 files changed (+121 additions, -7 deletions)

View changed files

📝 src/engine/contracts/types/agent.ts (+1 -1)
📝 src/engine/generation/agent-runner.ts (+2 -0)
📝 src/features/catalog/agents/components/AgentEditor.tsx (+42 -2)
📝 src/features/catalog/agents/components/AgentsPanel.tsx (+47 -2)
📝 src/features/catalog/agents/hooks/use-agents.ts (+15 -0)
📝 src/features/shell/discovery/discovery-entries.json (+14 -2)

📄 Description

Linked issue

Closes #2166

Why this change

  • The refactor removed the global enabled-state UI for agents. Users could not enable or disable built-in/custom agents from the Agents panel, the editor no longer exposed Agent Status, and saving an agent forced enabled: true.

What changed

  • Restored global enable/disable controls for built-in and custom agents in the Agents panel.
  • Restored an Agent Status control in the full agent editor and preserved enabled on save instead of hardcoding it to true.
  • Added a shared agentEnabledFlag helper plus a React Query mutation that writes explicit enabled state through the existing agent_patch_by_type command.
  • Made generation skip persisted agent rows with enabled: false, so global disable is enforced at runtime.
  • Updated the Discover Agents entry so searches for enabling/disabling agents still land on the right surface.

Refactor impact

Primary owner:

  • Catalog agents, engine generation, shell discovery

Impact areas reviewed:

  • Agents panel and editor UI
  • Shared agent API hook usage
  • Agent generation resolver behavior
  • Discover metadata for the Agents surface

Boundary notes:

  • Feature code still uses focused shared API wrappers/hooks; no raw Tauri imports were added to feature components.
  • Engine generation only reads persisted agent config state and does not import React, feature internals, or runtime adapters.
  • No Rust storage schema, command registration, dependency, auth, prompt assembly, import/export, or version files changed.

Pressure points touched:

  • Agent runtime resolution now respects enabled: false before an active chat agent can resolve.
  • Absent built-in config rows follow enabledByDefault; enabling them creates an explicit enabled: true row.
  • Existing chat-specific agent membership remains separate from global agent availability.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • pnpm exec vitest run --config scratch/vitest.issue2166.config.ts --reporter=verbose passed.
    • Confirms origin/refactor had no agent panel toggle, no editor Agent Status control, hardcoded enabled: true, and no runtime enabled guard.
    • Confirms the patched panel/editor source restores those controls and saves enabled: localEnabled.
    • Confirms an active Director agent with enabled: false does not run, while the same agent with enabled: true does run.
    • Confirms an absent built-in Director config remains disabled by the enabledByDefault contract.
  • node scratch/issue-2166-ui-proof.mjs passed against http://localhost:1420/.
    • Confirmed the Agents panel exposes agent enable controls.
    • Confirmed the Prose Guardian editor exposes Agent Status and disabled-state copy.
  • pnpm typecheck passed.
  • pnpm check passed after the final diff.
  • Tooling note: .agents/automation/scripts/workflow-health.mjs and C:/Users/celia/.codex/tools/marinara-proof-gate.mjs were not present in this checkout, so those optional local helpers could not be run.

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:

  • Updated the existing Agents discoverability entry to include global enable/disable wording and search keywords.

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

UI evidence

Agents panel:

Agents panel enable controls

Agent editor:

Agent editor status control

Summary by CodeRabbit

  • New Features
    • Agents can now be enabled/disabled individually with dedicated toggle controls throughout the interface
    • Agent Editor includes a new "Agent Status" field for managing activation
    • Agent cards in the panel display enable/disable toggle buttons for quick control
    • Immersive HTML agent is now enabled by default

🔄 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/2244 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2166-agent-enabled-status` --- ### 📝 Commits (4) - [`9cb8a11`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9cb8a1171d60bc9e9cb202a42ae70239ce84cce4) Restore global agent enable toggles - [`118997c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/118997c78916f83e81ed66a42bc407ff06c6cc62) Align agent status fallback semantics - [`21e48d7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/21e48d7e7ed876a8cd1e8b6b7b33d827f69bf11e) Respect built-in agent enabled defaults - [`34fab00`](https://github.com/Pasta-Devs/Marinara-Engine/commit/34fab00c1d159d3f089355de5d4f65e4ce24d1e4) Keep immersive HTML enabled by default ### 📊 Changes **6 files changed** (+121 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/engine/contracts/types/agent.ts` (+1 -1) 📝 `src/engine/generation/agent-runner.ts` (+2 -0) 📝 `src/features/catalog/agents/components/AgentEditor.tsx` (+42 -2) 📝 `src/features/catalog/agents/components/AgentsPanel.tsx` (+47 -2) 📝 `src/features/catalog/agents/hooks/use-agents.ts` (+15 -0) 📝 `src/features/shell/discovery/discovery-entries.json` (+14 -2) </details> ### 📄 Description ## Linked issue Closes #2166 ## Why this change - The refactor removed the global enabled-state UI for agents. Users could not enable or disable built-in/custom agents from the Agents panel, the editor no longer exposed Agent Status, and saving an agent forced `enabled: true`. ## What changed - Restored global enable/disable controls for built-in and custom agents in the Agents panel. - Restored an Agent Status control in the full agent editor and preserved `enabled` on save instead of hardcoding it to `true`. - Added a shared `agentEnabledFlag` helper plus a React Query mutation that writes explicit enabled state through the existing `agent_patch_by_type` command. - Made generation skip persisted agent rows with `enabled: false`, so global disable is enforced at runtime. - Updated the Discover Agents entry so searches for enabling/disabling agents still land on the right surface. ## Refactor impact Primary owner: - Catalog agents, engine generation, shell discovery Impact areas reviewed: - Agents panel and editor UI - Shared agent API hook usage - Agent generation resolver behavior - Discover metadata for the Agents surface Boundary notes: - Feature code still uses focused shared API wrappers/hooks; no raw Tauri imports were added to feature components. - Engine generation only reads persisted agent config state and does not import React, feature internals, or runtime adapters. - No Rust storage schema, command registration, dependency, auth, prompt assembly, import/export, or version files changed. Pressure points touched: - Agent runtime resolution now respects `enabled: false` before an active chat agent can resolve. - Absent built-in config rows follow `enabledByDefault`; enabling them creates an explicit `enabled: true` row. - Existing chat-specific agent membership remains separate from global agent availability. ## Validation - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `pnpm exec vitest run --config scratch/vitest.issue2166.config.ts --reporter=verbose` passed. - Confirms `origin/refactor` had no agent panel toggle, no editor Agent Status control, hardcoded `enabled: true`, and no runtime enabled guard. - Confirms the patched panel/editor source restores those controls and saves `enabled: localEnabled`. - Confirms an active Director agent with `enabled: false` does not run, while the same agent with `enabled: true` does run. - Confirms an absent built-in Director config remains disabled by the `enabledByDefault` contract. - `node scratch/issue-2166-ui-proof.mjs` passed against `http://localhost:1420/`. - Confirmed the Agents panel exposes agent enable controls. - Confirmed the Prose Guardian editor exposes Agent Status and disabled-state copy. - `pnpm typecheck` passed. - `pnpm check` passed after the final diff. - Tooling note: `.agents/automation/scripts/workflow-health.mjs` and `C:/Users/celia/.codex/tools/marinara-proof-gate.mjs` were not present in this checkout, so those optional local helpers could not be run. ## 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: - Updated the existing Agents discoverability entry to include global enable/disable wording and search keywords. ## 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 ## UI evidence Agents panel: ![Agents panel enable controls](https://gist.githubusercontent.com/cha1latte/f25fb10f61e7c71238f82a43d19d95ba/raw/995596c43df2df783bfc99639d59ad5fb12298d0/issue-2166-agents-panel-after.svg) Agent editor: ![Agent editor status control](https://gist.githubusercontent.com/cha1latte/f25fb10f61e7c71238f82a43d19d95ba/raw/4762b50d7383c47da06ed088de7d2d7a15f8fe8f/issue-2166-agent-editor-after.svg) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Agents can now be enabled/disabled individually with dedicated toggle controls throughout the interface * Agent Editor includes a new "Agent Status" field for managing activation * Agent cards in the panel display enable/disable toggle buttons for quick control * Immersive HTML agent is now enabled by default <!-- 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:16:55 +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#5506
No description provided.