[PR #8545] [MERGED] feat(mari): ask questions on a card that ends her turn #8662

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

📋 Pull Request Information

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

Base: staging ← Head: feat/mari-ask-tool


📝 Commits (6)

  • 8f2693e feat(mari): ask questions on a card that ends her turn
  • 5b306ac fix(mari): count question cards the schema rejects
  • 4efbdde test(mari): let the header count include a question card
  • 534fd0d fix(mari): keep held writes out of the record, let checkboxes toggle fast
  • 43e6b4e fix(mari): stop a double-click reaching the next question's checkboxes
  • 94b3f34 fix(mari): stop a double-click on Back from re-picking an answer

📊 Changes

19 files changed (+833 additions, -152 deletions)

View changed files

📝 docs/home/professor-mari.md (+2 -2)
📝 packages/client/src/components/chat/HomeProfessorMariChat.tsx (+30 -42)
📝 packages/client/src/components/chat/mari/MariOmnibarHeaderChrome.tsx (+5 -2)
➕ packages/client/src/components/chat/mari/MariQuestionCard.tsx (+145 -0)
📝 packages/client/src/components/chat/mari/MariTranscript.tsx (+0 -20)
📝 packages/client/src/components/chat/mari/use-mari-workspace-run.ts (+0 -13)
📝 packages/client/src/localization/locales/en.json (+7 -0)
📝 packages/client/src/styles/mari.css (+47 -0)
📝 packages/server/src/services/professor-mari/guided-sequences.ts (+13 -0)
📝 packages/server/src/services/professor-mari/pi-runtime.ts (+114 -26)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+68 -39)
📝 packages/server/src/services/professor-mari/workspace-message-store.ts (+19 -2)
📝 packages/server/src/services/professor-mari/workspace-skills.service.ts (+1 -1)
📝 packages/shared/src/types/chat.ts (+2 -0)
📝 packages/shared/src/types/professor-mari-workspace.ts (+99 -1)
📝 scripts/regressions/command-center.regression.ts (+2 -2)
📝 scripts/regressions/mari-polish.regression.ts (+1 -1)
📝 scripts/regressions/mari/suggestions.regression.ts (+45 -0)
📝 scripts/regressions/professor-mari/pi-runtime.regression.ts (+233 -1)

📄 Description

Linked issue

Closes #8536
Part of #8533

Why this change

  • Mari could not ask a real question and wait. Her guided plan advanced chips locally and filled a draft, so what the user chose was never her next turn. Modern harnesses end the turn on a question card, and the answer is the next message.

What changed

  • New ask tool on the pi and classic runtimes, replacing plan in the workspace. It takes 1-4 questions with 2-4 options each, an optional recommended pick and an optional multi-select. Calling it ends her turn. plan stays for in-chat Mari, which still uses it.
  • Changes beside a question do not run. A write sent in the same turn as ask, even an invalid ask, neither runs nor waits behind Accept. She is told why and can make the change after the answer. Three invalid cards in a run end it, so a stuck model does not pay for rounds up to the limit.
  • MariQuestionCard, built on the MariHeldChangeCard frame and MariRow options. It shows one question at a time with Back, Next and Submit, and has a field for a typed answer. The header shows "Needs you", and chips are hidden while a card is up.
  • The card is saved on the assistant row (extra.mariQuestions), so a reload keeps it. There is no SSE event and no store. Submit sends the answers as the next user message, and any later user message removes the card. There is no resolved card, because her words and the answer bubble are the record.
  • She still knows the question if the user types instead. History only replays row text, so the card's questions go first in mariWorkspaceContinuity, which is cut to length from the end.
  • Docs: docs/home/professor-mari.md.

Things to know when reviewing

  • Partial answers are allowed. Submit needs one answer, and she only sees the lines that were answered.
  • Existing installs keep the old example skill text. It is seeded once, is disabled by default and is user-editable, so it can still say plan. On pi, a skill that gets followed gets an unknown-tool error she can recover from. I left this alone rather than rewrite user-editable data.

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, with one lint warning (serverRun in a useEffect).
  • These regressions pass: professor-mari/pi-runtime, mari/suggestions, professor-mari/round-review, mari/review-cards, prompt, mari/example-skill, mari-polish.
  • Browser checks on seeded rows with the network stubbed, so no model was called: the card renders, the header says "Needs you · 1 choice waiting", steps and multi-select work, and Submit sends the expected text. At 375px there is no overflow, rows are 52px and the input is 17px.

Not yet checked. Manually verify in the browser:

  1. Run Mari with a real model on pi. Give her a vague create request ("make me an isekai character") and confirm she asks on a card.
  2. Pick options, press Submit, and confirm your answers appear as your message and she continues from them.
  3. Repeat on the classic runtime.
  4. With a card up, reload the page and confirm the card is still there.
  5. With a card up, type a message in the composer instead and confirm the card goes away and she reads your message as the answer.
  6. Check the card in light mode and in the sillytavern theme. Only the dark default was seen.

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/home/professor-mari.md is updated, and the [docs-i18n] follow-up is #8544.

UI evidence (if applicable)

To be added from the manual run above.

