mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5676] [MERGED] fix(agents): recover the removal a compound take-off loses #6877
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#6877
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5676
Author: @GetBeholder
Created: 8/30/2026
Status: ✅ Merged
Merged: 8/30/2026
Merged by: @GetBeholder
Base:
staging← Head:fix/beholder-compound-takeoff📝 Commits (5)
4a1abacfix(agents): recover the removal a compound take-off loses5902222Merge remote-tracking branch 'origin/staging' into fix/beholder-compound-takeoff5eba638fix(agents): take the repair subject from the take-off's own sentence73557cdMerge branch 'staging' into fix/beholder-compound-takeoffbc1469bMerge branch 'staging' into fix/beholder-compound-takeoff📊 Changes
3 files changed (+247 additions, -2 deletions)
View changed files
📝
packages/server/src/services/agents/agent-executor.ts(+67 -2)📝
packages/server/src/services/agents/beholder-state.ts(+77 -0)➕
scripts/regressions/beholder-takeoff-repair.regression.ts(+103 -0)📄 Description
Pull request
Linked issue
Closes #
Why this change
When one sentence both takes a garment off and puts another on, the extractor reports the addition and drops the removal. Measured against the held-out set:
The garment it failed to remove stays in state and is fed back into every later turn, so one miss compounds for the rest of the scene. This reproduces on ordinary prose, not just constructed cases — a six-turn scene hit it on "trades the ruined sweater for a clean linen shirt… and pulls the coat back on".
What changed
beholder-state.tsgains three pure helpers:beholderTakeoffClause(split a compound sentence down to the take-off half),beholderDeltaLacksRemoval, andmergeBeholderWornRemovals.agent-executor.tsruns one extra worn-lane call after the five passes only when the reply carried no removal, the prose shows something coming off, and the sentence is compound. Onlyworn_removeis merged from the answer — it never adds or replaces a garment. A failed repair is logged and dropped rather than losing the turn.buildBeholderMessagestakes an optional narration override; the narration derivation moved tobeholderNarrationso both callers share it.The route matters. Re-asking the same compound sentence with removal-only framing recovers 0 of 6 — it is the compound sentence itself that blinds the model, not the framing. That is why this splits the input rather than rewording the prompt. Five prompt variants were measured first (an explicit rule, a worked example, clause-splitting instructions, a terse imperative, and reordering the existing bullet); every one left the number at 2/8.
Package and security impact
beholder(agent behaviour only; no manifest or catalog change)Validation
scripts/regressions/beholder-takeoff-repair.regression.tspassesbeholder-*regressions still passtsc --noEmit -p packages/server/tsconfig.jsoncleanManual verification notes
Measured end to end through these helpers against the trained extractor (koboldcpp, Beholder-Q8_0):
The two unticked boxes are honest: this is server-side behaviour with no package payload, so there is nothing to install, and it was verified through the regression harness and a live-model run rather than a chat session.
The unit regression pins what decides when it fires and what it asks — firing too eagerly costs a call on every turn, not firing costs the removal — plus that the merge takes only
worn_removeand never duplicates.Documentation impact
UI evidence (if applicable)
None — no UI change.
Summary by CodeRabbit
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.