[PR #1404] [MERGED] Restore custom agent run interval parity #5071

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

📋 Pull Request Information

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

Base: refactor ← Head: codex/custom-agent-runinterval-parity


📝 Commits (2)

  • 6b45916 Restore custom agent run interval gating
  • 843c006 Harden custom agent cadence edge cases

📊 Changes

4 files changed (+415 additions, -28 deletions)

View changed files

📝 src/engine/generation/agent-runner.test.ts (+283 -0)
📝 src/engine/generation/agent-runner.ts (+89 -28)
📝 src/engine/generation/start-generation.test.ts (+41 -0)
📝 src/engine/generation/start-generation.ts (+2 -0)

📄 Description

Linked issue

No linked issue found. This PR comes from the local refactor parity audit chore for custom agent cadence/runtime runInterval behavior.

Why this change

Custom agents exposed a Trigger Cadence / settings.runInterval control, but the refactor runtime only enforced automatic interval gating for Illustrator. That meant custom agents could run every generation even when configured to wait several user messages, regressing legacy 1.6.1 behavior.

What changed

  • Restored automatic runInterval gating for non-built-in custom agents using user-message cadence.
  • Kept Illustrator on its existing assistant-message cadence.
  • Split prompt context from cadence timeline so regenerations keep trimmed prompt context without losing the previous run anchor.
  • Matched legacy/imported custom agent run rows by agentConfigId when agentType is absent.
  • Added focused coverage for skip/run threshold behavior, explicit retry bypass, legacy run rows, regeneration cadence, and existing Illustrator behavior.

Refactor impact

Primary owner:

engine generation

Impact areas reviewed:

  • Agent resolution in the generation runtime.
  • startGeneration normal send and regenerate paths.
  • Explicit agent retry path.
  • Persisted agent-runs compatibility for current and legacy/imported row shapes.
  • Existing Illustrator cadence behavior.

Boundary notes:

  • Engine-only TypeScript change; no React, shared API, Tauri, Rust, or remote-runtime boundary changes.
  • cadenceMessages is an engine runtime input used only to evaluate historical cadence anchors while keeping prompt context sliced.

Pressure points touched:

  • src/engine/generation/agent-runner.ts
  • src/engine/generation/start-generation.ts

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

Commands run locally:

  • pnpm test src/engine/generation/agent-runner.test.ts
  • pnpm test src/engine/generation/start-generation.test.ts
  • pnpm typecheck
  • pnpm check:architecture
  • git diff --check

No native Tauri/manual UI pass was run because this is engine-runtime cadence behavior covered by focused tests.

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 docs or changelog update was made. The repository does not currently have a changelog/release-notes file, and this change restores persisted/runtime behavior without changing visible UI copy.

UI evidence

No UI screenshots. This PR does not change rendered UI.

Summary by CodeRabbit

  • New Features

    • Custom agents now respect configurable run-interval settings to control automatic execution frequency based on message history.
    • Explicit custom agent retries bypass automatic interval gating.
  • Tests

    • Added coverage for custom agent run-interval validation and cadence gating during regenerations.

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/1404 **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/custom-agent-runinterval-parity` --- ### 📝 Commits (2) - [`6b45916`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6b459160122ad0a075d233d33f29179124197562) Restore custom agent run interval gating - [`843c006`](https://github.com/Pasta-Devs/Marinara-Engine/commit/843c006abee6ca127de1d5e7cf4758ab3c1da8b2) Harden custom agent cadence edge cases ### 📊 Changes **4 files changed** (+415 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `src/engine/generation/agent-runner.test.ts` (+283 -0) 📝 `src/engine/generation/agent-runner.ts` (+89 -28) 📝 `src/engine/generation/start-generation.test.ts` (+41 -0) 📝 `src/engine/generation/start-generation.ts` (+2 -0) </details> ### 📄 Description ## Linked issue No linked issue found. This PR comes from the local refactor parity audit chore for custom agent cadence/runtime `runInterval` behavior. ## Why this change Custom agents exposed a Trigger Cadence / `settings.runInterval` control, but the refactor runtime only enforced automatic interval gating for Illustrator. That meant custom agents could run every generation even when configured to wait several user messages, regressing legacy 1.6.1 behavior. ## What changed - Restored automatic `runInterval` gating for non-built-in custom agents using user-message cadence. - Kept Illustrator on its existing assistant-message cadence. - Split prompt context from cadence timeline so regenerations keep trimmed prompt context without losing the previous run anchor. - Matched legacy/imported custom agent run rows by `agentConfigId` when `agentType` is absent. - Added focused coverage for skip/run threshold behavior, explicit retry bypass, legacy run rows, regeneration cadence, and existing Illustrator behavior. ## Refactor impact Primary owner: engine generation Impact areas reviewed: - Agent resolution in the generation runtime. - `startGeneration` normal send and regenerate paths. - Explicit agent retry path. - Persisted `agent-runs` compatibility for current and legacy/imported row shapes. - Existing Illustrator cadence behavior. Boundary notes: - Engine-only TypeScript change; no React, shared API, Tauri, Rust, or remote-runtime boundary changes. - `cadenceMessages` is an engine runtime input used only to evaluate historical cadence anchors while keeping prompt context sliced. Pressure points touched: - `src/engine/generation/agent-runner.ts` - `src/engine/generation/start-generation.ts` ## 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 - [x] `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 Commands run locally: - `pnpm test src/engine/generation/agent-runner.test.ts` - `pnpm test src/engine/generation/start-generation.test.ts` - `pnpm typecheck` - `pnpm check:architecture` - `git diff --check` No native Tauri/manual UI pass was run because this is engine-runtime cadence behavior covered by focused tests. ## 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 docs or changelog update was made. The repository does not currently have a changelog/release-notes file, and this change restores persisted/runtime behavior without changing visible UI copy. ## UI evidence No UI screenshots. This PR does not change rendered UI. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Custom agents now respect configurable run-interval settings to control automatic execution frequency based on message history. * Explicit custom agent retries bypass automatic interval gating. * **Tests** * Added coverage for custom agent run-interval validation and cadence gating during regenerations. <!-- 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/1404?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:58 +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#5071
No description provided.