LibreChat/api/server/controllers/agents/__tests__
Danny Avila e35b539e64
fix: adversarial-review findings — in-graph execution, orphan prunes, endpoint scoping, real kill switch
Pre-PR multi-agent review confirmed 5 defects in the initial commit; all fixed:

1. CRITICAL — the tool never paused on the real agents endpoint: production
   loads tools definitions-only, flipping the SDK ToolNode to event-driven
   dispatch, and the host ON_TOOL_EXECUTE handler runs outside the Pregel task
   frame (under runOutsideTracing), where interrupt() throws and becomes an
   error ToolMessage. Reworked: the ask tool never rides toolDefinitions/
   toolRegistry — on HITL-capable top-level agents a real instance is supplied
   via AgentInputs.graphTools (agents#289, requires @librechat/agents > 3.2.57),
   the SDK's in-graph direct-tool seam; new production-shape e2e pins the
   event-driven mode end to end.
2. CRITICAL — ask-only runs left orphaned interrupted checkpoints (silent
   context duplication on every later turn): both orphan prunes were gated on
   toolApproval.enabled. The pre-turn prune now also fires for ask-capable
   agents (exported agentRequestsAskUserQuestion), and the abort-route prune
   fires when the aborted job carries a pendingAction.
3. MAJOR — self-spawned subagents bypassed the strip (self config resolves from
   the parent's _sourceInputs): fixed SDK-side (buildChildInputs clears
   graphTools) and the tool is now never present on child surfaces host-side.
4. MINOR — the manifest entry leaked into the Assistants tools dialog and the
   legacy plugins endpoint, where tools execute with no run to pause: new
   agentsOnly manifest flag, scoped out of both listings.
5. MINOR — filteredTools/includedTools only hid the tool from the dialog:
   now enforced at run build (strip + no checkpointer), making the admin
   filter a real kill switch for already-saved agents.
2026-07-07 07:41:50 -04:00
..
askUserQuestion.e2e.spec.js fix: adversarial-review findings — in-graph execution, orphan prunes, endpoint scoping, real kill switch 2026-07-07 07:41:50 -04:00
callbacks.spec.js 🗂️ feat: Add Agent File Authoring Tools (#13435) 2026-06-03 23:58:12 -04:00
client.contextMetadata.spec.js 🪙 fix: Correct Context Usage Gauge After Summarization (#13744) 2026-06-14 18:23:30 -04:00
client.memory.spec.js 🧰 refactor: Unify code-execution tools (#12767) 2026-04-25 04:02:01 -04:00
hitlCheckpoint.e2e.spec.js 🧹 feat: Eager HITL Checkpoint Cleanup (Expiry + Deletion) & Full-Wiring E2E (#14123) 2026-07-05 11:29:30 -04:00
jobReplacement.spec.js perf: Persist HITL checkpoints only on pause (lazy checkpointer) (#14024) 2026-07-05 08:30:06 -04:00
modelEndHandler.spec.js 💸 feat: Per-Agent Endpoint Token Config in Multi-Endpoint Billing (#13738) 2026-06-14 12:00:32 -04:00
openai.spec.js 🧾 fix: Bill Subagent Child-Run Model Usage in Parent Transactions (#13683) 2026-06-13 14:55:48 -04:00
request.resumeMetadata.spec.js 🖇️ feat: Reference Selected Chat Text with Multi-Quote Popup (#13868) 2026-06-21 08:33:11 -04:00
responses.unit.spec.js 🎒 fix: Apply OCR Context to Responses API Agents and Handoffs (#13707) 2026-06-20 10:17:09 -04:00
resume.spec.js feat: ask_user_question tool — agent-initiated questions with durable pause/resume 2026-07-07 07:41:50 -04:00
usageEvents.integration.spec.js 🪙 refactor: Reconcile Context Gauge to Actual Provider Tokens (#13780) 2026-06-16 11:05:44 -04:00
usageEvents.live.spec.js 📊 feat: Real-Time Context Window & Token Usage Tracking (#13670) 2026-06-13 19:38:28 -04:00
v1.duplicate-actions.spec.js 🛡️ refactor: Scope Action Mutations by Parent Resource Ownership (#12237) 2026-03-15 10:19:29 -04:00
v1.spec.js 📦 refactor: Consolidate DB models, encapsulating Mongoose usage in data-schemas (#11830) 2026-03-21 14:28:53 -04:00