mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #3941] [MERGED] fix: recover Professor Mari's reply on tab resume + alert on pending approval #6167
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#6167
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/3941
Author: @Gunterlie
Created: 7/22/2026
Status: ✅ Merged
Merged: 7/22/2026
Merged by: @SpicyMarinara
Base:
staging← Head:mari-task-persistence📝 Commits (4)
78afdf7fix: recover Professor Mari's reply on tab resume + alert on pending approval7a58641fix: keep Professor Mari's workspace run alive across a passive disconnecte42e14fMerge branch 'staging' into mari-task-persistence2f9fa22fix: wait for detached Mari run to settle before reloading📊 Changes
4 files changed (+110 additions, -3 deletions)
View changed files
📝
packages/client/src/components/chat/HomeProfessorMariChat.tsx(+66 -1)📝
packages/client/src/hooks/use-generate.ts(+4 -0)📝
packages/client/src/lib/api-client.ts(+37 -1)📝
packages/server/src/routes/professor-mari-workspace.routes.ts(+3 -1)📄 Description
Linked issue
Closes #3940
Why this change
Give Professor Mari a task, then leave — background the tab, lock the phone, switch chats — and on return her work appears frozen. The browser suspends the tab and the SSE socket goes half-open, so
reader.read()never settles again. The reply she actually finished (the server keeps generating after a passive client disconnect and saves it) never shows, and no notification fires; only a new command unblocks the zombie stream. Separately, when she finishes and is blocked on your approval, nothing pulls you back if you have stepped away.What changed
api-client.ts— opt-in resume watchdog instreamEvents. New{ disconnectOnResume }option: on the first hidden→visible flip mid-stream, reject the pending read with a normalError. This lets the existing passive-recovery path (isPassiveStreamDisconnect→waitForServerGenerationToSettle→refreshMessagesAuthoritatively) run and refetch the finished reply, and fire its existing "reply ready" notification. Opt-in so background-autonomous streams (which run while hidden by design) are unaffected.use-generate.ts— enable the watchdog on the main/generatestream only (not/generate/retry-agents, which has its own handling).HomeProfessorMariChat.tsx— notify "Professor Mari needs your approval" when a new pending approval appears. Reuses the existing notification helpers (they self-suppress while focused, so a present user just sees the in-app review card). Dedupes by approval id.No new dependencies, no new settings, no server changes.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm checkwas run by the agent and passed (impeccable check + lint + build, exit 0). The following still need a human to verify in a real browser/app — treat the boxes above as a TO-DO list, not proof:Docs and release impact
UI evidence (if applicable)
No visual changes; behavior only (stream recovery + OS/native notifications).
Summary by CodeRabbit
New Features
Bug Fixes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.