[PR #8805] [MERGED] Help Home Mari deliver quick replies on weaker models #8816

Closed
opened 2026-11-07 17:39:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix/mari-suggestion-recovery


📝 Commits (4)

  • a6bb2ce Teach Mari how to finish with a quick reply
  • 7a491f9 Recover passive quick replies from Mari's trailing chip block
  • a1684fb Keep streamed tags hidden across every token boundary
  • 6466e8f Scrub recovered Classic chip labels before display and history

📊 Changes

6 files changed (+173 additions, -19 deletions)

View changed files

📝 packages/server/src/services/professor-mari/pi-runtime.ts (+20 -2)
➕ packages/server/src/services/professor-mari/suggestion-suffix.ts (+53 -0)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+22 -15)
📝 scripts/regressions/professor-mari/action-result.regression.ts (+6 -0)
📝 scripts/regressions/professor-mari/builtin-skills.regression.ts (+4 -1)
📝 scripts/regressions/professor-mari/pi-runtime.regression.ts (+68 -1)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #8803
Closes #8804

Why this change

Home Mari sometimes writes useful quick replies as XML after her answer. The composer then has no buttons, and the XML stays in chat history. We can recover the intended choices locally.

What changed

  • Home Mari recovers a trailing suggestion block containing passive chip rows, including Gemma’s doubled wrapper. The answer and chips are saved separately. The draft holds back the suffix across split tokens. Fenced examples and unsupported rows remain visible in the final answer.
  • Classic now turns internal tool names in recovered button labels into the same readable wording used for structured suggestions, including in saved history. Tapping a chip still sends the original prompt.
  • Pi gives a positive example of real quick replies and resolves conflicting guidance about whether the final answer can include a suggestions call. Text-tool connections see a valid JSON call in their own format.

Validation

At 6466e8f8c9 the Classic label regression failed before the fix and passed afterward. The Pi runtime suite and pnpm check also passed, and local CodeRabbit returned zero findings on the repair diff.

At a1684fb729, pnpm check and both focused regression suites (pi-runtime and builtin-skills) passed. The fixture streams the screenshot shape character by character and verifies three persisted chips in one request for both Pi and Classic. It also covers native-chip precedence and literal examples.

A live Home workspace run with Gemma 4 31B on NanoGPT auto-routing emitted a suggestion event and saved prose plus three chips. A separate direct old/new Pi prompt comparison with the same follow-up question and suggestions tool produced three native chips and no XML in both arms, one request each. This pair does not establish a change in failure rate.

CodeRabbit reviewed the branch and the follow-up. Three suggestions were declined after tracing them. Adding a synthetic UI call next to todo would change Pi’s turn termination. Replacing prior structured suggestions would violate the priority assigned to them. The requested negative prompt assertion already exercises the assembled native prompt in pi-runtime.regression.ts.

  • 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

  • Manually verify quick replies appear after a Home Mari answer. Reopen the chat, verify the three chips are available, and tap one to send its prompt.
  • Manually verify a confirmed character edit still opens the correct character from its folded and expanded receipt.
  • Manually verify a fenced XML example stays readable and an ask card takes precedence.

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)

UI evidence (if applicable)

Server-side behavior. Live API and persistence tested. The maintainer also tested quick replies successfully with Gemma 4 31B on the NanoGPT SCX (Global) BF16 route. Lower-precision local inference has not been tested.


🔄 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/8805 **Author:** [@ylli-selmani](https://github.com/ylli-selmani) **Created:** 11/4/2026 **Status:** ✅ Merged **Merged:** 11/4/2026 **Merged by:** [@ylli-selmani](https://github.com/ylli-selmani) **Base:** `staging` ← **Head:** `fix/mari-suggestion-recovery` --- ### 📝 Commits (4) - [`a6bb2ce`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a6bb2ceb6502d57e2e619626b62f5c7bf9b49d62) Teach Mari how to finish with a quick reply - [`7a491f9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7a491f996d07598779106699dc2bf7d364f2b139) Recover passive quick replies from Mari's trailing chip block - [`a1684fb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a1684fb7297ffcb6eacea5b0e8dc82c9c43c9e16) Keep streamed tags hidden across every token boundary - [`6466e8f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6466e8f8c9ed40192f761ad2ab4f97adf82581bd) Scrub recovered Classic chip labels before display and history ### 📊 Changes **6 files changed** (+173 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/professor-mari/pi-runtime.ts` (+20 -2) ➕ `packages/server/src/services/professor-mari/suggestion-suffix.ts` (+53 -0) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+22 -15) 📝 `scripts/regressions/professor-mari/action-result.regression.ts` (+6 -0) 📝 `scripts/regressions/professor-mari/builtin-skills.regression.ts` (+4 -1) 📝 `scripts/regressions/professor-mari/pi-runtime.regression.ts` (+68 -1) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> Closes #8803 Closes #8804 ## Why this change Home Mari sometimes writes useful quick replies as XML after her answer. The composer then has no buttons, and the XML stays in chat history. We can recover the intended choices locally. ## What changed - Home Mari recovers a trailing suggestion block containing passive chip rows, including Gemma’s doubled wrapper. The answer and chips are saved separately. The draft holds back the suffix across split tokens. Fenced examples and unsupported rows remain visible in the final answer. - Classic now turns internal tool names in recovered button labels into the same readable wording used for structured suggestions, including in saved history. Tapping a chip still sends the original prompt. - Pi gives a positive example of real quick replies and resolves conflicting guidance about whether the final answer can include a suggestions call. Text-tool connections see a valid JSON call in their own format. ## Validation At 6466e8f8c9 the Classic label regression failed before the fix and passed afterward. The Pi runtime suite and pnpm check also passed, and local CodeRabbit returned zero findings on the repair diff. At a1684fb729, pnpm check and both focused regression suites (pi-runtime and builtin-skills) passed. The fixture streams the screenshot shape character by character and verifies three persisted chips in one request for both Pi and Classic. It also covers native-chip precedence and literal examples. A live Home workspace run with Gemma 4 31B on NanoGPT auto-routing emitted a suggestion event and saved prose plus three chips. A separate direct old/new Pi prompt comparison with the same follow-up question and suggestions tool produced three native chips and no XML in both arms, one request each. This pair does not establish a change in failure rate. CodeRabbit reviewed the branch and the follow-up. Three suggestions were declined after tracing them. Adding a synthetic UI call next to todo would change Pi’s turn termination. Replacing prior structured suggestions would violate the priority assigned to them. The requested negative prompt assertion already exercises the assembled native prompt in pi-runtime.regression.ts. - [ ] `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 - Manually verify quick replies appear after a Home Mari answer. Reopen the chat, verify the three chips are available, and tap one to send its prompt. - Manually verify a confirmed character edit still opens the correct character from its folded and expanded receipt. - Manually verify a fenced XML example stays readable and an ask card takes precedence. ## 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) ## UI evidence (if applicable) Server-side behavior. Live API and persistence tested. The maintainer also tested quick replies successfully with Gemma 4 31B on the NanoGPT SCX (Global) BF16 route. Lower-precision local inference has not been tested. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:39:55 +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#8816
No description provided.