Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 26 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@librechat/agents",
"version": "3.2.61",
"version": "3.2.62",
"main": "./dist/cjs/main.cjs",
"module": "./dist/esm/main.mjs",
"types": "./dist/types/index.d.ts",
Expand Down Expand Up @@ -114,7 +114,7 @@
"scripts": {
"prepare": "node husky-setup.js",
"prepublishOnly": "npm run build",
"build": "rm -rf ./dist && tsdown && tsc -p tsconfig.build.json",
"build": "tsdown && tsc -p tsconfig.build.json",
"build:dev": "tsdown",
"sort-imports": "node scripts/sort-imports.ts",
"sort-imports:check": "node scripts/sort-imports.ts --check",
Expand Down Expand Up @@ -200,7 +200,7 @@
"format": "prettier --write ."
},
"overrides": {
"@langchain/openai": "1.5.3",
"@langchain/openai": "1.5.5",
"@browserbasehq/stagehand": {
"openai": "$openai"
},
Expand All @@ -216,15 +216,15 @@
"@aws-sdk/client-bedrock-runtime": "^3.1075.0",
"@langchain/anthropic": "^1.5.1",
"@langchain/aws": "^1.4.2",
"@langchain/core": "^1.2.1",
"@langchain/core": "^1.2.2",
"@langchain/deepseek": "^1.1.3",
"@langchain/google-common": "2.2.0",
"@langchain/google-gauth": "2.2.0",
"@langchain/google-genai": "2.2.0",
"@langchain/google-vertexai": "2.2.0",
"@langchain/langgraph": "^1.4.6",
"@langchain/mistralai": "^1.2.0",
"@langchain/openai": "1.5.3",
"@langchain/openai": "1.5.5",
"@langchain/textsplitters": "^1.0.1",
"@langchain/xai": "^1.4.3",
"@langfuse/langchain": "^5.4.1",
Expand All @@ -243,7 +243,7 @@
"mathjs": "^15.2.0",
"nanoid": "^3.3.7",
"okapibm25": "^1.4.1",
"openai": "^6.35.0",
"openai": "^6.46.0",
"uuid": "^11.1.1"
},
"peerDependencies": {
Expand Down
41 changes: 41 additions & 0 deletions src/__tests__/stream.eagerEventExecution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3228,6 +3228,47 @@ describe('ChatModelStreamHandler eager event tool execution', () => {
expect(graph.eagerEventToolCallChunks.size).toBe(0);
});

it('does not prestart when parent-run session hooks alter results', async () => {
// A subagent child graph has its own runId, but ToolNode executes hooks
// under the PARENT run id from `configurable.run_id` ONLY — the prestart
// gate must read the same source (a differing metadata run id here is a
// deliberate distractor pinning the precedence).
const sessionRegistry = new HookRegistry();
sessionRegistry.registerSession('parent-run', 'PreToolUse', {
hooks: [async () => ({ decision: 'allow' as const })],
});
const graph = createGraph({
runId: 'child-run',
hookRegistry: sessionRegistry,
config: {
configurable: { user_id: 'user_1', run_id: 'parent-run' },
metadata: { run_id: 'run_1' },
},
} as Partial<StandardGraph>);
const sessionDispatchSpy = jest.spyOn(events, 'safeDispatchCustomEvent');

await new ChatModelStreamHandler().handle(
GraphEvents.CHAT_MODEL_STREAM,
{
chunk: {
content: '',
tool_calls: [
{ id: 'call_weather', name: 'weather', args: { city: 'NYC' } },
],
} as unknown as t.StreamChunk,
},
{ langgraph_node: 'agent', run_id: 'some-other-run' },
graph
);

expect(sessionDispatchSpy).not.toHaveBeenCalledWith(
GraphEvents.ON_TOOL_EXECUTE,
expect.anything(),
expect.anything()
);
expect(graph.eagerEventToolExecutions.size).toBe(0);
});

it('does not prestart when batch-sensitive hooks are configured', async () => {
const graph = createGraph({
hookRegistry: createResultAlteringRegistry(),
Expand Down
2 changes: 2 additions & 0 deletions src/common/enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ export enum ContentTypes {
SUMMARY = 'summary',
/** Bedrock */
REASONING_CONTENT = 'reasoning_content',
/** Mid-run user steer persisted inline in an assistant message; replayed as a user turn */
STEER = 'steer',
}

export enum ToolCallTypes {
Expand Down
Loading
Loading