🤖 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/8545 **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-ask-tool` --- ### 📝 Commits (6) - [`8f2693e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8f2693ee7be884a8d2ced93c768c2568a733395c) feat(mari): ask questions on a card that ends her turn - [`5b306ac`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5b306ac57f3e360c71322caf177a90f996d56145) fix(mari): count question cards the schema rejects - [`4efbdde`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4efbdde7c8dddfcec222355ed219a1e84989f742) test(mari): let the header count include a question card - [`534fd0d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/534fd0d23048b6ed3c95f7751c1b1cc2ad71bdbe) fix(mari): keep held writes out of the record, let checkboxes toggle fast - [`43e6b4e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/43e6b4e0fc8ff1dc2ba1a8769bd88faf4cdbff0b) fix(mari): stop a double-click reaching the next question's checkboxes - [`94b3f34`](https://github.com/Pasta-Devs/Marinara-Engine/commit/94b3f345a635408e91d6988cca4f5fedafe7e680) fix(mari): stop a double-click on Back from re-picking an answer ### 📊 Changes **19 files changed** (+833 additions, -152 deletions) <details> <summary>View changed files</summary> 📝 `docs/home/professor-mari.md` (+2 -2) 📝 `packages/client/src/components/chat/HomeProfessorMariChat.tsx` (+30 -42) 📝 `packages/client/src/components/chat/mari/MariOmnibarHeaderChrome.tsx` (+5 -2) ➕ `packages/client/src/components/chat/mari/MariQuestionCard.tsx` (+145 -0) 📝 `packages/client/src/components/chat/mari/MariTranscript.tsx` (+0 -20) 📝 `packages/client/src/components/chat/mari/use-mari-workspace-run.ts` (+0 -13) 📝 `packages/client/src/localization/locales/en.json` (+7 -0) 📝 `packages/client/src/styles/mari.css` (+47 -0) 📝 `packages/server/src/services/professor-mari/guided-sequences.ts` (+13 -0) 📝 `packages/server/src/services/professor-mari/pi-runtime.ts` (+114 -26) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+68 -39) 📝 `packages/server/src/services/professor-mari/workspace-message-store.ts` (+19 -2) 📝 `packages/server/src/services/professor-mari/workspace-skills.service.ts` (+1 -1) 📝 `packages/shared/src/types/chat.ts` (+2 -0) 📝 `packages/shared/src/types/professor-mari-workspace.ts` (+99 -1) 📝 `scripts/regressions/command-center.regression.ts` (+2 -2) 📝 `scripts/regressions/mari-polish.regression.ts` (+1 -1) 📝 `scripts/regressions/mari/suggestions.regression.ts` (+45 -0) 📝 `scripts/regressions/professor-mari/pi-runtime.regression.ts` (+233 -1) </details> ### 📄 Description ## Linked issue Closes #8536 Part of #8533 ## Why this change - Mari could not ask a real question and wait. Her guided `plan` advanced chips locally and filled a draft, so what the user chose was never her next turn. Modern harnesses end the turn on a question card, and the answer is the next message. ## What changed - **New `ask` tool on the pi and classic runtimes, replacing `plan` in the workspace.** It takes 1-4 questions with 2-4 options each, an optional recommended pick and an optional multi-select. Calling it ends her turn. `plan` stays for in-chat Mari, which still uses it. - **Changes beside a question do not run.** A write sent in the same turn as `ask`, even an invalid `ask`, neither runs nor waits behind Accept. She is told why and can make the change after the answer. Three invalid cards in a run end it, so a stuck model does not pay for rounds up to the limit. - **`MariQuestionCard`, built on the `MariHeldChangeCard` frame and `MariRow` options.** It shows one question at a time with Back, Next and Submit, and has a field for a typed answer. The header shows "Needs you", and chips are hidden while a card is up. - **The card is saved on the assistant row (`extra.mariQuestions`), so a reload keeps it.** There is no SSE event and no store. Submit sends the answers as the next user message, and any later user message removes the card. There is no resolved card, because her words and the answer bubble are the record. - **She still knows the question if the user types instead.** History only replays row text, so the card's questions go first in `mariWorkspaceContinuity`, which is cut to length from the end. - Docs: `docs/home/professor-mari.md`. ### Things to know when reviewing - **Partial answers are allowed.** Submit needs one answer, and she only sees the lines that were answered. - **Existing installs keep the old example skill text.** It is seeded once, is disabled by default and is user-editable, so it can still say `plan`. On pi, a skill that gets followed gets an unknown-tool error she can recover from. I left this alone rather than rewrite user-editable data. ## 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, with one lint warning (`serverRun` in a `useEffect`). - These regressions pass: `professor-mari/pi-runtime`, `mari/suggestions`, `professor-mari/round-review`, `mari/review-cards`, `prompt`, `mari/example-skill`, `mari-polish`. - Browser checks on seeded rows with the network stubbed, so no model was called: the card renders, the header says "Needs you · 1 choice waiting", steps and multi-select work, and Submit sends the expected text. At 375px there is no overflow, rows are 52px and the input is 17px. **Not yet checked. Manually verify in the browser:** 1. Run Mari with a real model on pi. Give her a vague create request ("make me an isekai character") and confirm she asks on a card. 2. Pick options, press Submit, and confirm your answers appear as your message and she continues from them. 3. Repeat on the classic runtime. 4. With a card up, reload the page and confirm the card is still there. 5. With a card up, type a message in the composer instead and confirm the card goes away and she reads your message as the answer. 6. Check the card in light mode and in the `sillytavern` theme. Only the dark default was seen. ## 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/home/professor-mari.md` is updated, and the `[docs-i18n]` follow-up is #8544. ## UI evidence (if applicable) To be added from the manual run above. 🤖 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:19 +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#8662
No description provided.