[PR #1707] [MERGED] [codex] Fix agent Save & close failure handling #5223

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

📋 Pull Request Information

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

Base: refactor ← Head: codex/1703-agent-save-close-failure


📝 Commits (3)

  • 33a97f1 Fix agent save close failure handling
  • f68079c Fix agent save close failure handling
  • 4ad84d8 Clarify agent save close retry test

📊 Changes

2 files changed (+101 additions, -16 deletions)

View changed files

📝 src/features/catalog/agents/components/AgentEditor.test.tsx (+94 -12)
📝 src/features/catalog/agents/components/AgentEditor.tsx (+7 -4)

📄 Description

Linked issue

Closes #1703

Why this change

  • The Agent editor's Save & close path closed the detail view even when the async agent save failed, hiding the user's unsaved edits after showing the save failure.

What changed

  • Changed AgentEditor save handling to return a success boolean after persistence completes.
  • Gated the unsaved-warning Save & close action so it only closes after a successful save.
  • Added regression coverage for failed Save & close preserving the editor, preserving the edited name, showing the save error, and still closing after a successful retry.

Refactor impact

Primary owner:

  • Catalog agents editor UI (src/features/catalog/agents).

Impact areas reviewed:

  • Agent editor unsaved-changes banner.
  • Agent save error state and dirty local editor state.
  • Existing Agent editor header regression coverage.
  • Analogous Tool editor save-close pattern.

Boundary notes:

  • Feature UI only. No engine, shared API, Tauri/Rust, storage command, or remote runtime boundary changes.

Pressure points touched:

  • None.

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

  • Reproduced before fix with a focused jsdom regression test: failed updateAgent.mutateAsync caused agentDetailId to become null.
  • Verified after fix with pnpm exec vitest run src/features/catalog/agents/components/AgentEditor.test.tsx.
  • Ran pnpm typecheck.
  • Ran native Tauri WebDriver smoke via pnpm smoke with ME_REFACTOR_ROOT pointed at this checkout; it built the debug Tauri app, opened the native WebView2 window, and verified React mounted. The mocked failed-save path is covered by the regression test, not by the native smoke.
  • pnpm build also ran as part of the native Tauri smoke build path.
  • Failpath/Bunny pass found and fixed one proof gap by adding edited-value preservation and successful retry assertions.

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

Notes:

  • No docs changed; this is a narrow catalog UI bugfix.
  • No CHANGELOG.md exists in this checkout.

UI evidence

  • No reviewer-visible screenshot added. The user-visible failure is an async save-failure path covered by the regression test.

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced agent editor save experience: when a save operation fails, the editor now remains open with an error message, allowing you to review and retry your changes.

🔄 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/1707 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/31/2026 **Status:** ✅ Merged **Merged:** 5/31/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `codex/1703-agent-save-close-failure` --- ### 📝 Commits (3) - [`33a97f1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/33a97f1f9b7c7b2c22c85198dd870dace6088dfe) Fix agent save close failure handling - [`f68079c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f68079c230f553f3bc6a115e8c8382bdf23a7651) Fix agent save close failure handling - [`4ad84d8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4ad84d86a2c4743865cf40c4e08615ad1a7cc7b3) Clarify agent save close retry test ### 📊 Changes **2 files changed** (+101 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `src/features/catalog/agents/components/AgentEditor.test.tsx` (+94 -12) 📝 `src/features/catalog/agents/components/AgentEditor.tsx` (+7 -4) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #1703 ## Why this change - The Agent editor's `Save & close` path closed the detail view even when the async agent save failed, hiding the user's unsaved edits after showing the save failure. ## What changed - Changed `AgentEditor` save handling to return a success boolean after persistence completes. - Gated the unsaved-warning `Save & close` action so it only closes after a successful save. - Added regression coverage for failed Save & close preserving the editor, preserving the edited name, showing the save error, and still closing after a successful retry. ## Refactor impact Primary owner: - Catalog agents editor UI (`src/features/catalog/agents`). Impact areas reviewed: - Agent editor unsaved-changes banner. - Agent save error state and dirty local editor state. - Existing Agent editor header regression coverage. - Analogous Tool editor save-close pattern. Boundary notes: - Feature UI only. No engine, shared API, Tauri/Rust, storage command, or remote runtime boundary changes. Pressure points touched: - None. ## 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 - [x] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [x] Remote runtime smoke checked when relevant ### Manual verification notes - Reproduced before fix with a focused jsdom regression test: failed `updateAgent.mutateAsync` caused `agentDetailId` to become `null`. - Verified after fix with `pnpm exec vitest run src/features/catalog/agents/components/AgentEditor.test.tsx`. - Ran `pnpm typecheck`. - Ran native Tauri WebDriver smoke via `pnpm smoke` with `ME_REFACTOR_ROOT` pointed at this checkout; it built the debug Tauri app, opened the native WebView2 window, and verified React mounted. The mocked failed-save path is covered by the regression test, not by the native smoke. - `pnpm build` also ran as part of the native Tauri smoke build path. - Failpath/Bunny pass found and fixed one proof gap by adding edited-value preservation and successful retry assertions. ## 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 Notes: - No docs changed; this is a narrow catalog UI bugfix. - No `CHANGELOG.md` exists in this checkout. ## UI evidence - No reviewer-visible screenshot added. The user-visible failure is an async save-failure path covered by the regression test. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Enhanced agent editor save experience: when a save operation fails, the editor now remains open with an error message, allowing you to review and retry your changes. <!-- 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:14:22 +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#5223
No description provided.