fix: guard span name to always be a non-empty string

This commit is contained in:
Vectry
2026-02-10 12:35:31 +00:00
parent 7e44ccb9e7
commit 7534c709f5
3 changed files with 3 additions and 3 deletions

View File

@@ -173,7 +173,7 @@ const plugin: Plugin = async ({ project, directory, worktree }) => {
state.endToolCall(
input.callID,
truncate(output.output ?? "", config.maxOutputLength),
output.title ?? input.tool,
output.title ?? input.tool ?? "unknown-tool",
output.metadata as unknown,
);
},

View File

@@ -99,7 +99,7 @@ export class SessionState {
const toolMeta = extractToolMetadata(call.tool, call.args);
trace.addSpan({
name: title,
name: title || call.tool || "unknown-tool",
type: SpanType.TOOL_CALL,
parentSpanId: rootSpanId,
input: safeJsonValue(call.args),