[GH-ISSUE #1497] [Issue]: Roleplay agent panels use raw invokeTauri calls #748

Closed
opened 2026-10-20 17:32:46 +07:00 by bsakaguchi · 1 comment
Owner

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

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Roleplay agent-side panels still import invokeTauri directly for agent memory/cadence commands instead of going through focused shared API wrappers. This violates the refactor architecture rule for feature code and leaves these Roleplay agent controls outside the typed shared API/remote-runtime contract.

Expected behavior

Roleplay feature code should call focused wrappers under src/shared/api for privileged/runtime commands. Commands that are remote-capable should remain explicit in the shared API wrapper, remote runtime allowlist, and Rust HTTP dispatch path.

Actual behavior

src/features/modes/roleplay/components/ContextInjectionPanel.tsx and src/features/modes/roleplay/components/SecretPlotPanel.tsx import invokeTauri directly and call agent commands from the feature component layer:

  • agent_cadence_status
  • agent_memory_get
  • agent_memory_patch

This makes the Roleplay agent UI a boundary exception instead of using a reusable typed wrapper.

Steps to reproduce

  1. On the refactor line, run rg -n "invokeTauri" src/features/modes/roleplay.
  2. Observe raw invokeTauri imports/calls in ContextInjectionPanel.tsx and SecretPlotPanel.tsx.
  3. Compare against AGENTS.md / architecture guard guidance that new or touched feature code should use focused shared API wrappers rather than raw invokeTauri.

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-line local source audit at 4ea23560
  • Run mode: Static source audit during Roleplay smoke support; no runtime run
  • OS + version: Not collected; source audit only
  • Node + pnpm versions: Not collected; source audit only
  • Rust version, if relevant: Not relevant
  • Remote Runtime URL configured? Not relevant
  • Provider, model, or integration, if relevant: Not relevant

Logs, screenshots, or video

Relevant source-audit output:

src/features/modes/roleplay/components/ContextInjectionPanel.tsx:11:import { invokeTauri } from "../../../../shared/api/tauri-client";
src/features/modes/roleplay/components/ContextInjectionPanel.tsx:141:    queryFn: () => invokeTauri<AgentCadenceStatus>("agent_cadence_status", { agentType: "director", chatId }),
src/features/modes/roleplay/components/SecretPlotPanel.tsx:8:import { invokeTauri } from "../../../../shared/api/tauri-client";
src/features/modes/roleplay/components/SecretPlotPanel.tsx:109:      const res = await invokeTauri<{ agentConfigId: string; memory: Record<string, unknown> }>("agent_memory_get", {
src/features/modes/roleplay/components/SecretPlotPanel.tsx:167:      await invokeTauri<{ memory: Record<string, unknown> }>("agent_memory_patch", {

Regression notes

Not confirmed as a runtime regression. Found during the Roleplay mode audit as an architecture/wiring issue.

Additional context

Found while supporting #1486 (Smoke test: Roleplay Mode). A focused fix should introduce a typed shared API wrapper for these agent memory/cadence calls and update the Roleplay panels to use it.

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 (May 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1497 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Roleplay agent-side panels still import `invokeTauri` directly for agent memory/cadence commands instead of going through focused shared API wrappers. This violates the refactor architecture rule for feature code and leaves these Roleplay agent controls outside the typed shared API/remote-runtime contract. ## Expected behavior Roleplay feature code should call focused wrappers under `src/shared/api` for privileged/runtime commands. Commands that are remote-capable should remain explicit in the shared API wrapper, remote runtime allowlist, and Rust HTTP dispatch path. ## Actual behavior `src/features/modes/roleplay/components/ContextInjectionPanel.tsx` and `src/features/modes/roleplay/components/SecretPlotPanel.tsx` import `invokeTauri` directly and call agent commands from the feature component layer: - `agent_cadence_status` - `agent_memory_get` - `agent_memory_patch` This makes the Roleplay agent UI a boundary exception instead of using a reusable typed wrapper. ## Steps to reproduce 1. On the refactor line, run `rg -n "invokeTauri" src/features/modes/roleplay`. 2. Observe raw `invokeTauri` imports/calls in `ContextInjectionPanel.tsx` and `SecretPlotPanel.tsx`. 3. Compare against `AGENTS.md` / architecture guard guidance that new or touched feature code should use focused shared API wrappers rather than raw `invokeTauri`. ## Impact area <!-- Check the areas you think are relevant. Leave uncertain items unchecked. --> - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [ ] Chat mode - [x] 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 - [x] 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-line local source audit at `4ea23560` - Run mode: Static source audit during Roleplay smoke support; no runtime run - OS + version: Not collected; source audit only - Node + pnpm versions: Not collected; source audit only - Rust version, if relevant: Not relevant - Remote Runtime URL configured? Not relevant - Provider, model, or integration, if relevant: Not relevant ## Logs, screenshots, or video Relevant source-audit output: ```text src/features/modes/roleplay/components/ContextInjectionPanel.tsx:11:import { invokeTauri } from "../../../../shared/api/tauri-client"; src/features/modes/roleplay/components/ContextInjectionPanel.tsx:141: queryFn: () => invokeTauri<AgentCadenceStatus>("agent_cadence_status", { agentType: "director", chatId }), src/features/modes/roleplay/components/SecretPlotPanel.tsx:8:import { invokeTauri } from "../../../../shared/api/tauri-client"; src/features/modes/roleplay/components/SecretPlotPanel.tsx:109: const res = await invokeTauri<{ agentConfigId: string; memory: Record<string, unknown> }>("agent_memory_get", { src/features/modes/roleplay/components/SecretPlotPanel.tsx:167: await invokeTauri<{ memory: Record<string, unknown> }>("agent_memory_patch", { ``` ## Regression notes Not confirmed as a runtime regression. Found during the Roleplay mode audit as an architecture/wiring issue. ## Additional context Found while supporting #1486 (`Smoke test: Roleplay Mode`). A focused fix should introduce a typed shared API wrapper for these agent memory/cadence calls and update the Roleplay panels to use it. ## 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-20 17:32:46 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (May 29, 2026):

Resolved on refactor in a706b274. Roleplay agent panels now use shared agentApi wrappers for cadence and memory calls instead of raw invokeTauri imports.

<!-- gh-comment-id:4571930603 --> @SpicyMarinara commented on GitHub (May 29, 2026): Resolved on refactor in a706b274. Roleplay agent panels now use shared agentApi wrappers for cadence and memory calls instead of raw invokeTauri imports.
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#748
No description provided.