LibreChat/e2e/setup
Danny Avila d30577e946
🧾 test: Bill Detached Subagents Their Own Prompt in the Mock Model (#18050)
* 🧾 test: Bill Detached Subagents Their Own Prompt in the Mock Model

The mock model computes the input tokens it reports from the agent context of the graph it was built for. A subagent model override shares that one model with child graphs, so a detached child of the same agent was billed the parent's system prompt and tool definitions for as long as the parent run had not been disposed, and only its own messages afterwards.

When the child's first call returned before that disposal, the inflated report pushed the SDK's calibration ratio to its cap, the pruner cut the 24 KB tool result to 4,912 characters, and the retained-history fixture stopped the child before signalling ready. On the Redis transport lane the two events land within a few milliseconds of each other, so the child wins that race in about one run in six; on the memory lanes the disposal is comfortably first.

The agent view now reads a graph's agent contexts only for streams of that graph's own run. The history fixture records why it stopped a task, so a waiter fails with that reason instead of a 45-second timeout.

* 🧪 test: Cover Detached Child Billing Through the Real SDK

The regression test drove the mock model directly with run ids it chose itself, so it assumed the relationship the ownership check depends on instead of observing it.

It now builds a real SDK run with a self subagent, a real task store and tool node, applies the real hook, and spies on what each stream reports. The parent run is never disposed, so its graph holds its agent context for the child's whole life: on dev's mock model the child stops with the lost-results failure the Redis lane hits, and here it reaches ready with every child stream billed for the messages it was sent and both parent streams billed their system prompt under the graph's own run id.
2026-11-11 10:29:38 -05:00
..
agent-management.ts
authenticate.ts ⏎ fix: Restore Enter to Send as the Default (#17374) 2026-10-23 00:10:44 +02:00
cleanupUser.ts 📧 feat: add email address change (#14597) 2026-10-01 03:46:16 +00:00
dynamic-mcp-tools.js
env.ts 🖲️ fix: Enable Running Chat Menus and Preserve Renamed Titles (#16697) 2026-10-03 23:17:15 -04:00
fake-assistants-server.js 🚨 fix: Show a Failed Assistants Run's Error on a New Chat (#17703) 2026-11-02 18:38:38 +01:00
fake-code-server.js 📎 fix: Keep Lazily Provisioned Attachments for Code Calls After read_file (#17942) 2026-11-10 09:03:47 +01:00
fake-flux-server.js 🖼️ fix: Bound Flux Tool Images and Preserve Original Attachments (#13749) 2026-11-09 22:41:29 +01:00
fake-git-host-server.js 🪣 feat: Look Up Bitbucket Cloud Pull Requests (#16987) 2026-10-12 07:34:51 +02:00
fake-label-server.js 🖲️ fix: Enable Running Chat Menus and Preserve Renamed Titles (#16697) 2026-10-03 23:17:15 -04:00
fake-mcp-app-server.mjs 🐛 fix: Restore MCP App Rendering and Actions (#16382) 2026-10-16 13:27:29 -07:00
fake-mcp-dynamic-network-server.js
fake-mcp-http-server.js
fake-mcp-oauth-server.js
fake-mcp-server.js 🩺 fix: Report Union, Object, Array and Later Fields in Tool Validation Feedback (#17885) 2026-11-08 00:00:58 +01:00
fake-model.js 🧾 test: Bill Detached Subagents Their Own Prompt in the Mock Model (#18050) 2026-11-11 10:29:38 -05:00
fake-rag-server.js ⏱️ fix: Bound Remaining Outbound Calls With Timeout Budgets (#17468) 2026-10-29 09:55:18 +01:00
global-setup.email.ts 📬 fix: Require a Click to Submit Email Verification Links (#17905) 2026-11-08 23:39:26 +01:00
global-setup.local.ts
global-setup.ts
global-teardown.email.ts 📧 feat: add email address change (#14597) 2026-10-01 03:46:16 +00:00
global-teardown.local.ts
global-teardown.mock.ts
global-teardown.ts
mailbox-server.js 📧 feat: add email address change (#14597) 2026-10-01 03:46:16 +00:00
mailbox.ts 📧 feat: add email address change (#14597) 2026-10-01 03:46:16 +00:00
model-replay.js
record-model.js
record.js ⏎ fix: Restore Enter to Send as the Default (#17374) 2026-10-23 00:10:44 +02:00
run-files-lifecycle-model.js
run-files-model.js
runtimeEnv.ts
start-server-cluster.js
start-server.js
tool-approval-hook.js
user.ts
users.email.ts 📧 feat: add email address change (#14597) 2026-10-01 03:46:16 +00:00
users.mock.ts