Epic: #46
Summary
Ensure provider options and accurate usage accounting flow through compaction to prevent miscount and API errors.
Problem
Proposal
- Audit compaction streamText options: headers, providerOptions, includeUsage forwarding.
- Verify usage reporting on
finish-step matches regular prompt path.
Code Refs
- packages/opencode/src/session/compaction.ts:147-179 (streamText options)
- packages/opencode/src/session/compaction.ts:211-220 (usage aggregation)
- packages/opencode/src/provider/transform.ts (ProviderTransform.providerOptions)
Tasks
Acceptance Criteria
- Usage tokens/cost in compaction match those from equivalent non-compaction flows.
- No API errors due to missing options.
Epic: #46
Summary
Ensure provider options and accurate usage accounting flow through compaction to prevent miscount and API errors.
Problem
includeUsage(I can not configure the limit for litellm anomalyco/opencode#2787) for accurate tokens/cost.Proposal
finish-stepmatches regular prompt path.Code Refs
Tasks
Acceptance Criteria