[PR #8557] [MERGED] feat(mari): queue messages while she works #8669

Closed
opened 2026-11-07 16:46:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8557
Author: @ylli-selmani
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @ylli-selmani

Base: staging ← Head: feat/mari-queue


📝 Commits (4)

  • 83a7c2d feat(mari): queue messages while she works
  • 73d4e47 fix(mari): queue fixes from CI and Dottore
  • 7e8c2f1 fix(mari): hold every waiting message a new send did not queue itself
  • ea52436 fix(mari): file a late queue answer under the send it was queued during

📊 Changes

17 files changed (+1425 additions, -148 deletions)

View changed files

📝 docs/home/professor-mari.md (+15 -1)
📝 packages/client/src/components/chat/HomeProfessorMariChat.tsx (+219 -36)
📝 packages/client/src/components/chat/mari/MariComposer.tsx (+40 -38)
➕ packages/client/src/components/chat/mari/MariPendingQueue.tsx (+62 -0)
📝 packages/client/src/components/chat/mari/mari-chat-helpers.tsx (+2 -0)
📝 packages/client/src/components/chat/mari/use-mari-workspace-run.ts (+26 -0)
📝 packages/client/src/localization/locales/en.json (+9 -0)
📝 packages/client/src/styles/mari.css (+103 -54)
📝 packages/server/src/routes/chats.routes.ts (+9 -0)
📝 packages/server/src/routes/professor-mari-workspace.routes.ts (+162 -13)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+44 -1)
📝 packages/server/src/services/professor-mari/workspace-change-review.service.ts (+18 -0)
➕ packages/server/src/services/professor-mari/workspace-pending-store.ts (+284 -0)
📝 packages/shared/src/types/professor-mari-workspace.ts (+35 -0)
📝 scripts/regressions/issue-sweep-5371-5375.regression.ts (+4 -4)
📝 scripts/regressions/open-issues.regression.ts (+1 -1)
➕ scripts/regressions/professor-mari/mari-queue.regression.ts (+392 -0)

📄 Description

Linked issue

Closes #8537
Part of #8533

Why this change

  • While Mari worked, the composer folded away and you could only wait. Modern harnesses let you keep typing and send the next thing when the agent is done. This is that, without changing the Enter-sends setting.

What changed

  • The composer stays open during a run. The fold is gone. Stop sits beside Send, in the existing Stop look, and the Enter sends to Professor Mari setting works as before. Every send key queues while she works, until Send now arrives in the next PR.
  • Queued messages are saved per chat on the server (mari-pending/<chatId>.json in the data folder, cap of 20). Files and @ links wait with them. Mari's own tools cannot read or write that folder.
  • When she finishes cleanly, the next message goes out on the same reply, with its own bubble and answer. A drain never aborts a run in another chat.
  • Stop returns waiting messages to the box, in order, with their files and links.
  • A message is held when she is waiting or something went wrong: a question card, an Accept chip, a held change, a failed run or an app restart. Held rows show Send and ×.
  • Once held, always your call. Send sends only that message, and a new message does not release the others. A new send marks what is already waiting as held, so the list can say so during that run.
  • MariPendingQueue is built on MariRow, the same row as her connection and reference lists.
  • The working gradient stays. It lost its home with the fold, so the band now grows behind the composer and glows above it.
  • Docs: docs/home/professor-mari.md.

Things to know when reviewing

  • Two places a message could be lost remain. The server clears the queue before it aborts, so a Stop whose reply never arrives loses those messages. A crash between taking a message and saving its row loses that one.
  • A narrow race remains. A Stop in the milliseconds before a run takes the slot does nothing, as it did before this PR. Another chat's run starting in those same milliseconds can still replace a drained one.
  • Context attached during a run can be replaced when the run ends, because the end-of-run reload restores the saved context. Your typed text is not affected.
  • Queue size is limited by count, not bytes. Twenty messages with large attachments make a large file, read in full when the queue changes. /status reuses its cached summary until then.
  • A symlink into mari-pending inside the workspace is not followed by the guard. It covers the folder's configured and real paths. The files hold only your own queued messages.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Agent-run, for the reviewer to weigh and not as ticked proof:

  • pnpm check exits 0.
  • These regressions pass: mari-queue, composer-references, issue-sweep-5371, command-center, mari-error-recovery, pi-runtime, shell-sandbox, mari-completion-frames, runtime-recovery. shell-sandbox skipped its runtime proof on this machine.
  • Browser checks with a slow fake local model, before the last round of review fixes: two messages queued and drained in order, Stop returned text in order, a held message survived a reload, × and Send worked, no overflow at phone width, dark and light themes looked right.
  • After those fixes the app was rebuilt and loaded, but the changed client paths were not clicked through. No client tests cover them.

Still to do by hand:

  • Manually verify in the browser that pressing Enter twice quickly sends one message, and that text typed right after sending stays in the box.
  • Manually verify in the browser that a message queued during a run sends after it, with its own bubble and answer.
  • Manually verify in the browser that Stop returns queued text and files to the box.
  • Manually verify in the browser that a message queued during a turn that ends on a question card shows Held, and stays held after you answer.
  • Manually verify in the browser that with two held messages, Send on one sends only that one.
  • Manually verify in the browser that with Enter sends to Professor Mari off, Enter adds a line and Ctrl/Command+Enter queues during a run.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

[docs-i18n] follow-up: #8556

🤖 Generated with Claude Code


