[PR #1115] [MERGED] Add keyword activation filters for custom agents #4929

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1115
Author: @cha1latte
Created: 5/22/2026
Status: ✅ Merged
Merged: 5/22/2026
Merged by: @cha1latte

Base: staging ← Head: feature/issue-1102-keyword-agent-filters-staging


📝 Commits (1)

  • 76a8d8f Implement custom agent keyword activation filters

📊 Changes

6 files changed (+208 additions, -0 deletions)

View changed files

📝 packages/client/src/components/agents/AgentEditor.tsx (+105 -0)
📝 packages/server/src/routes/generate.routes.ts (+12 -0)
➕ packages/server/src/routes/generate/agent-activation.ts (+77 -0)
➕ packages/shared/src/constants/agent-activation.ts (+2 -0)
📝 packages/shared/src/index.ts (+1 -0)
📝 packages/shared/src/schemas/agent.schema.ts (+11 -0)

📄 Description

Linked issue

Closes #1102

Why this change

  • Custom agents can be useful only in specific story or workflow moments, but today they run on cadence alone. This adds a lightweight keyword gate so a custom agent can stay quiet unless recent chat context contains one of its configured activation phrases.

What changed

  • Added activation keyword and scan depth controls to the custom agent editor.
  • Added shared activation scan-depth defaults and schema validation.
  • Added server-side keyword matching for custom agents before run interval checks.
  • Left built-in agents, tracker triggers, agent-only lorebook entries, and broader scheduling rules out of scope.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Codex ran pnpm --filter @marinara-engine/server exec tsx ..\..\scratch\verify-issue-1102-agent-activation.ts; it passed keyword normalization, scan-depth clamping, positive match, negative depth miss, unrelated keyword miss, and empty-keyword no-op cases.
  • Codex ran an API persistence smoke against the local server: created a temporary custom agent with moonlit ritual / secret door and scan depth 3, fetched it back, verified the settings persisted, then deleted it.
  • Codex ran pnpm check; it passed.
  • Full browser click-through was not completed because the Playwright MCP profile was locked and no repo-local Playwright browser install was available.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

No screenshot evidence captured. Codex verified the editor module served locally and validated the app-owned API persistence path, but full browser interaction was blocked by the local Playwright/browser setup.


🔄 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/1115 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/22/2026 **Status:** ✅ Merged **Merged:** 5/22/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `staging` ← **Head:** `feature/issue-1102-keyword-agent-filters-staging` --- ### 📝 Commits (1) - [`76a8d8f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/76a8d8f8d6c53f091b05639b7a5cb1b8ed655b3c) Implement custom agent keyword activation filters ### 📊 Changes **6 files changed** (+208 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/agents/AgentEditor.tsx` (+105 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+12 -0) ➕ `packages/server/src/routes/generate/agent-activation.ts` (+77 -0) ➕ `packages/shared/src/constants/agent-activation.ts` (+2 -0) 📝 `packages/shared/src/index.ts` (+1 -0) 📝 `packages/shared/src/schemas/agent.schema.ts` (+11 -0) </details> ### 📄 Description ## Linked issue Closes #1102 ## Why this change - Custom agents can be useful only in specific story or workflow moments, but today they run on cadence alone. This adds a lightweight keyword gate so a custom agent can stay quiet unless recent chat context contains one of its configured activation phrases. ## What changed - Added activation keyword and scan depth controls to the custom agent editor. - Added shared activation scan-depth defaults and schema validation. - Added server-side keyword matching for custom agents before run interval checks. - Left built-in agents, tracker triggers, agent-only lorebook entries, and broader scheduling rules out of scope. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Codex ran `pnpm --filter @marinara-engine/server exec tsx ..\..\scratch\verify-issue-1102-agent-activation.ts`; it passed keyword normalization, scan-depth clamping, positive match, negative depth miss, unrelated keyword miss, and empty-keyword no-op cases. - Codex ran an API persistence smoke against the local server: created a temporary custom agent with `moonlit ritual` / `secret door` and scan depth `3`, fetched it back, verified the settings persisted, then deleted it. - Codex ran `pnpm check`; it passed. - Full browser click-through was not completed because the Playwright MCP profile was locked and no repo-local Playwright browser install was available. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) No screenshot evidence captured. Codex verified the editor module served locally and validated the app-owned API persistence path, but full browser interaction was blocked by the local Playwright/browser setup. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:11:47 +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#4929
No description provided.