[PR #1392] [MERGED] [codex] Restore custom agent activation parity #5062

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1392
Author: @Xelvanis
Created: 5/27/2026
Status: ✅ Merged
Merged: 5/27/2026
Merged by: @Xelvanis

Base: refactor ← Head: codex/restore-custom-agent-activation


📝 Commits (1)

  • 5b4af24 restore custom agent activation parity

📊 Changes

9 files changed (+505 additions, -4 deletions)

View changed files

➕ src/engine/agents-runtime/activation.ts (+48 -0)
➕ src/engine/contracts/constants/agent-activation.test.ts (+33 -0)
➕ src/engine/contracts/constants/agent-activation.ts (+28 -0)
📝 src/engine/generation/agent-runner.test.ts (+207 -0)
📝 src/engine/generation/agent-runner.ts (+34 -3)
📝 src/engine/generation/start-generation.test.ts (+64 -0)
📝 src/engine/generation/start-generation.ts (+5 -0)
📝 src/features/catalog/agents/components/AgentEditor.tsx (+85 -0)
📝 src/features/runtime/generation/hooks/use-generate.ts (+1 -1)

📄 Description

## Linked issue

Closes #1354

Why this change

Custom agents in the refactor ignored the legacy activationKeywords / activationScanDepth settings, so keyword-gated agents could run on turns where they should have stayed quiet.

This also clarifies retry behavior: normal generation respects activation gates, while explicit UI retries force-run the selected agent.

What changed

  • Added shared custom-agent activation normalization and matching helpers.
  • Gated non-built-in agents by activation keyword matches during normal generation.
  • Added Activation Keywords and Scan Depth controls to the custom agent editor.
  • Made UI-triggered agent retries pass bypassActivation by default while preserving explicit overrides.
  • Short-circuited the no-runnable-agent path so missed keyword gates do not build full agent context or load custom tools.
  • Added focused tests for keyword miss/match, legacy string settings, retry bypass, malformed settings, and the empty-runtime path.

Refactor impact

Primary owner:

  • Engine generation / agents runtime, with catalog agent editor UI wiring.

Impact areas reviewed:

  • Custom agent resolution and execution
  • Retry agent flow
  • Agent editor save/load state
  • Chat, roleplay, and game generation callers that use the shared runtime path

Boundary notes:

  • Product activation behavior lives in src/engine.
  • React editor wiring remains in src/features/catalog/agents.
  • No Rust, Tauri command, shared API transport, or remote runtime boundary changes.

Pressure points touched:

  • Shared generation runtime path used by chat/roleplay/game.

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

Codex ran after rebasing onto origin/refactor:

  • pnpm test src/engine/contracts/constants/agent-activation.test.ts src/engine/generation/agent-runner.test.ts src/engine/generation/start-generation.test.ts - passed, 23 tests.
  • pnpm typecheck - passed.
  • pnpm check:architecture - passed.
  • pnpm build - passed, with existing Vite large chunk / dynamic import warnings.

Native Tauri click-through for custom agent editor save plus manual retry flow was not run.

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

No repo-defined release-note source was updated; this is a focused parity fix.

UI evidence

No screenshot/recording attached; native UI manual QA remains the main residual check.

Summary by CodeRabbit

  • New Features
    • Custom agents can now automatically activate when you mention specified keywords in conversation
    • Agent editor includes new "Activation Keywords" settings to configure keyword-based agent triggers
    • Added bypass option for agent retries to override activation checks when needed

Review Change Stack


🔄 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/1392 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/27/2026 **Status:** ✅ Merged **Merged:** 5/27/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `codex/restore-custom-agent-activation` --- ### 📝 Commits (1) - [`5b4af24`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5b4af24096809ba5d38910fbed17f629ad5597ec) restore custom agent activation parity ### 📊 Changes **9 files changed** (+505 additions, -4 deletions) <details> <summary>View changed files</summary> ➕ `src/engine/agents-runtime/activation.ts` (+48 -0) ➕ `src/engine/contracts/constants/agent-activation.test.ts` (+33 -0) ➕ `src/engine/contracts/constants/agent-activation.ts` (+28 -0) 📝 `src/engine/generation/agent-runner.test.ts` (+207 -0) 📝 `src/engine/generation/agent-runner.ts` (+34 -3) 📝 `src/engine/generation/start-generation.test.ts` (+64 -0) 📝 `src/engine/generation/start-generation.ts` (+5 -0) 📝 `src/features/catalog/agents/components/AgentEditor.tsx` (+85 -0) 📝 `src/features/runtime/generation/hooks/use-generate.ts` (+1 -1) </details> ### 📄 Description ## Linked issue Closes #1354 ## Why this change Custom agents in the refactor ignored the legacy `activationKeywords` / `activationScanDepth` settings, so keyword-gated agents could run on turns where they should have stayed quiet. This also clarifies retry behavior: normal generation respects activation gates, while explicit UI retries force-run the selected agent. ## What changed - Added shared custom-agent activation normalization and matching helpers. - Gated non-built-in agents by activation keyword matches during normal generation. - Added Activation Keywords and Scan Depth controls to the custom agent editor. - Made UI-triggered agent retries pass `bypassActivation` by default while preserving explicit overrides. - Short-circuited the no-runnable-agent path so missed keyword gates do not build full agent context or load custom tools. - Added focused tests for keyword miss/match, legacy string settings, retry bypass, malformed settings, and the empty-runtime path. ## Refactor impact Primary owner: - Engine generation / agents runtime, with catalog agent editor UI wiring. Impact areas reviewed: - Custom agent resolution and execution - Retry agent flow - Agent editor save/load state - Chat, roleplay, and game generation callers that use the shared runtime path Boundary notes: - Product activation behavior lives in `src/engine`. - React editor wiring remains in `src/features/catalog/agents`. - No Rust, Tauri command, shared API transport, or remote runtime boundary changes. Pressure points touched: - Shared generation runtime path used by chat/roleplay/game. ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> - [x] `pnpm check` passes locally - [x] `pnpm typecheck` passes locally - [x] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [x] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes Codex ran after rebasing onto `origin/refactor`: - `pnpm test src/engine/contracts/constants/agent-activation.test.ts src/engine/generation/agent-runner.test.ts src/engine/generation/start-generation.test.ts` - passed, 23 tests. - `pnpm typecheck` - passed. - `pnpm check:architecture` - passed. - `pnpm build` - passed, with existing Vite large chunk / dynamic import warnings. Native Tauri click-through for custom agent editor save plus manual retry flow was not run. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims No repo-defined release-note source was updated; this is a focused parity fix. ## UI evidence No screenshot/recording attached; native UI manual QA remains the main residual check. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Custom agents can now automatically activate when you mention specified keywords in conversation * Agent editor includes new "Activation Keywords" settings to configure keyword-based agent triggers * Added bypass option for agent retries to override activation checks when needed <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1392?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- 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:12:53 +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#5062
No description provided.