Skip to content

Add cost cap at 80% of revenue; LlmResult dataclass; rename get_credit_price#2543

Merged
hiroshinishio merged 1 commit intomainfrom
wes
Apr 17, 2026
Merged

Add cost cap at 80% of revenue; LlmResult dataclass; rename get_credit_price#2543
hiroshinishio merged 1 commit intomainfrom
wes

Conversation

@hiroshinishio
Copy link
Copy Markdown
Collaborator

@hiroshinishio hiroshinishio commented Apr 17, 2026

Summary

  • Add cost cap that silently stops the agent loop when cumulative LLM cost reaches 80% of the PR's credit charge (revenue), queried across all invocations via get_total_cost_for_pr
  • Replace 5-element tuples from chat_with_claude/chat_with_google with shared LlmResult dataclass for type safety
  • Rename get_credit_costget_credit_price to distinguish revenue (what customer pays) from LLM cost (what we pay)
  • Fix pre-commit hook: remove git add after black/ruff formatting to preserve partial staging (git add -p)

…ns to LlmResult dataclass

- Add COST_CAP_RATIO constant and get_total_cost_for_pr to query cumulative LLM cost across all PR invocations
- Integrate cost cap check into should_bail (silent bail — no customer-facing comment or Slack)
- Replace 5-element tuples from chat_with_claude/chat_with_google with shared LlmResult dataclass
- Rename get_credit_cost → get_credit_price to distinguish revenue (customer price) from LLM cost
- Fix pre-commit hook: remove git add after formatting to preserve partial staging
@hiroshinishio hiroshinishio self-assigned this Apr 17, 2026
@hiroshinishio hiroshinishio merged commit dc3419b into main Apr 17, 2026
1 check passed
@hiroshinishio hiroshinishio deleted the wes branch April 17, 2026 03:23
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.

1 participant