mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5695] [MERGED] agents: let a caller hand an agent prose to read, and report what a run changed #6888
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#6888
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/5695
Author: @GetBeholder
Created: 8/31/2026
Status: ✅ Merged
Merged: 8/31/2026
Merged by: @GetBeholder
Base:
staging← Head:feat/beholder-directive📝 Commits (9)
2c5b738agents: let a caller hand an agent prose to read instead of the recent messagesfb84693agents: expose a summary of one agent's recent runs in a chat71b83f6agents: report what each Beholder run changed, not what it holds8bcb74cagents: report removals, and keep the boundary on a historical retry63d75baMerge remote-tracking branch 'origin/staging' into feat/beholder-directive1328d91agents: a character appearing or disappearing is itself a changebcf1e56agents: identify a character the way the normalizer doesfc0e14bMerge remote-tracking branch 'origin/staging' into feat/beholder-directive57dd32cMerge remote-tracking branch 'origin/staging' into feat/beholder-directive📊 Changes
6 files changed (+211 additions, -2 deletions)
View changed files
📝
packages/server/src/routes/agents.routes.ts(+88 -0)📝
packages/server/src/routes/generate/retry-agents-route.ts(+43 -1)📝
packages/server/src/services/agents/agent-executor.ts(+3 -1)📝
packages/server/src/services/storage/agents.storage.ts(+26 -0)📝
packages/shared/src/types/agent.ts(+9 -0)➕
scripts/regressions/beholder-directive.regression.ts(+42 -0)📄 Description
Three small additions supporting the Beholder capability package
(Pasta-Devs/Marinara-Agents#664). 168 lines added, 2 changed, across agent
context, the retry route, storage and one new read route. Nothing that exists
today behaves differently — the new paths only run when something sets them.
1. Prose to read instead of the recent messages
State-tracking agents read the story. That is the right default, but it leaves
no way to simply state a fact — "her sword is broken" — without writing a
paragraph for the agent to find it in.
AgentContextgains an optionalnarrationOverride, honoured in the executorbetween the explicit argument and the story itself. The retry-agents route
accepts a matching
beholderDirective, bounded and trimmed like any other freetext on the way in.
The subtle part is which prior state the run starts from. A retry re-runs a
message, so it correctly starts from the state as it was BEFORE that message and
re-derives it. A directive is not a re-run: it states a fact on top of what is
already there. Excluding the last message for a directive discarded everything
that turn had established — observed as a directive about one character wiping
every other character out of the panel — so the exclusion now applies to
retries only.
2. Recent runs of one agent type in a chat
getLastSuccessfulRunByTypeanswers "what is the state now". A diagnostic panelneeds the other question — "what has this agent been doing" — because "it is not
working" is usually one of three things that look identical from the outside: it
never ran, it ran and failed, or it ran fine and found nothing.
listRunsByTypeForChatreturns the recent runs newest first, failures included.A run that errored is the most interesting row on such a list, and dropping it
would make a broken agent look idle rather than broken.
3. What each run changed
A run's stored result is the whole state as of that message, so a caller asking
"what did this turn do" got the running total and had to diff it themselves — or,
more likely, showed the total and called it the change. The route compares each
run against the one before it and returns the changed slots per character. It
reads one extra run beyond the requested window so the oldest entry still has a
predecessor, and where there is genuinely no earlier run it returns
nullratherthan a change list: the first extraction in a chat did not change a body, it
established one, and reporting every slot as changed would be wrong in the one
place it is most visible.
The route is deliberately narrow — Beholder-scoped, matching the beholder-state
routes already here, rate-limited alongside them, and returning shapes only:
slot names, counts, timings and errors, never the extracted content. The panel
already holds the current state, so this stays a health signal rather than a
second copy of the chat.
Verification
scripts/regressions/beholder-directive.regression.tspins the narrationprecedence order, the length bound, and that an empty directive falls through to
the story rather than becoming empty narration. Picked up automatically by
pnpm regression. Server typecheck clean.Exercised end to end against a local build through the capability package: a
directive updates the state it names and leaves every other character intact,
and the runs route reports the two hand slots a directive changed rather than
the four slots the state holds.
🤖 Generated with Claude Code
https://claude.ai/code/session_01992DGH2exasKGaJiqRnteC
Summary by CodeRabbit
New Features
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.