mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #3160] [MERGED] feat: Agent Suite — view and edit stored agent data (manual + AI-assisted) #5823
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#5823
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/3160
Author: @kolacheee
Created: 7/2/2026
Status: ✅ Merged
Merged: 7/3/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/agent-suite📝 Commits (7)
41135e4feat: add Agent Suite rewrite endpoint and shared schemaef7631cfeat: add Agent Suite modal for viewing and editing stored agent dataa88262bfix: harden Agent Suite against stale-state clobbers and draft loss7bf1c44feat: add grounding-context picker to Agent Suite AI rewrites567903cfix: keep chat drawers open when interacting with toasts and app dialogs76ed010Address Agent Suite review feedback56cbc2cMerge remote-tracking branch 'origin/staging' into feat/agent-suite📊 Changes
12 files changed (+1524 additions, -89 deletions)
View changed files
📝
CHANGELOG.md(+4 -0)📝
packages/client/src/App.tsx(+4 -0)📝
packages/client/src/components/agents/SecretPlotPanel.tsx(+9 -12)➕
packages/client/src/components/chat/AgentSuiteModal.tsx(+1141 -0)📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+71 -66)📝
packages/client/src/components/ui/AppDialogRenderer.tsx(+10 -1)📝
packages/client/src/features/chat-settings/sections/LorebooksSection.tsx(+1 -9)📝
packages/client/src/hooks/use-agents.ts(+58 -1)➕
packages/client/src/lib/chat-lorebooks.ts(+93 -0)📝
packages/server/src/middleware/rate-limit.ts(+3 -0)📝
packages/server/src/routes/agents.routes.ts(+105 -0)📝
packages/shared/src/schemas/agent.schema.ts(+25 -0)📄 Description
Linked issue
Closes #3165
Why this change
What changed
Shared (
packages/shared)agentSuiteRewriteSchema+AgentSuiteRewriteInputinagent.schema.ts(connectionId, instruction, selected excerpt, optional document context, optionalcontextSectionsgrounding blocks, size caps end-to-end).Server (
packages/server)POST /api/agents/suite/rewriteinagents.routes.ts: one-shot, non-streaming AI rewrite of a stored-data excerpt. Follows thePOST /api/translateAI pattern exactly (getWithKey→ baseUrl fallback →createLLMProvider→chatComplete, temperature 0.3, wrapping-code-fence strip, 400/502 error convention). System prompt instructs the model to return only the rewritten excerpt and to preserve JSON structure.middleware/rate-limit.tsso it doesn't sit in the 600/min default class.Client (
packages/client)AgentSuiteModal.tsx(ui/Modal,max-w-3xl,chatFloatingPanel): agent rail (dropdown on mobile) → per-agent editable data blocks:GET/PATCH /agents/memory/:type/:chatId; director memory sits behind a spoiler gate like the Secret Plot panel; per-agent destructive "Clear memory" with confirm.GET/PATCH /chats/:id/game-state— saves flush queued HUD patches, rebuild from a fresh snapshot, target the exact (messageId, swipeIndex), and re-sync the live HUD store.filterLanguageGenerationConnections), and the rewrite lands in the draft for review. Nothing is persisted without an explicit Save.use-agents.ts:useAgentMemory(404 → empty memory),useUpdateAgentMemory,useAgentSuiteRewrite;agentKeys.memoryreuses the Secret Plot panel's key shape, andSecretPlotPanelnow consumes the shared hook so the key has one queryFn.ChatSettingsDrawer.tsx, styled like the existing "Edit Summaries" button.App.tsx) and the app-dialogModal(AppDialogRenderer.tsx) are now taggeddata-chat-floating-panel. Previously, dismissing a toast or clicking any confirm-dialog button counted as an outside click, closed the settings/gallery drawer, and unmounted the chat-local modal inside it (destroying unsaved drafts). Found while manually testing the Agent Suite; also fixes the same pre-existing interaction for the Secret Plot regenerate and Memory Recall delete-all confirms.Docs
CHANGELOG.md: feature entry under[Unreleased].The branch went through two multi-agent adversarial reviews (per-finding verification); 14 + 8 confirmed findings were fixed in follow-up commits (stale-snapshot clobber protection, in-flight edit locking, draft-loss guards, URL encoding, rate limiting, query-key coherence,
chat.characterIdsstring-at-runtime parse, label caps, picker loading/error states, delimiter-safe prompt framing).Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Checklist for manual verification in a real browser (boxes above reflect the human contributor's own run-through; container run still pending):
Automated checks already run:
pnpm lint(tsc strict + ESLint, all packages) passes; client production build passes (modal adds ~18 kB to the lazy drawer chunk only; main entry byte-identical).pnpm check's final build step fails on this dev machine due to a pre-existing Windows-only build-script bug (unquotedprocess.execPath, reproducible without this branch) — the servertscstep it wraps passes.Docs and release impact
UI evidence (if applicable)
Summary by CodeRabbit
New Features
Bug Fixes
Chores
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.