Phase 0: remove hardcoded API key/proxy, restore BYO-key auth, model-aware cost estimates - #14
Open
zackkitzmiller wants to merge 2 commits into
Open
Phase 0: remove hardcoded API key/proxy, restore BYO-key auth, model-aware cost estimates#14zackkitzmiller wants to merge 2 commits into
zackkitzmiller wants to merge 2 commits into
Conversation
…are cost estimates - ClaudeProvider::new now uses the caller's API key and defaults to https://api.anthropic.com; with_base_url works outside tests so --api-base-url / ANTHROPIC_BASE_URL / config base_url are honored - main.rs resolves the key via config (env/CLI/config.toml) and fails with a clear message when AI analysis needs one; --no-ai and --dupes-only run without a key - cost.rs prices by configured model family (haiku/sonnet/opus/fable) instead of hardcoded Sonnet rates; PipelineConfig carries the model - default model bumped to claude-opus-5 (drop-in at opus-4-8 pricing) - README: document real key setup, drop nonexistent --describe-only
2 tasks
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.
Why
src/ai/claude.rsshipped with a real Anthropic API key hardcoded in source and forced every request tohttp://localhost:8787, discarding the caller's key entirely. The AI pipeline could not work anywhere without that local proxy, and the key is exposed in git history and the published crates.io 0.1.3 release.Changes
ClaudeProvider::newhonors the passed key; default base URL ishttps://api.anthropic.com;with_base_urlnow works in release builds, so--api-base-url/ANTHROPIC_BASE_URL/[ai].base_urlare honored.main.rs: key resolved from CLI flag → env → config.toml via the existingconfig.api_key()(which already has a friendly error).--no-ai/--dupes-only/--undoneed no key.cost.rsprices by model family (haiku $1/$5, sonnet $3/$15, opus $5/$25, fable $10/$50 per MTok) instead of hardcoded Sonnet rates;PipelineConfigcarries the model id.claude-opus-5(drop-in successor at the same price as opus-4-8).--describe-onlyflag.cargo yank --version 0.1.3) and publish 0.1.4 from this branch.Test plan
cargo test— 334 passed (incl. new pricing-by-model tests)cargo clippy --all-targets— cleangrepconfirms no trace of the key orlocalhost:8787in the tree