[PR #7533] [MERGED] Professor Mari: Accept applies the held change on the server #7780

Closed
opened 2026-10-24 04:07:27 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7533
Author: @Gunterlie
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @Gunterlie

Base: feat/mari-pi-runtime ← Head: feat/mari-pi-runtime-3-accept


📝 Commits (3)

  • c156b8e Apply the stored held calls on Accept without a model request
  • 407382f Accept applies only what the card showed, once, and a repaired round drops its hold
  • 666c1b9 Offer suggestions on the pi runtime: chip rules in its prompt and the one chips-only round

📊 Changes

6 files changed (+316 additions, -17 deletions)

View changed files

📝 packages/server/src/services/professor-mari/pi-runtime.ts (+52 -5)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+103 -9)
📝 packages/server/src/services/professor-mari/workspace-message-store.ts (+6 -1)
📝 packages/shared/src/types/chat.ts (+2 -0)
📝 scripts/regressions/mari-permissions-mode.regression.ts (+1 -1)
📝 scripts/regressions/professor-mari/pi-runtime.regression.ts (+152 -1)

📄 Description

Linked issue

No linked issue. This is planned work: slice 3 on the integration branch feat/mari-pi-runtime. It is stacked on slice 2 (#7523) and targets that branch, so the diff shows only this slice.

Why this change

  • When Professor Mari holds a change, the Accept button only sent the text "I accept the proposed change." to the model. The model then had to issue the same change again.
  • Weaker models fail that step on both runtimes. In real-model tests MiniMax M3 answered that the change was done with no tool call, invented a record id, or held the change a second time.
  • The user approved a specific change on a card. The app should apply exactly that change, not ask a model to repeat it.

What changed

  • A held run now stores its raw held calls on the message (extra.mariHeldCalls), next to the descriptions the card shows. Classic and pi both.
  • When the next user message is exactly the Accept chip prompt and the last answer was a hold, the server runs the stored calls through the normal command executor, writes a fixed answer ("Done. I applied the change you accepted.") and ends the run. No model request.
  • Permissions Mode floors and sensitive-change staging still apply in the executor: Accept after a switch to Plan applies nothing and says so.
  • Server-side Accept runs only when the card listed every held call (at most 8). A larger hold goes to the model as before.
  • A held message can be accepted once. A second Accept for the same message (two tabs) is refused.
  • Classic: a round that claim repair discards no longer leaves a stale hold on the saved message.
  • A run with no model request stores no usage, so the context meter keeps its last real reading.
  • A typed reply ("yes", "do it") keeps the old path through the model.

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

Not done by a person yet. To verify by hand:

  • Manually verify in Manual mode, on Classic and on Pi: ask for an edit, press Accept, check that the change card and Undo appear and the answer comes at once.
  • Manually verify Accept with a weak model (MiniMax M3) on both runtimes.
  • Manually verify "Don't apply" still applies nothing.
  • Manually verify a typed "yes" still works.
  • Manually verify Accept after a switch to Plan mode applies nothing and shows the reason.
  • Manually verify the context meter after an Accept.

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)

No client change.

Proof

Run by agents on commit 407382f40:

  • pnpm check: exit 0. Server typecheck clean.
  • node ./scripts/run-regressions.mjs --filter mari: 50/50 passed.
  • scripts/regressions/professor-mari/pi-runtime.regression.ts, on pi and on classic with a scripted provider: Accept applies the stored call with zero model requests; Accept in Plan applies nothing; a typed "yes" reaches the model; nine held calls are not applied by the server; the Accept message stores no usage.
  • Read-only adversarial review (Opus): 4 findings (card listed 8 of N calls, stale hold after classic claim repair, double Accept, context meter at 0%). All four are fixed in this branch. Cleared: Professor Mari cannot forge mariHeldCalls (raw writes to messages are refused), floors hold, end of run is sane.
  • Local CodeRabbit: 2 findings, both left unchanged. (1) Type guard on the stored tool name: unknown names are already dropped by the mutating-command filter. (2) The held call can overwrite an edit the user made between hold and Accept: the model path had the same behavior, and the change card with Undo covers app data.

Known limits:

  • No real-model run and no browser run for this slice.
  • The card shows at most 12 fields of one held change; Accept applies all fields of that change.
  • The stale-hold fix in classic and the single-use guard have no dedicated regression case.
  • The single-use guard is in memory and is lost on a server restart.
  • The fixed answers are server English, like the other server status lines.

