[PR #2816] [MERGED] Stabilize Professor Mari JSON command runtime #5749

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2816
Author: @ghost
Created: 6/23/2026
Status: ✅ Merged
Merged: 6/23/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/professor-mari-json-protocol-repair


📝 Commits (7)

  • 719e1b2 Merge pull request #2810 from Pasta-Devs/release/v2.0.1-to-main
  • 395b900 Fix mobile editor navigation and lorebook controls
  • e796c44 Merge pull request #2814 from Pasta-Devs/codex/mobile-editor-lorebook-fixes-main
  • 204717b Repair Professor Mari JSON command protocol history
  • 61f9e66 Merge branch 'main' into codex/professor-mari-json-protocol-repair
  • e388841 Merge branch 'staging' into codex/professor-mari-json-protocol-repair
  • bb5cf63 Merge branch 'staging' into codex/professor-mari-json-protocol-repair

📊 Changes

1 file changed (+147 additions, -71 deletions)

View changed files

📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+147 -71)

📄 Description

Summary

Stabilizes Professor Mari workspace command mode so it stays provider-agnostic, JSON-only, and resilient across multi-round workspace tasks.

What changed

  • Removes model-facing native tool/function-call protocol from Professor Mari workspace behavior.
  • Uses a strict JSON-only assistant schema:
    {"say":"...","commands":[],"stop":true}                                                                                                                                
    
                                                                                                                                                                           
- Keeps user-visible text inside say; no prose, markdown, XML, or code fences outside JSON.                                                                                
- Adds stop handling so stop:false continues workspace loops and stop:true finalizes.                                                                                      
- Parses/removes multiple JSON action frames safely.                                                                                                                       
- Ignores prose outside valid JSON frames as protocol leakage.                                                                                                             
- Keeps tolerant internal parsing for older aliases/formats without teaching those formats in the prompt.                                                                  
- Repairs non-JSON/no-command replies instead of immediately stopping Professor Mari.                                                                                      
- Preserves hidden assistant history as normalized JSON so later model turns do not learn from plain prose assistant examples.                                             
- Wraps stored Professor Mari assistant messages as JSON when replaying them into model context.                                                                           
- Keeps Professor Mari’s voice/personality and concise app-data command guidance.                                                                                          
                                                                                                                                                                           
Why                                                                                                                                                                        
                                                                                                                                                                           
Professor Mari could drift into plain prose during longer workspace tasks, especially after command results. Since the runtime previously replayed only visible say text   
into assistant history, later model turns saw plain-prose assistant examples and became more likely to stop emitting JSON. This caused long jobs like bulk lorebook        
creation to stop early.                                                                                                                                                    
                                                                                                                                                                           
This change keeps the protocol consistent across turns and avoids relying on provider-native tool/function calling.                                                        
                                                                                                                                                                           
Validation                                                                                                                                                                 
                                                                                                                                                                           
- pnpm --filter @marinara-engine/server lint                                                                                                                               
- pnpm check                                                                                                                                                               
                                                                                                                                                                           
Note: validation emitted the existing Node engine warning for Node v22 vs required >=24 <26. 

---

<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/2816 **Author:** [@ghost](https://github.com/ghost) **Created:** 6/23/2026 **Status:** ✅ Merged **Merged:** 6/23/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/professor-mari-json-protocol-repair` --- ### 📝 Commits (7) - [`719e1b2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/719e1b29f272643732bb160d4c3b2009f421da81) Merge pull request #2810 from Pasta-Devs/release/v2.0.1-to-main - [`395b900`](https://github.com/Pasta-Devs/Marinara-Engine/commit/395b9001ed04150dda159e31e46f1d0503bf4c5e) Fix mobile editor navigation and lorebook controls - [`e796c44`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e796c44e44b4c3df9e9e016bbde822bfe964d32d) Merge pull request #2814 from Pasta-Devs/codex/mobile-editor-lorebook-fixes-main - [`204717b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/204717b41ea03c8827f1ba54a8f4f8a6442c65d5) Repair Professor Mari JSON command protocol history - [`61f9e66`](https://github.com/Pasta-Devs/Marinara-Engine/commit/61f9e668e6f43aed7bc999dc2321156a1649cbf4) Merge branch 'main' into codex/professor-mari-json-protocol-repair - [`e388841`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e3888418b1876bf0fa7a273353b26e39c05562d7) Merge branch 'staging' into codex/professor-mari-json-protocol-repair - [`bb5cf63`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bb5cf6366c3583c0af48058bbe8636c98c0b536f) Merge branch 'staging' into codex/professor-mari-json-protocol-repair ### 📊 Changes **1 file changed** (+147 additions, -71 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+147 -71) </details> ### 📄 Description ## Summary Stabilizes Professor Mari workspace command mode so it stays provider-agnostic, JSON-only, and resilient across multi-round workspace tasks. ## What changed - Removes model-facing native tool/function-call protocol from Professor Mari workspace behavior. - Uses a strict JSON-only assistant schema: ```json {"say":"...","commands":[],"stop":true} ``` - Keeps user-visible text inside say; no prose, markdown, XML, or code fences outside JSON. - Adds stop handling so stop:false continues workspace loops and stop:true finalizes. - Parses/removes multiple JSON action frames safely. - Ignores prose outside valid JSON frames as protocol leakage. - Keeps tolerant internal parsing for older aliases/formats without teaching those formats in the prompt. - Repairs non-JSON/no-command replies instead of immediately stopping Professor Mari. - Preserves hidden assistant history as normalized JSON so later model turns do not learn from plain prose assistant examples. - Wraps stored Professor Mari assistant messages as JSON when replaying them into model context. - Keeps Professor Mari’s voice/personality and concise app-data command guidance. Why Professor Mari could drift into plain prose during longer workspace tasks, especially after command results. Since the runtime previously replayed only visible say text into assistant history, later model turns saw plain-prose assistant examples and became more likely to stop emitting JSON. This caused long jobs like bulk lorebook creation to stop early. This change keeps the protocol consistent across turns and avoids relying on provider-native tool/function calling. Validation - pnpm --filter @marinara-engine/server lint - pnpm check Note: validation emitted the existing Node engine warning for Node v22 vs required >=24 <26. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:19:10 +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#5749
No description provided.