[GH-ISSUE #5966] Mari says an edit is done but nothing is staged: no approve/deny card, and the user's callout is then refused #3306

Closed
opened 2026-10-21 06:01:51 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @kolacheee on GitHub (Sep 8, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5966

Originally assigned to: @SpicyMarinara on GitHub.

Reported by a user (2026-09-07)

I have had this issue with k3, glm5.3 and others. Mari will say an edit is done, but you get no approve/deny, so you tell Mari "hey you didn't do it", and Mari is like "oh yeah let me do it now". Sometimes it takes 3 or 4 tries to get the edit to actually post.

Models named are Kimi K3 and GLM 5.3 — non-Claude endpoints behind the OpenAI-compatible provider.

Short version

A fix for this did not go out. The completion-claim guard from #5819/#5830 (PR #5893) merged to staging on 2026-09-06 and has never been released — the newest stable is v2.4.4, published 2026-08-25, whose tag commit is identical to the main tip. auditWorkspaceCompletionClaim does not exist anywhere on main. The issues were closed on merge, which is almost certainly why it looked shipped. Stable is also the default update channel, so a user is on v2.4.4 unless they opted out.

But shipping staging alone would not fix this user either. The report is four independent defects stacked, and only one of them is fixed on staging. Each is separately actionable — happy to split this into four issues if you'd rather.

1. The prompt's own example tells Mari to send apply:false for an edit

workspace-agent.service.ts — main:739, staging:763:

{"action":"lorebook.updateEntry","entryId":"entry-id","patch":{"content":"new content"},"reason":"Update requested by user","apply":false}

That example sits inside the "Direct request to make that change — act on it" block, unlabeled, directly between an agent.create example with apply:true and a lorebook.deleteEntry example with apply:true. Nothing marks it as a deliberate preview.

This matters because the apply default is inverted between creates and edits:

  • creates: appDataCreateApply = firstBoolean(source, ["apply"]) !== false (services/mari-db/mari-db.service.ts:955) → applies unless told otherwise
  • updates / deletes / setActive / moveToFolder: firstBoolean(args, ["apply"]) === true — 20 sites on both branches → previews unless told otherwise

A dry run returns ok:true, exit code 0, and approval:not_required. It stages nothing, so no approve/deny card appears — and from the model's point of view the command succeeded, so it reports success. The schema the model sees is a bare undocumented boolean with only action required.

A model that copies the nearest matching example for lorebook.updateEntry gets apply:false verbatim. "Creates work, edits silently don't" is exactly the shape the user describes.

2. A malformed command block is dropped silently

Mari uses a text JSON protocol — no native tool calling — and JSON mode is only requested for openrouter (staging:218-220), so nanogpt/custom/xai/mistral/arli/cohere run with no structured-output enforcement.

Her own reader (rawJsonToolCalls staging:1187, parseJsonCommandCallsFromPayload staging:1196) is much stricter than the engine's tolerant salvage parser in textual-tool-call-parser.ts: commands must be an Array, and arguments come only from arguments|args|input — no tool, no {type:"function",function:{…}}, no tool_name, no parameters. Unrecognized entries hit a bare return at staging:1209 with no log, no status, no trace.

The tolerant parser cannot rescue it, because removeJsonActionFrames strips the frame before it runs (staging:1367-1369), and provider-side salvage is gated on options.tools?.length (openai.provider.ts:1649/1848), which Mari never sets.

The frame then keeps protocolValid=true and computes stop=true, so every repair branch is bypassed and the loop breaks having streamed "I've updated it" with zero commands executed — no card, zero repair rounds spent.

Honest limit: the sub-agent verified this by running the repo's own parser against seven plausible reply shapes (five yield zero commands, one erases the payload). What is not proven is that K3 and GLM 5.3 specifically emit those shapes — nothing currently captures a raw reply, so that link is inference. A debug capture of one failing reply would settle it, and would be worth having regardless.

3. The completion-claim detector misses how these models actually talk

workspaceTextClaimsMutationCompletion (staging:1979-1996, main:2004-2012) only matches I/we/it/that + verb or is/was/has been + verb against a fixed verb list. Verified by executing the shipped regexes:

  • Verbs missing from the list: added, applied, edited, modified, set, inserted, made, completed. So even clean English misses — "I added the entry to the lorebook." is not detected. "Added" is the most natural verb for lorebook work.
  • Bare participles miss: Done! · Created the entry. · Updated. · Edit applied.
  • A curly apostrophe defeats it: I've created the entry. catches; I’ve created the entry. (U+2019) does not.
  • Any adverb but "successfully" breaks it: "I have now updated the card.", "I just created the entry." — both miss.
  • English only.

When it misses, staging:2089 returns early and the entire guard — every branch, both escape hatches, the watermark — is skipped. The false claim streams to the user and the run ends clean. There is no independent fallback for "the user asked for an edit and no mutating command ran," so the user is the only detector in the system, which is precisely what they described.

On shipped v2.4.4 it is worse: no plural copulas (are|were|have been absent, main:2011), verified still in the verb list so it self-trips, and main:2019 audits only the terminal frame.

4. On the shipped build, the user's callout is itself refused

This is the "3 or 4 tries", and it is the sharpest of the four. workspaceMutationAuthorizationIssue (main:1868) runs before execution and judges the active user message. Running the shipped regexes against natural retry phrasings:

what the user types result
"hey you didnt do it" blocked — no mutation verb (main:1949)
"do it" / "do it again" / "try again" blocked — short confirmation with no preceding approval request (main:1921)
"go ahead" / "yes" / "now actually do it" blocked, same
"it never posted" / "no changes showed up" / "that never got saved" blocked — read as forbidding changes (MUTATION_DENIAL main:1755, checked main:1895)
"update the entry" allowed

So a user complaining that nothing happened is parsed as instructing Mari to make no changes. The only reliable escape is re-stating the original request with a mutation verb — which is exactly the "3 or 4 tries, then it posts" pattern.

The short-confirmation carve-out at main:1910 cannot help here: it requires the previous assistant message to have asked for approval. Mari's previous message was a completion claim, so it doesn't qualify.

This one is already gone on staging — workspaceMutationAuthorizationIssue and MUTATION_INTENT_PATTERNS have zero occurrences in the staging production path (they survive only in scripts/regressions/mari-edit-flow-revert.regression.ts), removed by the Permissions Mode work.

Suggested order

  1. Release staging. It removes defect 4 outright and materially widens the detector. This is the single biggest win and needs no new code.
  2. Fix the apply:false example (main:739 / staging:763) — a one-word change, and my best guess at the most common real-world trigger. Worth also giving the apply flag a schema description, and reconsidering why edits and creates default in opposite directions.
  3. Make a dropped command loud — teach Mari's reader the shapes the tolerant parser already handles, and at minimum log a dropped entry instead of returning silently.
  4. Widen the claim detector — add the missing verbs, normalize U+2019, allow bare participles. Note the docblock at staging:2071-2075 already concedes the participle gap as an accepted residual; this report is evidence it is load-bearing in practice.

How this was checked

Every regex and default above was executed against the actual origin/main and origin/staging blobs rather than read, and each finding was re-checked by a second pass against the cited lines. Line numbers are packages/server/src/services/professor-mari/workspace-agent.service.ts unless stated.

Nothing here is started — filing for triage.

Originally created by @kolacheee on GitHub (Sep 8, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5966 Originally assigned to: @SpicyMarinara on GitHub. ## Reported by a user (2026-09-07) > I have had this issue with k3, glm5.3 and others. Mari will say an edit is done, but you get no approve/deny, so you tell Mari "hey you didn't do it", and Mari is like "oh yeah let me do it now". Sometimes it takes 3 or 4 tries to get the edit to actually post. Models named are Kimi K3 and GLM 5.3 — non-Claude endpoints behind the OpenAI-compatible provider. ## Short version A fix for this **did not go out**. The completion-claim guard from #5819/#5830 (PR #5893) merged to `staging` on 2026-09-06 and has never been released — the newest stable is **v2.4.4, published 2026-08-25**, whose tag commit is identical to the `main` tip. `auditWorkspaceCompletionClaim` does not exist anywhere on `main`. The issues were closed on merge, which is almost certainly why it looked shipped. Stable is also the default update channel, so a user is on v2.4.4 unless they opted out. But shipping `staging` alone would not fix this user either. The report is **four independent defects stacked**, and only one of them is fixed on `staging`. Each is separately actionable — happy to split this into four issues if you'd rather. ## 1. The prompt's own example tells Mari to send `apply:false` for an edit `workspace-agent.service.ts` — `main:739`, `staging:763`: ``` {"action":"lorebook.updateEntry","entryId":"entry-id","patch":{"content":"new content"},"reason":"Update requested by user","apply":false} ``` That example sits **inside the "Direct request to make that change — act on it" block**, unlabeled, directly between an `agent.create` example with `apply:true` and a `lorebook.deleteEntry` example with `apply:true`. Nothing marks it as a deliberate preview. This matters because the `apply` default is inverted between creates and edits: - creates: `appDataCreateApply` = `firstBoolean(source, ["apply"]) !== false` (`services/mari-db/mari-db.service.ts:955`) → **applies unless told otherwise** - updates / deletes / `setActive` / `moveToFolder`: `firstBoolean(args, ["apply"]) === true` — **20 sites on both branches** → **previews unless told otherwise** A dry run returns `ok:true`, exit code 0, and `approval:not_required`. It stages nothing, so no approve/deny card appears — and from the model's point of view the command succeeded, so it reports success. The schema the model sees is a bare undocumented boolean with only `action` required. A model that copies the nearest matching example for `lorebook.updateEntry` gets `apply:false` verbatim. "Creates work, edits silently don't" is exactly the shape the user describes. ## 2. A malformed command block is dropped silently Mari uses a text JSON protocol — no native tool calling — and JSON mode is only requested for `openrouter` (`staging:218-220`), so nanogpt/custom/xai/mistral/arli/cohere run with no structured-output enforcement. Her own reader (`rawJsonToolCalls` `staging:1187`, `parseJsonCommandCallsFromPayload` `staging:1196`) is much stricter than the engine's tolerant salvage parser in `textual-tool-call-parser.ts`: `commands` must be an Array, and arguments come only from `arguments|args|input` — no `tool`, no `{type:"function",function:{…}}`, no `tool_name`, no `parameters`. Unrecognized entries hit a bare `return` at `staging:1209` with **no log, no status, no trace**. The tolerant parser cannot rescue it, because `removeJsonActionFrames` strips the frame before it runs (`staging:1367-1369`), and provider-side salvage is gated on `options.tools?.length` (`openai.provider.ts:1649/1848`), which Mari never sets. The frame then keeps `protocolValid=true` and computes `stop=true`, so every repair branch is bypassed and the loop breaks having streamed "I've updated it" with zero commands executed — no card, zero repair rounds spent. **Honest limit:** the sub-agent verified this by running the repo's own parser against seven plausible reply shapes (five yield zero commands, one erases the payload). What is *not* proven is that K3 and GLM 5.3 specifically emit those shapes — nothing currently captures a raw reply, so that link is inference. A debug capture of one failing reply would settle it, and would be worth having regardless. ## 3. The completion-claim detector misses how these models actually talk `workspaceTextClaimsMutationCompletion` (`staging:1979-1996`, `main:2004-2012`) only matches `I/we/it/that + verb` or `is/was/has been + verb` against a fixed verb list. Verified by executing the shipped regexes: - **Verbs missing from the list:** `added`, `applied`, `edited`, `modified`, `set`, `inserted`, `made`, `completed`. So even clean English misses — *"I added the entry to the lorebook."* is **not** detected. "Added" is the most natural verb for lorebook work. - **Bare participles miss:** `Done!` · `Created the entry.` · `Updated.` · `Edit applied.` - **A curly apostrophe defeats it:** `I've created the entry.` catches; `I’ve created the entry.` (U+2019) does not. - **Any adverb but "successfully" breaks it:** *"I have now updated the card."*, *"I just created the entry."* — both miss. - **English only.** When it misses, `staging:2089` returns early and the entire guard — every branch, both escape hatches, the watermark — is skipped. The false claim streams to the user and the run ends clean. There is no independent fallback for "the user asked for an edit and no mutating command ran," so **the user is the only detector in the system**, which is precisely what they described. On shipped v2.4.4 it is worse: no plural copulas (`are|were|have been` absent, `main:2011`), `verified` still in the verb list so it self-trips, and `main:2019` audits **only** the terminal frame. ## 4. On the shipped build, the user's callout is itself refused This is the "3 or 4 tries", and it is the sharpest of the four. `workspaceMutationAuthorizationIssue` (`main:1868`) runs before execution and judges **the active user message**. Running the shipped regexes against natural retry phrasings: | what the user types | result | |---|---| | "hey you didnt do it" | **blocked** — no mutation verb (`main:1949`) | | "do it" / "do it again" / "try again" | **blocked** — short confirmation with no preceding approval request (`main:1921`) | | "go ahead" / "yes" / "now actually do it" | **blocked**, same | | "it never posted" / "no changes showed up" / "that never got saved" | **blocked — read as *forbidding* changes** (`MUTATION_DENIAL` `main:1755`, checked `main:1895`) | | "update the entry" | allowed | So a user complaining that nothing happened is parsed as instructing Mari to make no changes. The only reliable escape is re-stating the original request with a mutation verb — which is exactly the "3 or 4 tries, then it posts" pattern. The short-confirmation carve-out at `main:1910` cannot help here: it requires the previous assistant message to have *asked for approval*. Mari's previous message was a completion claim, so it doesn't qualify. **This one is already gone on `staging`** — `workspaceMutationAuthorizationIssue` and `MUTATION_INTENT_PATTERNS` have zero occurrences in the staging production path (they survive only in `scripts/regressions/mari-edit-flow-revert.regression.ts`), removed by the Permissions Mode work. ## Suggested order 1. **Release `staging`.** It removes defect 4 outright and materially widens the detector. This is the single biggest win and needs no new code. 2. **Fix the `apply:false` example** (`main:739` / `staging:763`) — a one-word change, and my best guess at the most common real-world trigger. Worth also giving the `apply` flag a schema description, and reconsidering why edits and creates default in opposite directions. 3. **Make a dropped command loud** — teach Mari's reader the shapes the tolerant parser already handles, and at minimum log a dropped entry instead of returning silently. 4. **Widen the claim detector** — add the missing verbs, normalize U+2019, allow bare participles. Note the docblock at `staging:2071-2075` already concedes the participle gap as an accepted residual; this report is evidence it is load-bearing in practice. ## How this was checked Every regex and default above was executed against the actual `origin/main` and `origin/staging` blobs rather than read, and each finding was re-checked by a second pass against the cited lines. Line numbers are `packages/server/src/services/professor-mari/workspace-agent.service.ts` unless stated. Nothing here is started — filing for triage.
bsakaguchi 2026-10-21 06:01:51 +07:00
  • closed this issue
  • added the
    in-pr
    label
Author
Owner

@kolacheee commented on GitHub (Sep 8, 2026):

Related: #5967 — while tracing defect 3 above I found that the staging claim audit discards a frame's real commands when that same frame also claims completion. Unreleased, but it lands on exactly the models in this report, so it is worth fixing before staging goes out as the fix for this.

<!-- gh-comment-id:5586843825 --> @kolacheee commented on GitHub (Sep 8, 2026): Related: #5967 — while tracing defect 3 above I found that the `staging` claim audit discards a frame's real commands when that same frame also claims completion. Unreleased, but it lands on exactly the models in this report, so it is worth fixing before `staging` goes out as the fix for this.
Author
Owner

@SpicyMarinara commented on GitHub (Sep 8, 2026):

Codex is taking this issue for @SpicyMarinara in the assigned-issue sweep, together with #5966/#5967. The fix targets staging: preserve commands in mixed claim/command frames, repair malformed command frames, and check completion against executed results. Existing permission and preview boundaries stay in force.

<!-- gh-comment-id:5592166307 --> @SpicyMarinara commented on GitHub (Sep 8, 2026): Codex is taking this issue for @SpicyMarinara in the assigned-issue sweep, together with #5966/#5967. The fix targets `staging`: preserve commands in mixed claim/command frames, repair malformed command frames, and check completion against executed results. Existing permission and preview boundaries stay in force.
Author
Owner

@SpicyMarinara commented on GitHub (Sep 8, 2026):

Fixed and merged to staging in #5973. Valid edit commands execute before the completion-claim audit, and unsupported or incomplete frames are repaired without claiming an unsaved edit.

<!-- gh-comment-id:5592940240 --> @SpicyMarinara commented on GitHub (Sep 8, 2026): Fixed and merged to staging in #5973. Valid edit commands execute before the completion-claim audit, and unsupported or incomplete frames are repaired without claiming an unsaved edit.
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#3306
No description provided.