mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #585] [Feature]: Add /hide and /unhide slash commands for bulk AI context control #270
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#270
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 @kevin-ho on GitHub (May 9, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/585
What problem does this solve?
Users in long roleplay conversations (200+ messages) often want to exclude large stretches of messages from the AI's context window — e.g., hiding old plot arcs, out-of-character exchanges, or redundant messages — to free up token budget for what matters. Currently, the
hiddenFromAIflag can only be toggled one message at a time via the UI eye icon, making it impractical to manage context at scale.Proposed solution
Add two client-side slash commands —
/hideand/unhide— that set or clear thehiddenFromAIflag on multiple messages in a single operation.Syntax: Supports single indices, ranges, comma-separated lists, and any combination:
/hide 5— hide message 5/hide 3-8— hide messages 3 through 8/hide 2,5,9— hide messages 2, 5, and 9/hide 2-5,8,12-14— mixed ranges and singlesImplementation:
PATCH /:chatId/messages/bulk-hiddenendpoint that loops the existingupdateMessageExtra()per message (same proven code path as the single-message UI toggle, including swipe sync)hiddenFromAIflag in the messageextraJSONAlternatives considered
json_set()withINclause: avoids the per-message loop but bypasses thewithPatchQueueserialization guard and the swipe-sync logic inupdateMessageExtra; the loop approach is simpler and functionally identical to what the UI already doesAdditional context
The feature leverages existing infrastructure:
hiddenFromAIflag already exists in messageextrametadataPATCH /chats/:chatId/messages/:messageId/extraalready handles single-message toggle with swipe syncisMessageHiddenFromAI()already filters hidden messages during prompt assembly ingenerate.routes.tsTemplate check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: