fix: guard span name to always be a non-empty string
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "opencode-agentlens",
|
"name": "opencode-agentlens",
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"description": "OpenCode plugin for AgentLens — trace your coding agent's decisions, tool calls, and sessions",
|
"description": "OpenCode plugin for AgentLens — trace your coding agent's decisions, tool calls, and sessions",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.cjs",
|
"main": "./dist/index.cjs",
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ const plugin: Plugin = async ({ project, directory, worktree }) => {
|
|||||||
state.endToolCall(
|
state.endToolCall(
|
||||||
input.callID,
|
input.callID,
|
||||||
truncate(output.output ?? "", config.maxOutputLength),
|
truncate(output.output ?? "", config.maxOutputLength),
|
||||||
output.title ?? input.tool,
|
output.title ?? input.tool ?? "unknown-tool",
|
||||||
output.metadata as unknown,
|
output.metadata as unknown,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export class SessionState {
|
|||||||
const toolMeta = extractToolMetadata(call.tool, call.args);
|
const toolMeta = extractToolMetadata(call.tool, call.args);
|
||||||
|
|
||||||
trace.addSpan({
|
trace.addSpan({
|
||||||
name: title,
|
name: title || call.tool || "unknown-tool",
|
||||||
type: SpanType.TOOL_CALL,
|
type: SpanType.TOOL_CALL,
|
||||||
parentSpanId: rootSpanId,
|
parentSpanId: rootSpanId,
|
||||||
input: safeJsonValue(call.args),
|
input: safeJsonValue(call.args),
|
||||||
|
|||||||
Reference in New Issue
Block a user