🔄 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/7533 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `feat/mari-pi-runtime` ← **Head:** `feat/mari-pi-runtime-3-accept` --- ### 📝 Commits (3) - [`c156b8e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c156b8e7191f0fe51f82e4040220b24df3aafef5) Apply the stored held calls on Accept without a model request - [`407382f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/407382f40838daef6eaf0e65f2beb165a67429ab) Accept applies only what the card showed, once, and a repaired round drops its hold - [`666c1b9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/666c1b934eb0c243255ae05ef6b1b16b630827dc) Offer suggestions on the pi runtime: chip rules in its prompt and the one chips-only round ### 📊 Changes **6 files changed** (+316 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/professor-mari/pi-runtime.ts` (+52 -5) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+103 -9) 📝 `packages/server/src/services/professor-mari/workspace-message-store.ts` (+6 -1) 📝 `packages/shared/src/types/chat.ts` (+2 -0) 📝 `scripts/regressions/mari-permissions-mode.regression.ts` (+1 -1) 📝 `scripts/regressions/professor-mari/pi-runtime.regression.ts` (+152 -1) </details> ### 📄 Description ## Linked issue No linked issue. This is planned work: slice 3 on the integration branch `feat/mari-pi-runtime`. It is stacked on slice 2 (#7523) and targets that branch, so the diff shows only this slice. ## Why this change - When Professor Mari holds a change, the Accept button only sent the text "I accept the proposed change." to the model. The model then had to issue the same change again. - Weaker models fail that step on both runtimes. In real-model tests MiniMax M3 answered that the change was done with no tool call, invented a record id, or held the change a second time. - The user approved a specific change on a card. The app should apply exactly that change, not ask a model to repeat it. ## What changed - A held run now stores its raw held calls on the message (`extra.mariHeldCalls`), next to the descriptions the card shows. Classic and pi both. - When the next user message is exactly the Accept chip prompt and the last answer was a hold, the server runs the stored calls through the normal command executor, writes a fixed answer ("Done. I applied the change you accepted.") and ends the run. No model request. - Permissions Mode floors and sensitive-change staging still apply in the executor: Accept after a switch to Plan applies nothing and says so. - Server-side Accept runs only when the card listed every held call (at most 8). A larger hold goes to the model as before. - A held message can be accepted once. A second Accept for the same message (two tabs) is refused. - Classic: a round that claim repair discards no longer leaves a stale hold on the saved message. - A run with no model request stores no usage, so the context meter keeps its last real reading. - A typed reply ("yes", "do it") keeps the old path through the model. ## 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 Not done by a person yet. To verify by hand: - Manually verify in Manual mode, on Classic and on Pi: ask for an edit, press Accept, check that the change card and Undo appear and the answer comes at once. - Manually verify Accept with a weak model (MiniMax M3) on both runtimes. - Manually verify "Don't apply" still applies nothing. - Manually verify a typed "yes" still works. - Manually verify Accept after a switch to Plan mode applies nothing and shows the reason. - Manually verify the context meter after an Accept. ## 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) No client change. ## Proof Run by agents on commit `407382f40`: - `pnpm check`: exit 0. Server typecheck clean. - `node ./scripts/run-regressions.mjs --filter mari`: 50/50 passed. - `scripts/regressions/professor-mari/pi-runtime.regression.ts`, on pi and on classic with a scripted provider: Accept applies the stored call with zero model requests; Accept in Plan applies nothing; a typed "yes" reaches the model; nine held calls are not applied by the server; the Accept message stores no usage. - Read-only adversarial review (Opus): 4 findings (card listed 8 of N calls, stale hold after classic claim repair, double Accept, context meter at 0%). All four are fixed in this branch. Cleared: Professor Mari cannot forge `mariHeldCalls` (raw writes to messages are refused), floors hold, end of run is sane. - Local CodeRabbit: 2 findings, both left unchanged. (1) Type guard on the stored tool name: unknown names are already dropped by the mutating-command filter. (2) The held call can overwrite an edit the user made between hold and Accept: the model path had the same behavior, and the change card with Undo covers app data. Known limits: - No real-model run and no browser run for this slice. - The card shows at most 12 fields of one held change; Accept applies all fields of that change. - The stale-hold fix in classic and the single-use guard have no dedicated regression case. - The single-use guard is in memory and is lost on a server restart. - The fixed answers are server English, like the other server status lines. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:07:27 +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#7780
No description provided.