feat: credit pricing P1+P2 — sync, agent cap, BYOK fee scaffolding#64
Closed
escapeboy wants to merge 1 commit intofeat/credit-pricing-overhaulfrom
Closed
feat: credit pricing P1+P2 — sync, agent cap, BYOK fee scaffolding#64escapeboy wants to merge 1 commit intofeat/credit-pricing-overhaulfrom
escapeboy wants to merge 1 commit intofeat/credit-pricing-overhaulfrom
Conversation
…, agent cap, BYOK fee
Stacked on feat/credit-pricing-overhaul (P0). Closes the P1/P2 backlog.
P1-1 Helicone pricing sync command — `php artisan llm-pricing:sync`. Daily
03:30 cron fetches Helicone aggregator, diffs vs current snapshot, rotates
when drift > 5%. Sanity ceiling at 50% per model triggers manual-review
flag instead of auto-apply. Graceful no-op in community installs.
P2-1 Per-agent max_credits_per_call — Agent gains effective cap helper
with documented precedence (agent → team → config). EnforceMaxCreditsPerCallAction
accepts optional agentId; BudgetEnforcement middleware threads it from
AiRequestDTO. UI exposed in CreateAgentForm + AgentDetailPage gated on
Schema::hasColumn for community-edition compat.
P2-5 BYOK platform fee scaffolding — config('llm_pricing.byok_platform_fee_per_call')
default 0 (current behavior preserved). Per-team override via teams column
(handled in cloud override Team model). Flat fee deducted on BYOK calls
when > 0; distinct log event `platform_credits_byok_fee_charged`.
Cost alerts thresholds added: bleeding_team_ratio, stale_pricing_days,
margin_drift_threshold_pct (consumed by EvaluateCostAlertsCommand in cloud).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Base companion to escapeboy/agent-fleet#TBD (cloud P1+P2). Stacked on PR #63 (P0). Adds:
Test plan