mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3222] [Issue]: mari parser omits some boolean flags from BOOLEAN_FLAGS, silently swallowing positionals #1732
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1732
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Magiwarriorx on GitHub (Jul 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3222
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Prof Mari's argument parser only treats a flag as valueless if its name is in a hardcoded
BOOLEAN_FLAGSset, but 13 flags that are used purely as booleans are missing from that set. When any of them appears immediately before a non-flag token, the parser consumes that token as the flag's "value", silently discarding a required positional.Expected behavior
mari chats messages --tail <chat-id>should list the tail of the chat's messages regardless of whether--tailcomes before or after the<chat-id>positional, since--tailis a boolean flag.Actual behavior
--tailswallows<chat-id>as its value.positionals[0]is thenundefined, so the command throws its usage error (Usage: mari chats messages <chat-id> …) even though a chat id was supplied.hasFlag(flags, "tail")still returnstrue(the stored value isn'tfalse), so the flag reads as "set" while having destroyed the positional.Steps to reproduce
marisubcommand that takes a positional, with a missing-from-set boolean flag placed before that positional. Minimal case:mari chats messages --tail <chat-id>.Usage: mari chats messages <chat-id> …error.mari chats messages <chat-id> --tail, which works — the only difference is flag order.Environment
a90e7158(branchstaging)Logs, screenshots, or video
None
Additional context
Identified by source review; not yet reproduced against a running server.
Root cause:
parseArgstreats a--flagas valueless only when its name is inBOOLEAN_FLAGS(packages/server/src/services/mari-db/mari-db.service.ts:628), otherwise it consumes the next token (:629).BOOLEAN_FLAGS(:139) lists 9 names, buthasFlag(...)is used as a pure boolean for 13 more that aren't listed:tail,global,enable,disable,constant,no-constant,changed,cached,staged,patch,full,help,no-global. None of the 13 is ever read as a value viaflagString(verified across the file), so none has any reason to be excluded. The sibling parser atpackages/server/src/services/mari-db/mari-images.service.ts:106already listshelpin its ownBOOLEAN_FLAGS, confirming these are meant to be boolean. Nothing in the per-command usage strings, the top-level help, or the Professor Mari system prompt instructs the model to place flags after positionals, so the safe ordering is not guaranteed.Suggested fix: add the 13 names to
BOOLEAN_FLAGSatmari-db.service.ts:139.BOOLEAN_FLAGSis referenced only byparseArgs(:628), so the change is side-effect-free.Template check