Skip to content

fix(observe): preserve provider prices on planner and failed node events - #140

Merged
Shashankss1205 merged 1 commit into
mainfrom
fix/provider-price-events
Oct 15, 2026
Merged

Shashankss1205 merged 1 commit into
mainfrom
fix/provider-price-events

Conversation

@Shashankss1205

Copy link
Copy Markdown
Collaborator

Planner turns and failed graph nodes currently discard provider-reported USD even though tokens are recorded. Retain the call-specific price and model on planner events, including parse failures, and use the same per-node usage snapshot on successful and failed terminals. Failed parallel nodes now exclude their siblings’ token spend.

Keep missing prices missing and rate-card estimates separate from recorded bills. Preserve nested planner token deduplication and run/thread/tenant attribution without double-counting. Existing tenant assertions now check the corrected priced behavior; the unpriced loop case remains covered. Update the documented producer limit and selected-test figure.

Validation: 23 new regression cases failed against unmodified main; all 29 new cases pass with the fix. Targeted planner, budget, replay, tenant and documentation checks pass; ruff and diff checks are clean. Full local and GitHub CI results will be recorded before merge. No paid model calls.

Fixes #138.

@Shashankss1205 Shashankss1205 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Evaluation of 352b0e4: the producer changes preserve call-specific USD/model metadata on planner success and parse failures, and use one per-node usage snapshot on every terminal error path. Concurrent failed nodes no longer absorb sibling tokens. Nested planner tokens and prices remain counted once; missing prices and rate-card estimates remain separate.

Validation: 23 regression cases fail before the implementation; all 29 new cases pass afterward. The focused cost/planner/replay/budget/tenant run passes 265 tests. The integrated tree through #141 passes the full local default suite: 2,388 passed, 13 skipped and 13 paid tests deselected. Ruff/diff checks and an installed-wheel import walk pass. GitHub CI is still running/queued; no merge yet.

No blocking code findings in this scope. A separate reader-side issue found during follow-up is tracked in #142 and fixed by #143: a reported failed-call price must also survive when token metadata is absent.

Copy link
Copy Markdown
Collaborator Author

Final merge check for 352b0e4: GitHub CI has passed all three full test jobs (Python 3.12, 3.13 and 3.14), lint, installed-distribution validation and the live-test opt-in guard. The schedule-only upstream-drift job is intentionally skipped for PRs. The reviewed head is unchanged. Merging with a normal merge commit to preserve the ancestry of the two follow-up PRs.

@Shashankss1205
Shashankss1205 merged commit da7283c into main Oct 15, 2026
7 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.

observe: provider prices are lost on planner turns and failed node events

1 participant