Skip to content

fix(runtime): align optimizer receipt with served model - #816

Merged
drewstone merged 1 commit into
mainfrom
fix/optimizer-receipt-observed-model-20260813
Aug 13, 2026
Merged

fix(runtime): align optimizer receipt with served model#816
drewstone merged 1 commit into
mainfrom
fix/optimizer-receipt-observed-model-20260813

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

Problem

Official optimizer calls returned the routed served model in response.model, but Runtime built the cost receipt with the requested bare alias. Eval correctly rejected the mismatch before recording the paid call.

Fix

Use the observed served model for successful optimizer receipts and for failed executions only when it matches the declared profile model. Keep the requested alias when Runtime has no trustworthy observation.

The response, receipt, and execution evidence now retain one provider-qualified model identity, including its snapshot.

Verification

  • pnpm exec vitest run src/runtime/profile-chat-client.test.ts — 17 passed
  • pnpm run typecheck — passed
  • pnpm run lint — passed
  • pnpm test — 2,573 passed, 6 skipped, 2 skipped files
  • pnpm run check:testing-fixture — passed
  • pnpm run docs:freshness — passed
  • pnpm run check:version-bump — passed

@tangletools tangletools left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved drewstone PR — 187e2c54

This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.

tangletools · auto-approval · reason: drewstone_author · 2026-08-13T04:41:30Z

@drewstone
drewstone merged commit 9a3822d into main Aug 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants