mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7222] [MERGED] fix(agents): keep Character Tracker updates returned at the result root #7630
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#7630
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/7222
Author: @SpicyMarinara
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/character-tracker-root-envelope-7208📝 Commits (3)
41b555efix(agents): keep Character Tracker updates returned at the result rootf82dbc7fix(agents): keep Character Tracker no-change replies at debug levela223d6eMerge remote-tracking branch 'origin/staging' into fix/character-tracker-root-envelope-7208📊 Changes
5 files changed (+77 additions, -6 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/server/src/routes/generate.routes.ts(+6 -1)📝
packages/server/src/routes/generate/retry-agents-route.ts(+6 -1)📝
packages/server/src/services/agents/agent-executor.ts(+12 -4)📝
scripts/regressions/agent-runtime.regression.ts(+52 -0)📄 Description
Linked issue
Closes #7208
Thanks to @bahaynes for the diagnosis: the report pinned the exact branch in
parseAgentResponse, the debug-only log line and the share of affected runs (91 of 1,278 Character Tracker runs, up to 31 of 68 in one chat).Why this change
{ "updates": [...], "removed": [...] }at the root of the result instead of underpresentCharacters, Engine threw the whole update away. The run still counted as a success, so nothing reached the user: the tracker panel kept the old moods, outfits and thoughts, and the next turn fed that stale snapshot back to the model, which tends to undo recent changes.debugline, so the loss was invisible at the default log level.What changed
packages/server/src/services/agents/agent-executor.ts:parseAgentResponsenow maps both single-group tracker results to the key a root envelope belongs under (custom_tracker_update→fields,character_tracker_update→presentCharacters) and wraps a root{ updates, removed }(or{ updates }alone) there. Existing shapes are unchanged: an explicitpresentCharacters(array or envelope) is never overridden. Both the individual and the batched paths go through this function.packages/server/src/routes/generate.routes.tsandpackages/server/src/routes/generate/retry-agents-route.ts: when a successful Character Tracker result has other data but no usable character list (missing or malformed), the "keeping existing snapshot" line is now awarnand names the result's keys. Two replies stay atdebugas before: an empty{}, which the package prompt asks for when nothing changed in incremental mode, and an explicitly emptypresentCharacters: [], which the guard keeps from wiping the tracker. Warning on those would fire on every quiet turn.scripts/regressions/agent-runtime.regression.ts: feeds the reporter's redacted shape throughexecuteAgentandexecuteAgentBatch(batched with World State), then through the Character Tracker merge (resolveTrackerGroupUpdate), for root{ updates, removed }, root{ updates },presentCharacters: { updates, removed }and the legacypresentCharacters: [...]array. It asserts the snapshot changes in every case. It fails on currentstagingat the root{ updates, removed }case.CHANGELOG.md: user-facing entry under[Unreleased].Other tracker result types checked for the same gap, not changed because a root envelope would be ambiguous there and they take a different code path:
game_state_update): several fields per result; onlyworldCustomFieldstakes an envelope.inventory_tracker_update): three row groups (currencies,equipped,inventory).persona_stats_update): takes arrays only (stats,status), no incremental envelope.Package side (Pasta-Devs/Marinara-Agents, not changed here): as the report notes, the Character Tracker's batch and incremental hints never show the envelope's parent key. Showing
"presentCharacters": { "updates": [...], "removed": [...] }explicitly in the package prompt would make the root shape rarer; Engine now accepts both either way.Validation
pnpm checkpasses locallyCONTRIBUTING.mdAgent-run commands:
pnpm check(exit 0) andnode ./scripts/run-regressions.mjs --filter scripts/regressions/agent-runtime.regression.ts(passes; fails with the executor change reverted). Verifier: same regression passes on the branch and fails withagent-executor.tstaken fromorigin/staging;tracker-sections,roleplay-streaming,agent-context-generationandpromptregressions pass;pnpm checkrerun after the log-level follow-up.Manual verification notes
{ "updates": [...], "removed": [...] }at the root updates the tracker panel's mood, outfit and thoughts.presentCharactersas an array or as{ "updates": [...], "removed": [...] }still updates the panel as before.{ "reasoning": "..." }) leaves the panel unchanged and logs awarnline naming the result keys at the default log level, while a{}reply andpresentCharacters: []stay quiet at the default log level.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Only
CHANGELOG.mdchanged; no user-facing docs underdocs/describe the tracker result shapes.UI evidence (if applicable)
Server-side only; no UI changes.
Summary by CodeRabbit
presentCharacters. Existing character details are preserved when updates omit characters, while explicit removals are applied.presentCharacterswrapper.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.