mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5241] [MERGED] fix(agents): merge Beholder wounds by identity instead of replacing #6688
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#6688
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/5241
Author: @GetBeholder
Created: 8/19/2026
Status: ✅ Merged
Merged: 8/19/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/beholder-wounds-merge-by-identity📝 Commits (4)
6cdf3fefix(agents): merge Beholder wounds by identity instead of replacing8ae5bcbfix(agents): bound merged Beholder wounds at the slot capacity3d8615bfix(agents): keep delta-updated wounds during overflow trimming9847753test(agents): assert the wound re-description actually changes severity📊 Changes
2 files changed (+164 additions, -3 deletions)
View changed files
📝
packages/server/src/services/agents/beholder-state.ts(+44 -3)➕
scripts/regressions/beholder-wound-merge.regression.ts(+120 -0)📄 Description
Linked issue
Closes #5242
Why this change
The Beholder delta protocol emits only what changed this turn.
mergeSlotDeltareplaced a slot's wholewoundslist on any non-empty wounds delta, so a new wound on an already-wounded slot silently erased the wounds the delta did not re-mention.Example: a character has
head.wounds = [{ text: "fractured skull", severity: "critical" }]. A later turn adds a broken nose, the model emitshead.wounds: [{ text: "broken nose", severity: "serious" }], and the fractured skull disappears from tracked state.worn,holding,bare, andmissingwere already handled correctly; onlywoundsreplaced.What changed
woundIdentity()(the injurytext, trimmed + lowercased) andmergeWounds(), mirroring the existingwornItemIdentity()/mergeWornItems()pattern directly above them.mergeSlotDeltanow merges wounds by identity instead of assigning the delta list: unseen wounds are appended, a re-described wound updates in place (newer severity / bleeding wins), and wounds the delta omits are kept.wounds: []still clears the slot wholesale — that branch is untouched.mergeSlotDelta).Scope note: distinct-wound healing (dropping one of several co-located wounds) is not expressible in the current delta protocol, so wholesale clearing plus a manual edit remains the interim path — unchanged here. This PR only stops silent wound loss.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Being explicit rather than ticking boxes I did not earn: I could not run
pnpm checklocally —pnpm installfails in my environment at theonnxruntime-nodepostinstall (it tries to download a CUDA build and cannot resolve a host), so the workspace has no usablenode_modules. I am relying on CI for typecheck/lint here, and a maintainer should confirm the runtime behaviour in-app before merge.What I did verify:
mergeWornItemsimplementation exactly (same types, same update-or-append shape, no new imports).wounds: []clear path, themissingshort-circuit, and the worn/holding/bare paths are all unchanged.Suggested manual check for a reviewer: wound a slot, confirm it renders in the Beholder panel, then wound the same slot differently on a later turn and confirm both wounds are now listed (before this change, only the newest survived).
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.