Module: AgentHarness::Providers::TokenUsageParsing

Included in:
Aider, GithubCopilot
Defined in:
lib/agent_harness/providers/token_usage_parsing.rb

Overview

Shared token-usage parsing helpers for providers that extract token counts from JSON/JSONL CLI output.

Include this module in any provider that needs to inspect usage payloads (hashes with keys like “input_tokens”, “prompt_tokens”, “output_tokens”, “completion_tokens” and their camelCase variants).

Provider-specific behaviour (e.g. where to locate the payload in the CLI output) stays in the provider class; only the reusable parsing and comparison logic lives here.