Skip to content

feat(opencode): trace tool execution spans - #22531

Merged
kitlangton merged 1 commit into
devfrom
fix/tool-execute-spans
Apr 15, 2026
Merged

kitlangton merged 1 commit into
devfrom
fix/tool-execute-spans

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

Summary

  • add a shared Tool.execute span in the generic tool wrapper so every tool call is timed consistently
  • attach tool.name, tool.call_id, session.id, and message.id attributes for easier Motel queries
  • keep tool-specific spans like ApplyPatchTool.execute intact while adding one uniform top-level span for all tools

Verification

  • ran bun turbo typecheck --filter=opencode in the isolated worktree
  • verified the change is isolated to packages/opencode/src/tool/tool.ts

Why

  • make it easier to compare actual tool execution timing with Session.updatePart / Session.updatePartDelta
  • support debugging cases where the TUI appears to update slightly after the underlying tool side effect has already happened

@kitlangton
kitlangton merged commit 685d79e into dev Apr 15, 2026
11 of 13 checks passed
@kitlangton
kitlangton deleted the fix/tool-execute-spans branch April 15, 2026 14:49
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
isaacfinnegan pushed a commit to isaacfinnegan/whispercode that referenced this pull request Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant