mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #2429] [MERGED] Flush pending game-state edits before retrying agents #5604
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5604
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2429
Author: @Romuromylus
Created: 6/6/2026
Status: ✅ Merged
Merged: 6/6/2026
Merged by: @Romuromylus
Base:
refactor← Head:fix/retry-agents-flush-patch📝 Commits (1)
4410b81Flush pending game-state edits before retrying agents📊 Changes
3 files changed (+12 additions, -10 deletions)
View changed files
📝
src/features/runtime/generation/hooks/use-generate.ts(+11 -0)📝
src/features/runtime/tracker/components/TrackerSectionList.tsx(+0 -2)📝
src/features/runtime/tracker/hooks/use-tracker-rerun.ts(+1 -8)📄 Description
Linked issue
Closes #2371
Why this change
retryAgentsre-ran the tracker/agent engine without first flushing pending debounced game-state edits, so the engine re-read a stale storage snapshot and the regenerated output clobbered the user's just-made manual HUD tracker edit (data loss). This is a regression vs main, where the pre-retry flush was centralized. All four roleplay-HUD handlers (Re-run Trackers / Re-run Single Tracker / Retry Failed Agents / Retry Agent) funnel throughretryAgents.What changed
src/features/runtime/generation/hooks/use-generate.ts:retryAgentsnow flushesuseGameStateStore.flushPatch()aftersetProcessing(true)and beforeretryGenerationAgents, mirroring the in-repo guard. A single site covers all four HUD handlers plus the other callers. A flush failure now aborts the retry (throws, surfaced via the existing error toast) instead of silently corrupting state.src/features/runtime/tracker/hooks/use-tracker-rerun.ts+TrackerSectionList.tsx: removed the now-redundant per-callflushPatch()(superseded by the centralized flush) and tidied the deadflushPatchprop.Refactor impact
Primary owner: runtime generation / world-state
Impact areas reviewed:
src/features/runtime/generation/hooks/use-generate.ts(retryAgents)src/features/runtime/tracker/hooks/use-tracker-rerun.ts,src/features/runtime/tracker/components/TrackerSectionList.tsx(redundant flush + prop cleanup)Boundary notes:
flushPatchis a no-op when no patcher is registered (buildFlushPatchreturnsnull) and idempotent on an empty buffer, so the added await is negligible. No conflict with #2373 quest logic (flush-only). No Rust touched.Pressure points touched:
Validation
pnpm checkpasses before PR push/handoffManual verification notes
pnpm vitest run— a local-only test against the realuseGameStateStoreflush seam confirmed the flush runs BEFOREretryGenerationAgents(viainvocationCallOrder), a flush rejection throws andretryGenerationAgentsis never called, and a no-patcher flush is a safe no-op.pnpm exec tsc -b,pnpm lint:eslint,pnpm check:architecture— all clean.Feature Discoverability
src/features/shell/discovery/Reason:
Docs and release impact
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.