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
87 changes: 45 additions & 42 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@librechat/agents",
"version": "3.7.17",
"version": "3.7.19",
"reova": {
"enabled": true,
"endpoint": "https://telemetry.reo.dev/data"
Expand Down
7 changes: 7 additions & 0 deletions src/agents/AgentContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export class AgentContext {
): AgentContext {
const {
agentId,
endpoint,
codeSessionKey,
name,
provider,
Expand Down Expand Up @@ -135,6 +136,7 @@ export class AgentContext {

const agentContext = new AgentContext({
agentId,
endpoint,
codeSessionKey,
name: name ?? agentId,
provider,
Expand Down Expand Up @@ -219,6 +221,8 @@ export class AgentContext {

/** Agent identifier */
agentId: string;
/** Logical endpoint selected by the host before provider resolution. */
endpoint: string;
/** Partition for this agent's transient code session and file refs. */
codeSessionKey?: string;
/** Human-readable name for this agent (used in handoff context). Falls back to agentId if not provided. */
Expand Down Expand Up @@ -454,6 +458,7 @@ export class AgentContext {

constructor({
agentId,
endpoint,
codeSessionKey,
name,
provider,
Expand Down Expand Up @@ -481,6 +486,7 @@ export class AgentContext {
maxToolResultChars,
}: {
agentId: string;
endpoint?: string;
codeSessionKey?: string;
name?: string;
provider: t.ProviderName;
Expand Down Expand Up @@ -508,6 +514,7 @@ export class AgentContext {
maxToolResultChars?: number;
}) {
this.agentId = agentId;
this.endpoint = endpoint ?? provider;
this.codeSessionKey = codeSessionKey;
this.name = name;
this.provider = provider;
Expand Down
3 changes: 2 additions & 1 deletion src/graphs/Graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ import { shouldTraceToolNodeForLangfuse } from '@/langfuseToolOutputTracing';
import { createLocalCodingToolBundle } from '@/tools/local/LocalCodingTools';
import { SUBAGENT_REPLAY_CONTROLLER } from '@/tools/subagent/SubagentReplay';
import { applyGraphRuntimeConfig } from '@/graphs/applyGraphRuntimeConfig';
import { isFadingTier, isInformativeFadingTier } from '@/messages/fading';
import { createContextPressureMeter } from '@/llm/contextPressureMeter';
import { safeDispatchCustomEvent, emitAgentLog } from '@/utils/events';
import { prepareProviderRequest } from '@/llm/prepareProviderRequest';
Expand All @@ -163,7 +164,6 @@ import { initializeLangfuseTracing } from '@/instrumentation';
import { shouldTriggerSummarization } from '@/summarization';
import { isRunStepResumeState } from '@/tools/runStepResume';
import { resolveLocalToolsForBinding } from '@/tools/local';
import { isFadingTier, isInformativeFadingTier } from '@/messages/fading';
import { createSummarizeNode } from '@/summarization/node';
import { getTruncationStopReason } from '@/llm/truncation';
import { messagesStateReducer } from '@/messages/reducer';
Expand Down Expand Up @@ -3992,6 +3992,7 @@ export class StandardGraph extends Graph<t.BaseGraphState, t.GraphNode> {
rootAgentName: this.agentContexts.get(this.defaultAgentId)?.name,
activeAgentId: agentId,
activeAgentName: agentContext.name,
endpoint: agentContext.endpoint,
});
let langfuseHandler: CallbackEntry | undefined;
let invokeConfig = {
Expand Down
12 changes: 12 additions & 0 deletions src/langfuse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,10 @@ export function createLangfuseTraceMetadata({
rootAgentName,
activeAgentId,
activeAgentName,
endpoint,
model,
provider,
resolvedProvider,
}: {
messageId?: unknown;
parentMessageId?: unknown;
Expand All @@ -849,6 +853,10 @@ export function createLangfuseTraceMetadata({
rootAgentName?: unknown;
activeAgentId?: unknown;
activeAgentName?: unknown;
endpoint?: unknown;
model?: unknown;
provider?: unknown;
resolvedProvider?: unknown;
}): LangfuseTraceMetadata {
return createTraceMetadata({
messageId,
Expand All @@ -859,6 +867,10 @@ export function createLangfuseTraceMetadata({
rootAgentName,
activeAgentId,
activeAgentName,
endpoint,
model,
provider,
resolvedProvider,
});
}

Expand Down
8 changes: 6 additions & 2 deletions src/llm/bedrock/llm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,9 @@ describe('convertToConverseMessages', () => {
]);

const content = result.converseMessages[0].content!;
expect(content).toHaveLength(1);
expect(content).toHaveLength(2);
// Converse requires a text block alongside document blocks; it is appended last.
expect(content[1]).toEqual({ text: '_' });
const documentBlock = expectDocumentBlock(content[0]);
expect(documentBlock.document.format).toBe('pdf');
expect(documentBlock.document.name).toBeDefined();
Expand Down Expand Up @@ -1397,7 +1399,9 @@ describe('convertToConverseMessages', () => {
]);

const content = result.converseMessages[0].content!;
expect(content).toHaveLength(2);
expect(content).toHaveLength(3);
// Converse requires a text block alongside document blocks; it is appended last.
expect(content[2]).toEqual({ text: '_' });
const firstDocument = expectDocumentBlock(content[0]);
const secondDocument = expectDocumentBlock(content[1]);
expect(firstDocument.document.name).toBeDefined();
Expand Down
Loading
Loading