[PR #3004] [MERGED] Fix agent retry issue sweep #5786

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3004
Author: @SpicyMarinara
Created: 6/29/2026
Status: ✅ Merged
Merged: 6/29/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/agent-retry-issue-sweep-2983-3002


📝 Commits (2)

  • 25ebb15 Fix agent retry issue sweep
  • 85ad51a Address agent retry review notes

📊 Changes

12 files changed (+428 additions, -148 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/client/src/stores/agent.store.ts (+49 -39)
📝 packages/server/src/routes/agents.routes.ts (+2 -1)
📝 packages/server/src/routes/generate.routes.ts (+11 -8)
📝 packages/server/src/routes/generate/agent-connection-guards.ts (+1 -1)
📝 packages/server/src/routes/generate/expression-agent-utils.ts (+6 -3)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+217 -66)
📝 packages/server/src/services/agents/agent-executor.ts (+89 -21)
📝 packages/server/src/services/generation/agent-resolution.ts (+15 -0)
📝 packages/server/src/services/storage/agents.storage.ts (+12 -8)
📝 packages/server/src/services/storage/chats.storage.ts (+17 -0)
📝 packages/shared/src/types/agent.ts (+8 -1)

📄 Description

Summary

Fixes the open agent retry/generation issue sweep reported in #2983 through #3002.

What Changed

  • Hardened agent connection selection, runtime phase normalization, retry wrap format, persona fallback, disabled/retired built-in filtering, built-in default tool resolution, and noncritical pre-generation failure handling.
  • Fixed retry side effects for edit-message tools, lorebook-update permissions/scoping, Lorebook Keeper failure isolation, message-scoped tracker effects, Spotify retry fallback, and atomic Illustrator attachment writes.
  • Fixed agent executor/result edge cases for nested <result> parsing, text-rewrite retry markup preservation, JSON trailing-comma repair, custom run listing/limits, sprite expression selection, and Custom Music DJ reset state.
  • Updated the v2.0.7 changelog.

Validation

  • pnpm --filter @marinara-engine/server lint
  • pnpm --filter @marinara-engine/client lint
  • pnpm check
  • pnpm regression:prompt

Manual Verification Needed

  • Manually verify representative retry flows in Conversation, Roleplay, and Game modes.
  • Manually verify custom agent retry tools for lorebook edits and message edits.
  • Manually verify Spotify DJ retry behavior with a fresh track request.

Summary by CodeRabbit

  • Bug Fixes
    • Improved retry and regeneration behavior so non-critical failures no longer stop a run, while key failures still surface clearly.
    • Fixed local music state resetting correctly when starting over.
    • Improved handling of custom-agent run history, including safer limits and more reliable loading.
    • Made message edits, attachment updates, lorebook changes, and tracker updates behave more consistently during retries.
    • Hardened result parsing and JSON repair to better handle complex or malformed content.

🔄 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/3004 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 6/29/2026 **Status:** ✅ Merged **Merged:** 6/29/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/agent-retry-issue-sweep-2983-3002` --- ### 📝 Commits (2) - [`25ebb15`](https://github.com/Pasta-Devs/Marinara-Engine/commit/25ebb15a4cf99f54d6db0a3d25e5970713f560b9) Fix agent retry issue sweep - [`85ad51a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/85ad51a3a31d2acf01b16a21e3227e965763bd7c) Address agent retry review notes ### 📊 Changes **12 files changed** (+428 additions, -148 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/client/src/stores/agent.store.ts` (+49 -39) 📝 `packages/server/src/routes/agents.routes.ts` (+2 -1) 📝 `packages/server/src/routes/generate.routes.ts` (+11 -8) 📝 `packages/server/src/routes/generate/agent-connection-guards.ts` (+1 -1) 📝 `packages/server/src/routes/generate/expression-agent-utils.ts` (+6 -3) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+217 -66) 📝 `packages/server/src/services/agents/agent-executor.ts` (+89 -21) 📝 `packages/server/src/services/generation/agent-resolution.ts` (+15 -0) 📝 `packages/server/src/services/storage/agents.storage.ts` (+12 -8) 📝 `packages/server/src/services/storage/chats.storage.ts` (+17 -0) 📝 `packages/shared/src/types/agent.ts` (+8 -1) </details> ### 📄 Description ## Summary Fixes the open agent retry/generation issue sweep reported in #2983 through #3002. ## What Changed - Hardened agent connection selection, runtime phase normalization, retry wrap format, persona fallback, disabled/retired built-in filtering, built-in default tool resolution, and noncritical pre-generation failure handling. - Fixed retry side effects for edit-message tools, lorebook-update permissions/scoping, Lorebook Keeper failure isolation, message-scoped tracker effects, Spotify retry fallback, and atomic Illustrator attachment writes. - Fixed agent executor/result edge cases for nested `<result>` parsing, text-rewrite retry markup preservation, JSON trailing-comma repair, custom run listing/limits, sprite expression selection, and Custom Music DJ reset state. - Updated the v2.0.7 changelog. ## Validation - `pnpm --filter @marinara-engine/server lint` - `pnpm --filter @marinara-engine/client lint` - `pnpm check` - `pnpm regression:prompt` ## Manual Verification Needed - Manually verify representative retry flows in Conversation, Roleplay, and Game modes. - Manually verify custom agent retry tools for lorebook edits and message edits. - Manually verify Spotify DJ retry behavior with a fresh track request. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved retry and regeneration behavior so non-critical failures no longer stop a run, while key failures still surface clearly. * Fixed local music state resetting correctly when starting over. * Improved handling of custom-agent run history, including safer limits and more reliable loading. * Made message edits, attachment updates, lorebook changes, and tracker updates behave more consistently during retries. * Hardened result parsing and JSON repair to better handle complex or malformed content. <!-- 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:19:31 +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#5786
No description provided.