Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Would it be possible to expose callId in tool lifecycle events for better tracking? #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
physihan opened this issue Jun 13, 2025 · 0 comments · Fixed by #102
Closed
Labels
enhancement New feature or request package:agents-core package:agents-realtime question Further information is requested

Comments

@physihan
Copy link

Description:

I've been exploring how to track individual tool calls across their lifecycle using the OpenAI Agents JS SDK. I noticed that the agent_tool_start and agent_tool_end events don't seem to include a callId or similar identifier, which makes it a bit tricky to correlate the beginning and end of a specific tool call—especially when a tool may be invoked multiple times concurrently.

Question / Suggestion

Is there a reason why callId (which I believe is used internally to track tool invocations) isn't exposed in the tool lifecycle events?

If it's technically feasible, would it make sense to include it in the emitted events like so?

agent_tool_start: [
  context: RunContext<TContext>,
  agent: Agent<TContext, TOutput>,
  tool: Tool,
  callId: string  // <- possible addition?
];

agent_tool_end: [
  context: RunContext<TContext>,
  agent: Agent<TContext, TOutput>,
  tool: Tool,
  result: string,
  callId: string  // <- possible addition?
];

Why This Might Help

Having access to something like callId would be useful for:

  • Linking agent_tool_start and agent_tool_end for the same tool call
  • Measuring execution time for individual tool invocations
  • Debugging and monitoring concurrent tool usage
  • Correlating human approval workflows with specific tool executions

Current Workaround

At the moment, I'm considering workarounds like generating my own unique IDs per tool invocation, but that feels redundant if the SDK already generates and tracks a callId internally.

Curious to Know

If there's already a way to do this or a better recommended approach, I’d love to hear about it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request package:agents-core package:agents-realtime question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants