fix(pricing): add Claude Opus 4.8 to MODEL_PRICING dict#4
Open
ezwep wants to merge 2 commits into
Open
Conversation
- Replace UNION-then-date-sort with two FTS5 queries that yield BM25
scores per matching session. Title hits get a 200pt boost so a query
match in the conversation title outranks a body-only match.
- Add a "Best match" sort option (default for active searches) and
preserve existing date/token/cost sorts when the user picks them.
- Pass the FTS5 snippet() output (with <mark> tags) back to the UI,
rendered as a highlighted excerpt under each card so users can see
why a session matches.
- Smarter query parser: multi-word input becomes implicit-AND with
prefix matching on each token; quoted phrases, NEAR, NOT, and column
filters still pass through to FTS5 verbatim.
- Surface invalid FTS syntax (e.g. unbalanced quotes) as an inline
status banner under the search input instead of silently returning
zero results.
- Return shape changed from list to {conversations, search} so the UI
can show match counts and errors. Backward-compatible array fallback
in the JS callsite.
Prior to this fix, all Opus 4.8 tokens returned (0.0, False) from estimate_message_cost_usd — silently underestimating dashboard cost totals. On the local index this masked ~3.9B Opus 4.8 tokens / week that should have surfaced as a real spend in the high-four-figures range. Applied Opus 4.7 rates as conservative fallback ($5/$25 input/output, $0.50 cache read, $6.25/$10 cache writes) following the established pattern from PR #1 (Opus 4.7 fallback). Anthropic typically holds pricing constant across minor version bumps so this is a safe default until verified against the public pricing page. Also added -latest alias for forward-compat.
5 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.
Companion to PR #1 (Opus 4.7). Without this, Opus 4.8 tokens silently return zero cost — masking the bulk of weekly spend on the dashboard.
On my local index (last 7 days):
Applied Opus 4.7 rates ($5 in / $25 out / $0.50 cache read / $6.25-$10 cache writes) following the same conservative-fallback pattern Vincent used for Opus 4.6→4.7. Also adds the `-latest` alias for forward-compat.
Test plan