mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 13:00:55 +00:00
* 🧾 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. |
||
|---|---|---|
| .. | ||
| agent-management.ts | ||
| authenticate.ts | ||
| cleanupUser.ts | ||
| dynamic-mcp-tools.js | ||
| env.ts | ||
| fake-assistants-server.js | ||
| fake-code-server.js | ||
| fake-flux-server.js | ||
| fake-git-host-server.js | ||
| fake-label-server.js | ||
| fake-mcp-app-server.mjs | ||
| fake-mcp-dynamic-network-server.js | ||
| fake-mcp-http-server.js | ||
| fake-mcp-oauth-server.js | ||
| fake-mcp-server.js | ||
| fake-model.js | ||
| fake-rag-server.js | ||
| global-setup.email.ts | ||
| global-setup.local.ts | ||
| global-setup.ts | ||
| global-teardown.email.ts | ||
| global-teardown.local.ts | ||
| global-teardown.mock.ts | ||
| global-teardown.ts | ||
| mailbox-server.js | ||
| mailbox.ts | ||
| model-replay.js | ||
| record-model.js | ||
| record.js | ||
| 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 | ||
| users.mock.ts | ||