[GH-ISSUE #6605] [Feature]: Warn on agent imports and without a Decision model when an import uses decisions #3699

Closed
opened 2026-10-21 06:06:18 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @kolacheee on GitHub (Sep 24, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6605

Originally assigned to: @kolacheee on GitHub.

What problem does this solve?

People are starting to share agents that use decisions. Anyone who installs one without a Decision model may think the agent is broken and report it to the author. They should find out on import, not from bug reports.

What already works (checked on staging 1bd1e1a5f, no change needed):

  • An agent's activation question falls back to running. With no Decision model, or one that does not answer in time, an agent with an activation question runs as if it had none. Its keywords and Trigger Cadence still apply. So an agent set to a cadence of 3 runs every 3 messages without a Decision model. With one, its question is asked only on those turns, because keywords and cadence are checked first. This is documented in docs/agents/custom-agents.md (Activation questions) and docs/connections/decision-models.md.
  • Decision statements inside an agent's prompt read as no without a Decision model, like everywhere else, so their {{else}} branch is sent. That is intended and stays as it is.
  • An import notice exists (packages/client/src/lib/decision-import-notice.ts), shown after importing a character, persona, preset or lorebook that uses decision statements or a lorebook Decision field.

What is missing from that notice:

  1. Agents never trigger it. Importing a custom agent in the Agents panel and installing a package from the Agent catalog show nothing.
  2. It does not detect activation questions. containsDecisionStatements finds decision statements and lorebook Decision fields, but not an agent's activationQuestion, so an agent that only uses an activation question would not be flagged even once agents are covered.
  3. It does not tell users with no Decision model what will happen. It shows the same text whether or not a Decision model is set, and it never says what happens to an agent.
  4. It has no link to the guide.

Proposed solution

  • Cover agents. Show the notice after a custom agent import in the Agents panel and after a package install from the Agent catalog, when an imported agent has an activation question or decision statements in its prompt template.
  • Detect activation questions alongside decision statements and lorebook Decision fields.
  • With no Decision model set, show a warning that says what happens without one:
    • decision statements read as no, so their {{else}} branch is sent;
    • a lorebook entry that needs a decision does not activate on it;
    • an agent with an activation question runs on every turn its keywords and Trigger Cadence allow.
  • With a Decision model set, keep today's notice about billed requests and the per-turn limit.
  • Both show an "Open guide" action that opens the in-app docs viewer on connections/decision-models.md, the same way other notices open DocsViewerModal.
  • Docs.
    • In docs/connections/decision-models.md, next to "Presets, cards and agents should be written for a Decision model", tell authors that users without one are warned on import. Say that an agent's activation question then runs on its Trigger Cadence, so an agent that should not run every turn needs a cadence as well.
    • In docs/agents/custom-agents.md (Activation questions), say the same from the agent editor's side.
    • List the changed docs on #6532, the batched docs-i18n issue for Decision model docs.

Out of scope: whole-profile ZIP import, which restores a profile rather than bringing in someone else's content.

Alternatives considered

  • Read agent decisions as yes when no Decision model is set. Not needed for the activation question, since it already runs on its cadence without one. For statements inside an agent's prompt it would change what the agent is told. It could also send contradictory branches, for example "a fight starts" and "a fight ends" both read as yes, and decision_choice: has no neutral option to pick. Statements keep reading as no, and authors keep a sensible {{else}} branch, as docs/agents/custom-agents.md already advises.
  • Add every:, sticky: or cooldown: to activation questions. Trigger Cadence already gives an agent its timing, with or without a Decision model.

Additional context

  • Detection: containsDecisionStatements in packages/shared/src/utils/macro-engine.ts.
  • Notice: createDecisionImportTracker in packages/client/src/lib/decision-import-notice.ts, used by ImportCharacterModal, ImportPersonaModal, ImportPresetModal and ImportLorebookModal.
  • Whether a Decision model is set: useHasDecisionModel in packages/client/src/hooks/use-decision-model.ts.
  • Agent import: useImportAgent from AgentsPanel.tsx. Package install: useInstallCapabilityPackage from AgentCatalogView.tsx.
  • Related: #6530 (activation questions), #6569 (decision statements), #6570 (lorebook decision activation).

Template check

Please uncheck (untick) 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 @kolacheee on GitHub (Sep 24, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6605 Originally assigned to: @kolacheee on GitHub. ## What problem does this solve? People are starting to share agents that use decisions. Anyone who installs one without a Decision model may think the agent is broken and report it to the author. They should find out on import, not from bug reports. **What already works (checked on staging 1bd1e1a5f, no change needed):** - **An agent's activation question falls back to running.** With no Decision model, or one that does not answer in time, an agent with an activation question runs as if it had none. Its keywords and **Trigger Cadence** still apply. So an agent set to a cadence of 3 runs every 3 messages without a Decision model. With one, its question is asked only on those turns, because keywords and cadence are checked first. This is documented in `docs/agents/custom-agents.md` (Activation questions) and `docs/connections/decision-models.md`. - **Decision statements inside an agent's prompt read as no** without a Decision model, like everywhere else, so their `{{else}}` branch is sent. That is intended and stays as it is. - **An import notice exists** (`packages/client/src/lib/decision-import-notice.ts`), shown after importing a character, persona, preset or lorebook that uses decision statements or a lorebook **Decision** field. **What is missing from that notice:** 1. **Agents never trigger it.** Importing a custom agent in the Agents panel and installing a package from the Agent catalog show nothing. 2. **It does not detect activation questions.** `containsDecisionStatements` finds decision statements and lorebook Decision fields, but not an agent's `activationQuestion`, so an agent that only uses an activation question would not be flagged even once agents are covered. 3. **It does not tell users with no Decision model what will happen.** It shows the same text whether or not a Decision model is set, and it never says what happens to an agent. 4. **It has no link to the guide.** ## Proposed solution - **Cover agents.** Show the notice after a custom agent import in the Agents panel and after a package install from the Agent catalog, when an imported agent has an activation question or decision statements in its prompt template. - **Detect activation questions** alongside decision statements and lorebook Decision fields. - **With no Decision model set**, show a warning that says what happens without one: - decision statements read as no, so their `{{else}}` branch is sent; - a lorebook entry that needs a decision does not activate on it; - an agent with an activation question runs on every turn its keywords and Trigger Cadence allow. - **With a Decision model set**, keep today's notice about billed requests and the per-turn limit. - **Both show an "Open guide" action** that opens the in-app docs viewer on `connections/decision-models.md`, the same way other notices open `DocsViewerModal`. - **Docs.** - In `docs/connections/decision-models.md`, next to "Presets, cards and agents should be written for a Decision model", tell authors that users without one are warned on import. Say that an agent's activation question then runs on its Trigger Cadence, so an agent that should not run every turn needs a cadence as well. - In `docs/agents/custom-agents.md` (Activation questions), say the same from the agent editor's side. - List the changed docs on #6532, the batched docs-i18n issue for Decision model docs. Out of scope: whole-profile ZIP import, which restores a profile rather than bringing in someone else's content. ## Alternatives considered - **Read agent decisions as yes when no Decision model is set.** Not needed for the activation question, since it already runs on its cadence without one. For statements inside an agent's prompt it would change what the agent is told. It could also send contradictory branches, for example "a fight starts" and "a fight ends" both read as yes, and `decision_choice:` has no neutral option to pick. Statements keep reading as no, and authors keep a sensible `{{else}}` branch, as `docs/agents/custom-agents.md` already advises. - **Add `every:`, `sticky:` or `cooldown:` to activation questions.** Trigger Cadence already gives an agent its timing, with or without a Decision model. ## Additional context - Detection: `containsDecisionStatements` in `packages/shared/src/utils/macro-engine.ts`. - Notice: `createDecisionImportTracker` in `packages/client/src/lib/decision-import-notice.ts`, used by `ImportCharacterModal`, `ImportPersonaModal`, `ImportPresetModal` and `ImportLorebookModal`. - Whether a Decision model is set: `useHasDecisionModel` in `packages/client/src/hooks/use-decision-model.ts`. - Agent import: `useImportAgent` from `AgentsPanel.tsx`. Package install: `useInstallCapabilityPackage` from `AgentCatalogView.tsx`. - Related: #6530 (activation questions), #6569 (decision statements), #6570 (lorebook decision activation). ## Template check Please **uncheck (untick)** 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.
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#3699
No description provided.