[PR #9052] feat(session): add LLM API call duration logging #12967

Open
opened 2026-02-16 18:17:51 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9052

State: open
Merged: No


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
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9052 **State:** open **Merged:** No --- ### 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`
yindo added the pull-request label 2026-02-16 18:17:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12967