mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2494] 13-REGEX-RUNTIME-message-application: non-prompt regex can apply twice #1238
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#1238
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 @Promansis on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2494
Summary
13-REGEX-RUNTIME-message-application: refactor applies non-prompt regex scripts in both the UI path and the generation runtime, so non-idempotent user-input or AI-output regex scripts can run twice.Linked target: #2482
Expected behavior
Legacy applies prompt-only regex server-side to prompt messages, and applies non-prompt regex client-side on user input before send and AI output at display time. Each applicable message gets one non-prompt pass.
Actual behavior
Refactor still applies regex in the UI send/display paths, but also applies non-prompt regex in
start-generation.tsbefore persistence. A replacement such asa -> aacan be transformed again and becomeaaaa.Steps to reproduce
user_inputorai_outputwith a non-idempotent replacement such asa->aa.a.Impact area
Environment
refactorstatic traceLogs, screenshots, or video
Proof:
packages/server/src/services/regex/regex-application.ts;packages/server/src/routes/generate.routes.ts:2334-2352packages/client/src/hooks/use-apply-regex.ts;packages/client/src/components/chat/ChatMessage.tsx:1094-1154src/features/catalog/agents/regex-application.ts:48-75,100-126;src/features/modes/shared/chat-ui/components/ChatInput.tsx:176,603-606,850-853;src/features/modes/shared/chat-ui/components/ChatMessage.tsx:1370-1443src/engine/generation/regex-runtime.ts:27-43;src/engine/generation/start-generation.ts:261-270,3411-3419,3666-3668src/engine/generation-core/regex/regex-application.ts:69-116;src/engine/generation/prompt-assembly.ts:3636-3639Regression notes
Legacy
mainkeeps non-prompt regex to the UI send/display paths while server generation applies prompt-only regex to prompt messages.Additional context
Acceptance criteria:
Follow-up noted but not chased in this batch: both legacy and refactor appear to lack timeout/static safety for regex-script replacement itself; the confirmed parity gap here is the double application path.
Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: