opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat(session): add LLM API call duration logging

Open shoaibansari5398 opened this issue 15 hours ago • 1 comments

What does this PR do?

Fixes #9037

Adds duration logging for LLM API calls to help users monitor and analyze API latency.

How did you verify your code works?

Changes

  • Modified packages/opencode/src/session/llm.ts.
  • Capture startTime before calling streamText().
  • Wrap fullStream async iterable to log duration on stream completion.
  • Log format: service=llm ... stream completed ... duration=xxx

shoaibansari5398 avatar Jan 17 '26 08:01 shoaibansari5398