[GH-ISSUE #1791] [Issue]: Agents parity regressions after refactor #873

Closed
opened 2026-10-21 05:22:43 +07:00 by bsakaguchi · 3 comments
Owner

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

Originally assigned to: @Xelvanis on GitHub.

Summary

Static legacy parity audit found multiple agents feature regressions in the refactor branch. The biggest gaps are disabled agent state being lost, Knowledge Retrieval/Router active-lorebook source control being removed from the editor, and script custom tools being executable through the TypeScript runtime despite legacy having an explicit script-execution safety gate.

Expected behavior

Agents parity should preserve legacy user-visible controls and safety semantics:

  • Agent enabled/disabled state should be visible, editable, and preserved on save.
  • Knowledge Retrieval and Router agents should allow users to opt in/out of chat active lorebooks via useChatActiveLorebooks.
  • Script custom tools should respect an explicit capability/env gate before creation, update, or execution.
  • Imported legacy agent runs should remain visible with the metadata the UI needs.
  • Cadence status should match the runtime's successful-run semantics.

Actual behavior

The refactor appears to lose or weaken those behaviors:

  • AgentEditor saves enabled: true unconditionally, and AgentsPanel discards the enabled value instead of exposing a toggle/status.
  • The runtime still honors useChatActiveLorebooks === false, but the editor no longer loads/saves that setting for Knowledge Retrieval/Router sources.
  • custom_tool_execute rejects script tools in Rust, but the TypeScript generation runtime executes script custom tools with new Function and no equivalent capability/env gate.
  • Legacy agent_runs imports may lose joined agentType/agentName metadata, while the custom-run UI filters out runs without agentType.
  • agent_cadence_status uses weaker defaults and filtering than the runtime/legacy successful-run path, so status can drift after failures or missing config.

Steps to reproduce

  1. Compare the refactor agents editor, panel, runtime, custom tool execution, and storage paths against the legacy agents implementation.
  2. For disabled agents, inspect a config where enabled: false should be preserved, then save through the refactor editor path.
  3. For Knowledge Retrieval/Router, inspect a config with settings.sources.useChatActiveLorebooks: false, then save through the refactor editor path.
  4. For script tools, compare refactor TypeScript runtime execution against the Rust custom_tool_execute command and the legacy env-gated script path.
  5. For imported runs, import legacy agent_runs rows and confirm whether custom-agent run history/status remains visible when rows lack denormalized agentType/agentName.
  6. For cadence, compare agent_cadence_status output after failed and successful runs against runtime gating and legacy getLastSuccessfulRunByType behavior.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor branch parity target; audit performed from a local branch based on origin/refactor
  • Run mode: static code comparison only; no Tauri desktop or runtime execution performed
  • OS + version: not exercised
  • Node + pnpm versions: not exercised
  • Rust version, if relevant: not exercised
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

No screenshots or runtime logs. Static evidence from code inspection:

  • Refactor built-in agent IDs and agent executor result-type maps match legacy: no missing built-ins found in that pass.
  • Enabled-state regression:
    • src/features/catalog/agents/components/AgentEditor.tsx saves enabled: true unconditionally.
    • src/features/catalog/agents/components/AgentsPanel.tsx discards enabled and has no enable/disable toggle.
    • Legacy editor/panel had localAgentEnabled, saved it, and exposed status/toggles.
  • Knowledge source regression:
    • src/engine/generation/agent-runner.ts still honors useChatActiveLorebooks === false.
    • src/features/catalog/agents/components/AgentEditor.tsx loads/saves source lorebook IDs but not useChatActiveLorebooks.
    • Legacy editor had state, defaulting, save, and UI for the setting.
  • Script custom tool safety gap:
    • Legacy routes rejected script tool create/update when CUSTOM_TOOL_SCRIPT_ENABLED was false, and legacy executor refused script execution when disabled.
    • Refactor Rust reports scriptExecutionEnabled: true while custom_tool_execute rejects script tools.
    • Refactor TypeScript generation runtime executes script custom tools directly with new Function without the legacy env/capability gate.
  • Legacy run import/status gap:
    • Refactor profile import maps agent_runs directly to agent-runs.
    • Legacy schema stores agentConfigId; legacy storage joined config data to expose agentType/agentName.
    • Refactor custom-run UI filters out runs without agentType, so raw imported rows may disappear.
  • Cadence status gap:
    • Refactor agent_cadence_status uses a default interval and filters error state differently from the runtime and legacy successful-run storage query.
    • The TypeScript runtime path appears stricter than the UI/status command, so this looks like status/UI drift rather than core runtime gating drift.

Regression notes

This is a legacy parity regression cluster for the agents feature. Legacy behavior preserved agent enable/disable state, exposed Knowledge Retrieval/Router active-lorebook source control, gated script custom tools through CUSTOM_TOOL_SCRIPT_ENABLED, and joined custom agent run rows with config metadata for display/status.

Additional context

Recommended repair order:

  1. Restore or deliberately retire agent enabled/disabled semantics; if retiring, migrate/preserve existing disabled configs intentionally.
  2. Re-add useChatActiveLorebooks editor state/UI/persistence for Knowledge Retrieval and Router agents.
  3. Re-gate script custom tools behind an explicit capability/env setting across UI, Rust command, and TypeScript runtime execution.
  4. Add a legacy profile fixture for agent_runs; denormalize agentType/agentName during import if needed.
  5. Align agent_cadence_status with runtime/legacy successful-run filtering and built-in interval defaults.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (Jun 1, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1791 Originally assigned to: @Xelvanis on GitHub. ## Summary Static legacy parity audit found multiple agents feature regressions in the refactor branch. The biggest gaps are disabled agent state being lost, Knowledge Retrieval/Router active-lorebook source control being removed from the editor, and script custom tools being executable through the TypeScript runtime despite legacy having an explicit script-execution safety gate. ## Expected behavior Agents parity should preserve legacy user-visible controls and safety semantics: - Agent enabled/disabled state should be visible, editable, and preserved on save. - Knowledge Retrieval and Router agents should allow users to opt in/out of chat active lorebooks via `useChatActiveLorebooks`. - Script custom tools should respect an explicit capability/env gate before creation, update, or execution. - Imported legacy agent runs should remain visible with the metadata the UI needs. - Cadence status should match the runtime's successful-run semantics. ## Actual behavior The refactor appears to lose or weaken those behaviors: - `AgentEditor` saves `enabled: true` unconditionally, and `AgentsPanel` discards the `enabled` value instead of exposing a toggle/status. - The runtime still honors `useChatActiveLorebooks === false`, but the editor no longer loads/saves that setting for Knowledge Retrieval/Router sources. - `custom_tool_execute` rejects script tools in Rust, but the TypeScript generation runtime executes script custom tools with `new Function` and no equivalent capability/env gate. - Legacy `agent_runs` imports may lose joined `agentType`/`agentName` metadata, while the custom-run UI filters out runs without `agentType`. - `agent_cadence_status` uses weaker defaults and filtering than the runtime/legacy successful-run path, so status can drift after failures or missing config. ## Steps to reproduce 1. Compare the refactor agents editor, panel, runtime, custom tool execution, and storage paths against the legacy agents implementation. 2. For disabled agents, inspect a config where `enabled: false` should be preserved, then save through the refactor editor path. 3. For Knowledge Retrieval/Router, inspect a config with `settings.sources.useChatActiveLorebooks: false`, then save through the refactor editor path. 4. For script tools, compare refactor TypeScript runtime execution against the Rust `custom_tool_execute` command and the legacy env-gated script path. 5. For imported runs, import legacy `agent_runs` rows and confirm whether custom-agent run history/status remains visible when rows lack denormalized `agentType`/`agentName`. 6. For cadence, compare `agent_cadence_status` output after failed and successful runs against runtime gating and legacy `getLastSuccessfulRunByType` behavior. ## Impact area <!-- Check the areas you think are relevant. Leave uncertain items unchecked. --> - [ ] App shell, navigation, startup, or providers - [x] Catalog resources - [ ] Chat mode - [x] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [x] React-free engine behavior, contracts, agents, or capability ports - [x] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: refactor branch parity target; audit performed from a local branch based on `origin/refactor` - Run mode: static code comparison only; no Tauri desktop or runtime execution performed - OS + version: not exercised - Node + pnpm versions: not exercised - Rust version, if relevant: not exercised - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video No screenshots or runtime logs. Static evidence from code inspection: - Refactor built-in agent IDs and agent executor result-type maps match legacy: no missing built-ins found in that pass. - Enabled-state regression: - `src/features/catalog/agents/components/AgentEditor.tsx` saves `enabled: true` unconditionally. - `src/features/catalog/agents/components/AgentsPanel.tsx` discards `enabled` and has no enable/disable toggle. - Legacy editor/panel had `localAgentEnabled`, saved it, and exposed status/toggles. - Knowledge source regression: - `src/engine/generation/agent-runner.ts` still honors `useChatActiveLorebooks === false`. - `src/features/catalog/agents/components/AgentEditor.tsx` loads/saves source lorebook IDs but not `useChatActiveLorebooks`. - Legacy editor had state, defaulting, save, and UI for the setting. - Script custom tool safety gap: - Legacy routes rejected script tool create/update when `CUSTOM_TOOL_SCRIPT_ENABLED` was false, and legacy executor refused script execution when disabled. - Refactor Rust reports `scriptExecutionEnabled: true` while `custom_tool_execute` rejects script tools. - Refactor TypeScript generation runtime executes script custom tools directly with `new Function` without the legacy env/capability gate. - Legacy run import/status gap: - Refactor profile import maps `agent_runs` directly to `agent-runs`. - Legacy schema stores `agentConfigId`; legacy storage joined config data to expose `agentType`/`agentName`. - Refactor custom-run UI filters out runs without `agentType`, so raw imported rows may disappear. - Cadence status gap: - Refactor `agent_cadence_status` uses a default interval and filters error state differently from the runtime and legacy successful-run storage query. - The TypeScript runtime path appears stricter than the UI/status command, so this looks like status/UI drift rather than core runtime gating drift. ## Regression notes This is a legacy parity regression cluster for the agents feature. Legacy behavior preserved agent enable/disable state, exposed Knowledge Retrieval/Router active-lorebook source control, gated script custom tools through `CUSTOM_TOOL_SCRIPT_ENABLED`, and joined custom agent run rows with config metadata for display/status. ## Additional context Recommended repair order: 1. Restore or deliberately retire agent enabled/disabled semantics; if retiring, migrate/preserve existing disabled configs intentionally. 2. Re-add `useChatActiveLorebooks` editor state/UI/persistence for Knowledge Retrieval and Router agents. 3. Re-gate script custom tools behind an explicit capability/env setting across UI, Rust command, and TypeScript runtime execution. 4. Add a legacy profile fixture for `agent_runs`; denormalize `agentType`/`agentName` during import if needed. 5. Align `agent_cadence_status` with runtime/legacy successful-run filtering and built-in interval defaults. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:22:43 +07:00
Author
Owner

@Xelvanis commented on GitHub (Jun 1, 2026):

Progress update: PR #1803 is open for this issue: https://github.com/Pasta-Devs/Marinara-Engine/pull/1803

Implemented and pushed:

  • Agent enabled/disabled state is preserved in the editor and surfaced in the Agents panel.
  • Disabled agents are filtered from roleplay HUD/action UI, Echo Chamber visibility, and generation resolution paths.
  • Reviewer feedback was addressed, including accessible toggle labels and status-row memoization.
  • Merge conflicts against the latest refactor branch were resolved and the branch was updated.

Validation completed:

  • pnpm check passes locally.
  • Targeted agent Vitest coverage passes: 4 files, 17 tests.
  • Native Tauri QA passed for the Agents panel/editor/status flow.
  • Live-provider native QA passed with LM Studio Gemma 4.
  • GitHub CI is passing for Frontend/Architecture/Organization, Rust Capability Layer, Browser Smoke and Performance, Auto-label, and CodeRabbit.

Remaining work: maintainer review and merge of PR #1803.

<!-- gh-comment-id:4592038747 --> @Xelvanis commented on GitHub (Jun 1, 2026): Progress update: PR #1803 is open for this issue: https://github.com/Pasta-Devs/Marinara-Engine/pull/1803 Implemented and pushed: - Agent enabled/disabled state is preserved in the editor and surfaced in the Agents panel. - Disabled agents are filtered from roleplay HUD/action UI, Echo Chamber visibility, and generation resolution paths. - Reviewer feedback was addressed, including accessible toggle labels and status-row memoization. - Merge conflicts against the latest `refactor` branch were resolved and the branch was updated. Validation completed: - `pnpm check` passes locally. - Targeted agent Vitest coverage passes: 4 files, 17 tests. - Native Tauri QA passed for the Agents panel/editor/status flow. - Live-provider native QA passed with LM Studio Gemma 4. - GitHub CI is passing for Frontend/Architecture/Organization, Rust Capability Layer, Browser Smoke and Performance, Auto-label, and CodeRabbit. Remaining work: maintainer review and merge of PR #1803.
Author
Owner

@Xelvanis commented on GitHub (Jun 1, 2026):

Progress update: PR #1813 has merged for this issue: https://github.com/Pasta-Devs/Marinara-Engine/pull/1813

Implemented and merged in this slice:

  • Script custom tools are no longer created/updated as a supported execution type in the refactor custom-tool schema/UI.
  • The TypeScript generation runtime no longer loads script custom-tool rows or executes them with new Function.
  • Native custom_tool_capabilities now reports scriptExecutionEnabled: false.
  • Legacy/imported script custom-tool rows still get an actionable native rejection telling the user to convert to Webhook or Static.
  • The Tool Editor shows a conversion warning for legacy script rows.

Validation completed:

  • pnpm check passes locally.
  • cargo test --manifest-path src-tauri/Cargo.toml custom_tools --lib passes locally.
  • PR CI passed for Frontend/Architecture/Organization, Rust Capability Layer, Browser Smoke and Performance, Auto-label, and CodeRabbit.

Issue #1791 status after current merged slices:

  • Agent enabled/disabled state was covered by merged PR #1803.
  • Knowledge Retrieval/Router active-lorebook source controls are already present on current refactor.
  • Script custom-tool safety gate is covered by merged PR #1813.

Remaining work:

  • Legacy agent_runs import/display metadata parity: imported custom-agent runs may still need agentType/agentName normalization so run history/status remains visible.
  • agent_cadence_status parity: align status behavior with runtime/legacy successful-run semantics after failures or missing config.
<!-- gh-comment-id:4593238254 --> @Xelvanis commented on GitHub (Jun 1, 2026): Progress update: PR #1813 has merged for this issue: https://github.com/Pasta-Devs/Marinara-Engine/pull/1813 Implemented and merged in this slice: - Script custom tools are no longer created/updated as a supported execution type in the refactor custom-tool schema/UI. - The TypeScript generation runtime no longer loads script custom-tool rows or executes them with `new Function`. - Native `custom_tool_capabilities` now reports `scriptExecutionEnabled: false`. - Legacy/imported script custom-tool rows still get an actionable native rejection telling the user to convert to Webhook or Static. - The Tool Editor shows a conversion warning for legacy script rows. Validation completed: - `pnpm check` passes locally. - `cargo test --manifest-path src-tauri/Cargo.toml custom_tools --lib` passes locally. - PR CI passed for Frontend/Architecture/Organization, Rust Capability Layer, Browser Smoke and Performance, Auto-label, and CodeRabbit. Issue #1791 status after current merged slices: - Agent enabled/disabled state was covered by merged PR #1803. - Knowledge Retrieval/Router active-lorebook source controls are already present on current `refactor`. - Script custom-tool safety gate is covered by merged PR #1813. Remaining work: - Legacy `agent_runs` import/display metadata parity: imported custom-agent runs may still need `agentType`/`agentName` normalization so run history/status remains visible. - `agent_cadence_status` parity: align status behavior with runtime/legacy successful-run semantics after failures or missing config.
Author
Owner

@Xelvanis commented on GitHub (Jun 1, 2026):

Progress update: PR #1818 has merged for this issue: https://github.com/Pasta-Devs/Marinara-Engine/pull/1818

Implemented and merged in this slice:

  • Legacy/imported agent_runs rows now normalize legacy snake_case fields into the camelCase fields the refactor UI reads.
  • Imported custom-agent runs now recover config-backed agentType/agentName metadata so run history and cadence status stay visible after legacy import.
  • Legacy created_at only promotes when it is a valid non-empty RFC3339 timestamp, and valid legacy timestamps are canonicalized to UTC.
  • Cadence status now matches the runtime/legacy successful-run semantics and built-in interval defaults covered by this PR.
  • Custom-agent run and Echo Chamber consumers now prefer current camelCase data, avoid treating result type as agent type, and avoid merging idless rows by JSON-string dedupe.

Validation completed:

  • cargo test --manifest-path src-tauri/Cargo.toml legacy_agent_runs_import_with_config_metadata --lib passes locally.
  • cargo test --manifest-path src-tauri/Cargo.toml app_state_startup_normalizes_legacy_agent_run_rows --lib passes locally.
  • cargo test --manifest-path src-tauri/Cargo.toml cadence_status --lib passes locally.
  • pnpm typecheck passes locally.
  • cargo check --manifest-path src-tauri/Cargo.toml passes locally.
  • pnpm check:architecture passes locally.
  • pnpm check passes locally.
  • PR CI passed for Frontend/Architecture/Organization, Rust Capability Layer, Browser Smoke and Performance, Auto-label, and CodeRabbit.

Issue #1791 status after merged slices:

  • Agent enabled/disabled state was covered by merged PR #1803.
  • Knowledge Retrieval/Router active-lorebook source controls are already present on current refactor.
  • Script custom-tool safety gate was covered by merged PR #1813.
  • Legacy agent_runs import/display metadata was covered by merged PR #1818.
  • agent_cadence_status parity was covered by merged PR #1818.

Remaining work: no known open items from the current issue checklist. This issue looks ready to close if maintainers agree.

<!-- gh-comment-id:4594031841 --> @Xelvanis commented on GitHub (Jun 1, 2026): Progress update: PR #1818 has merged for this issue: https://github.com/Pasta-Devs/Marinara-Engine/pull/1818 Implemented and merged in this slice: - Legacy/imported `agent_runs` rows now normalize legacy snake_case fields into the camelCase fields the refactor UI reads. - Imported custom-agent runs now recover config-backed `agentType`/`agentName` metadata so run history and cadence status stay visible after legacy import. - Legacy `created_at` only promotes when it is a valid non-empty RFC3339 timestamp, and valid legacy timestamps are canonicalized to UTC. - Cadence status now matches the runtime/legacy successful-run semantics and built-in interval defaults covered by this PR. - Custom-agent run and Echo Chamber consumers now prefer current camelCase data, avoid treating result `type` as agent type, and avoid merging idless rows by JSON-string dedupe. Validation completed: - `cargo test --manifest-path src-tauri/Cargo.toml legacy_agent_runs_import_with_config_metadata --lib` passes locally. - `cargo test --manifest-path src-tauri/Cargo.toml app_state_startup_normalizes_legacy_agent_run_rows --lib` passes locally. - `cargo test --manifest-path src-tauri/Cargo.toml cadence_status --lib` passes locally. - `pnpm typecheck` passes locally. - `cargo check --manifest-path src-tauri/Cargo.toml` passes locally. - `pnpm check:architecture` passes locally. - `pnpm check` passes locally. - PR CI passed for Frontend/Architecture/Organization, Rust Capability Layer, Browser Smoke and Performance, Auto-label, and CodeRabbit. Issue #1791 status after merged slices: - Agent enabled/disabled state was covered by merged PR #1803. - Knowledge Retrieval/Router active-lorebook source controls are already present on current `refactor`. - Script custom-tool safety gate was covered by merged PR #1813. - Legacy `agent_runs` import/display metadata was covered by merged PR #1818. - `agent_cadence_status` parity was covered by merged PR #1818. Remaining work: no known open items from the current issue checklist. This issue looks ready to close if maintainers agree.
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#873
No description provided.