Skip to content

[SSR Agent] Issue Fix (283): Update LLMResponse usageMetadata documentation - #284

Open
joneba-google wants to merge 1 commit into
mainfrom
ssr-agent-283
Open

joneba-google wants to merge 1 commit into
mainfrom
ssr-agent-283

Conversation

@joneba-google

Copy link
Copy Markdown
Collaborator

fixes #283
Original issue: #283

Context & Problem

The hook reference documentation for LLMResponse.usageMetadata incorrectly omitted promptTokenCount and candidatesTokenCount. This was due to incomplete documentation in docs/hooks/reference.md relative to the exported LLMResponse interface and the hook translator implementation in packages/core/src/hooks/hookTranslator.ts.

Detailed Changes

  • docs/hooks/reference.md: Updated the usageMetadata schema block under LLMResponse to explicitly document promptTokenCount, candidatesTokenCount, and totalTokenCount.
  • packages/core/src/hooks/hookTranslator.test.ts: Added a unit test to verify that converting hook responses back to the SDK format correctly preserves usageMetadata token counts (promptTokenCount, candidatesTokenCount, and totalTokenCount).

Verification

  • Static inspection verifies that the documented properties align perfectly with the LLMResponse TypeScript interface.
  • Unit tests in packages/core/src/hooks/hookTranslator.test.ts have been added to prevent regressions.
  • The linter check run on the modified files completed successfully with no errors or warnings.

@github-actions github-actions Bot added the size/S S: 10-49 lines changed label Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

📊 PR Size: size/S

  • Lines changed: 34
  • Additions: +33
  • Deletions: -1
  • Files changed: 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S S: 10-49 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(hooks): LLMResponse usageMetadata in the reference omits promptTokenCount and candidatesTokenCount (the hook receives all three)

1 participant