[GH-ISSUE #7949] fix(mari): structured tool errors should name the action, the value and its shape #4366

Closed
opened 2026-10-22 04:06:03 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @ylli-selmani on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7949

Originally assigned to: @ylli-selmani on GitHub.

Summary

Mari's structured tools (app_data and the workspace commands) are designed so a model can repair its own
call from the error text — that text is the documentation a small model reads at the moment it is wrong.
Several messages name a value but not its location or shape, and the namespace fallbacks withhold both the
received action and the valid set, so a near-miss looks like a wrong surface and the model either repeats the
call or abandons app_data for mari db / shell.

Observed: a model called character.create without a top-level name and got
character name is required: pass it as "name". It reasoned "the error message says pass it as name which
suggests it's a top-level field"
and retried; another run nested it as data.character.name.

Expected behavior

Every error a model is expected to self-correct from states four things in one fixed order:
<action>: <what is wrong> (<what arrived>). <where it goes / accepted shape>. An unknown action echoes what
was sent, suggests the nearest valid name, and lists the valid set for that namespace.

Actual behavior

  • character name is required: pass it as "name" (mari-db.service.ts:1114, one template behind ~70 call
    sites) — no location, no shape, no echo of what arrived.
  • Eight Unsupported <namespace> app_data action. fallbacks (:3154, :3332, :4396, :4485, :4573,
    :4783, :4924, :5517) — no received name, no valid list, although the switch above is that list.
  • app_data action is required: pass it as "action" or "type" (:2801) — advertises type, which the
    app_data tool schema does not accept; the retry fails schema validation before reaching this message.
  • character.moveToFolder needs folderId or folderName (:3115) — reads top-level args only while the
    neighbouring card actions read data, and the message does not say so, so a model applying the right
    general rule fails permanently.
  • "role" must be one of … (:1874) is the best of the family: field, set and received value, but no action
    and no location.

Steps to reproduce

  1. With a small model (e.g. qwen3.5-9b or gemma-4-12b), ask Mari to create a character without giving a name
    in the first message.
  2. Watch the failed character.create; the error names name but not that it is top-level.
  3. Call app_data with action: "character.gets" and compare the message it returns with the valid actions
    the switch actually accepts.

Environment

  • Marinara Engine version: 2.5.1 (staging 32499a440) with the Professor Mari skills branch on top
  • Install type: source (dev worktree)
  • OS + version: Windows 11
  • Browser or app shell: Chromium via the dev client

Logs, screenshots, or video

Request logs and the full audit are kept privately; the five messages above are quoted from the current tree.

Additional context

  • Audit of 16 message defects with current text, file:line, misread, rewrite and risk: .tmp/mari-tool-errors/AUDIT.md
    (private). Two adjacent findings are not message defects and are filed separately if at all: numeric args
    fail silently (firstNumber/normalizeLimit clamp without a word), and apply: "no" is treated as true
    by appDataCreateApply while firstBoolean reads it as false.
  • Fix lands with the built-in-skills PR (#7908) as its own commit, behind a small mari-db/tool-error.ts
    helper (needArg / unknownAction / badEnum / describeReceived), text-only: no dispatch, validation or
    sandbox change.
Originally created by @ylli-selmani on GitHub (Oct 21, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7949 Originally assigned to: @ylli-selmani on GitHub. ## Summary Mari's structured tools (`app_data` and the workspace commands) are designed so a model can repair its own call from the error text — that text *is* the documentation a small model reads at the moment it is wrong. Several messages name a value but not its location or shape, and the namespace fallbacks withhold both the received action and the valid set, so a near-miss looks like a wrong surface and the model either repeats the call or abandons `app_data` for `mari db` / shell. Observed: a model called `character.create` without a top-level `name` and got `character name is required: pass it as "name"`. It reasoned *"the error message says pass it as name which suggests it's a top-level field"* and retried; another run nested it as `data.character.name`. ## Expected behavior Every error a model is expected to self-correct from states four things in one fixed order: `<action>: <what is wrong> (<what arrived>). <where it goes / accepted shape>.` An unknown action echoes what was sent, suggests the nearest valid name, and lists the valid set for that namespace. ## Actual behavior - `character name is required: pass it as "name"` (`mari-db.service.ts:1114`, one template behind ~70 call sites) — no location, no shape, no echo of what arrived. - Eight `Unsupported <namespace> app_data action.` fallbacks (`:3154`, `:3332`, `:4396`, `:4485`, `:4573`, `:4783`, `:4924`, `:5517`) — no received name, no valid list, although the switch above is that list. - `app_data action is required: pass it as "action" or "type"` (`:2801`) — advertises `type`, which the `app_data` tool schema does not accept; the retry fails schema validation before reaching this message. - `character.moveToFolder needs folderId or folderName` (`:3115`) — reads top-level args only while the neighbouring card actions read `data`, and the message does not say so, so a model applying the right general rule fails permanently. - `"role" must be one of …` (`:1874`) is the best of the family: field, set and received value, but no action and no location. ## Steps to reproduce 1. With a small model (e.g. qwen3.5-9b or gemma-4-12b), ask Mari to create a character without giving a name in the first message. 2. Watch the failed `character.create`; the error names `name` but not that it is top-level. 3. Call `app_data` with `action: "character.gets"` and compare the message it returns with the valid actions the switch actually accepts. ## Environment - Marinara Engine version: 2.5.1 (`staging` `32499a440`) with the Professor Mari skills branch on top - Install type: source (dev worktree) - OS + version: Windows 11 - Browser or app shell: Chromium via the dev client ## Logs, screenshots, or video Request logs and the full audit are kept privately; the five messages above are quoted from the current tree. ## Additional context - Audit of 16 message defects with current text, `file:line`, misread, rewrite and risk: `.tmp/mari-tool-errors/AUDIT.md` (private). Two adjacent findings are **not** message defects and are filed separately if at all: numeric args fail silently (`firstNumber`/`normalizeLimit` clamp without a word), and `apply: "no"` is treated as `true` by `appDataCreateApply` while `firstBoolean` reads it as false. - Fix lands with the built-in-skills PR (#7908) as its own commit, behind a small `mari-db/tool-error.ts` helper (`needArg` / `unknownAction` / `badEnum` / `describeReceived`), text-only: no dispatch, validation or sandbox change.
Author
Owner

@ylli-selmani commented on GitHub (Oct 21, 2026):

I'm doing it

<!-- gh-comment-id:6313671810 --> @ylli-selmani commented on GitHub (Oct 21, 2026): I'm doing it
bsakaguchi 2026-10-24 04:03:34 +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#4366
No description provided.