🔄 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/8557 **Author:** [@ylli-selmani](https://github.com/ylli-selmani) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ylli-selmani](https://github.com/ylli-selmani) **Base:** `staging` ← **Head:** `feat/mari-queue` --- ### 📝 Commits (4) - [`83a7c2d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/83a7c2de56247ae434abfa577667162a3001e5a0) feat(mari): queue messages while she works - [`73d4e47`](https://github.com/Pasta-Devs/Marinara-Engine/commit/73d4e4768344a179b09a254a6b62d0ece8cb1c23) fix(mari): queue fixes from CI and Dottore - [`7e8c2f1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7e8c2f146b2bf7d4d76ca3610a602078c86f6afd) fix(mari): hold every waiting message a new send did not queue itself - [`ea52436`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ea524361710a90ff6d21db01f926982d31981346) fix(mari): file a late queue answer under the send it was queued during ### 📊 Changes **17 files changed** (+1425 additions, -148 deletions) <details> <summary>View changed files</summary> 📝 `docs/home/professor-mari.md` (+15 -1) 📝 `packages/client/src/components/chat/HomeProfessorMariChat.tsx` (+219 -36) 📝 `packages/client/src/components/chat/mari/MariComposer.tsx` (+40 -38) ➕ `packages/client/src/components/chat/mari/MariPendingQueue.tsx` (+62 -0) 📝 `packages/client/src/components/chat/mari/mari-chat-helpers.tsx` (+2 -0) 📝 `packages/client/src/components/chat/mari/use-mari-workspace-run.ts` (+26 -0) 📝 `packages/client/src/localization/locales/en.json` (+9 -0) 📝 `packages/client/src/styles/mari.css` (+103 -54) 📝 `packages/server/src/routes/chats.routes.ts` (+9 -0) 📝 `packages/server/src/routes/professor-mari-workspace.routes.ts` (+162 -13) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+44 -1) 📝 `packages/server/src/services/professor-mari/workspace-change-review.service.ts` (+18 -0) ➕ `packages/server/src/services/professor-mari/workspace-pending-store.ts` (+284 -0) 📝 `packages/shared/src/types/professor-mari-workspace.ts` (+35 -0) 📝 `scripts/regressions/issue-sweep-5371-5375.regression.ts` (+4 -4) 📝 `scripts/regressions/open-issues.regression.ts` (+1 -1) ➕ `scripts/regressions/professor-mari/mari-queue.regression.ts` (+392 -0) </details> ### 📄 Description ## Linked issue Closes #8537 Part of #8533 ## Why this change - While Mari worked, the composer folded away and you could only wait. Modern harnesses let you keep typing and send the next thing when the agent is done. This is that, without changing the Enter-sends setting. ## What changed - **The composer stays open during a run.** The fold is gone. Stop sits beside Send, in the existing Stop look, and the `Enter sends to Professor Mari` setting works as before. Every send key queues while she works, until Send now arrives in the next PR. - **Queued messages are saved per chat on the server** (`mari-pending/<chatId>.json` in the data folder, cap of 20). Files and `@` links wait with them. Mari's own tools cannot read or write that folder. - **When she finishes cleanly, the next message goes out on the same reply**, with its own bubble and answer. A drain never aborts a run in another chat. - **Stop returns waiting messages to the box**, in order, with their files and links. - **A message is held when she is waiting or something went wrong:** a question card, an Accept chip, a held change, a failed run or an app restart. Held rows show Send and ×. - **Once held, always your call.** Send sends only that message, and a new message does not release the others. A new send marks what is already waiting as `held`, so the list can say so during that run. - **`MariPendingQueue` is built on `MariRow`,** the same row as her connection and reference lists. - **The working gradient stays.** It lost its home with the fold, so the band now grows behind the composer and glows above it. - Docs: `docs/home/professor-mari.md`. ### Things to know when reviewing - **Two places a message could be lost remain.** The server clears the queue before it aborts, so a Stop whose reply never arrives loses those messages. A crash between taking a message and saving its row loses that one. - **A narrow race remains.** A Stop in the milliseconds before a run takes the slot does nothing, as it did before this PR. Another chat's run starting in those same milliseconds can still replace a drained one. - **Context attached during a run can be replaced when the run ends,** because the end-of-run reload restores the saved context. Your typed text is not affected. - **Queue size is limited by count, not bytes.** Twenty messages with large attachments make a large file, read in full when the queue changes. `/status` reuses its cached summary until then. - **A symlink into `mari-pending` inside the workspace is not followed by the guard.** It covers the folder's configured and real paths. The files hold only your own queued messages. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Agent-run, for the reviewer to weigh and not as ticked proof: - `pnpm check` exits 0. - These regressions pass: `mari-queue`, `composer-references`, `issue-sweep-5371`, `command-center`, `mari-error-recovery`, `pi-runtime`, `shell-sandbox`, `mari-completion-frames`, `runtime-recovery`. `shell-sandbox` skipped its runtime proof on this machine. - Browser checks with a slow fake local model, before the last round of review fixes: two messages queued and drained in order, Stop returned text in order, a held message survived a reload, × and Send worked, no overflow at phone width, dark and light themes looked right. - After those fixes the app was rebuilt and loaded, but the changed client paths were not clicked through. No client tests cover them. Still to do by hand: - Manually verify in the browser that pressing Enter twice quickly sends one message, and that text typed right after sending stays in the box. - Manually verify in the browser that a message queued during a run sends after it, with its own bubble and answer. - Manually verify in the browser that Stop returns queued text and files to the box. - Manually verify in the browser that a message queued during a turn that ends on a question card shows Held, and stays held after you answer. - Manually verify in the browser that with two held messages, Send on one sends only that one. - Manually verify in the browser that with `Enter sends to Professor Mari` off, Enter adds a line and Ctrl/Command+Enter queues during a run. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README) as needed - [x] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) `[docs-i18n]` follow-up: #8556 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:46: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#8669
No description provided.