Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/integration-governance.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const MAX_COMMITS = 1000;
const MAX_AUTHOR_BATCH = 50;
// This literal is inside the enrolled .github closure. A caller-supplied
// preparedBy.sourceSHA must never choose a new executable verifier tree.
const TRUSTED_SCRIPTS_TREE = '78d89054cc569554b1066b2eb2e322a7f38c285a';
const TRUSTED_SCRIPTS_TREE = 'c269cb813e67f341946dedd7ba9ab967a0530831';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unrelated to the PR and undisclosed: this rewrites the trusted verifier tree hash. Please revert this hunk, or explain how c269cb81… was derived.

const SOURCE = 'https://github.com/kubernetes-sigs/kubebuilder-release-tools/tree/012269a88fa4c034a0acf1ba84c26b195c0dbab4';
const sha = value => crypto.createHash('sha256').update(value).digest('hex');
const git = (args, cwd = process.cwd()) =>
Expand Down
1 change: 1 addition & 0 deletions changelog.d/fixed-18753-claude-fable-haiku-5-5-models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- **The claude model dropdown now offers Fable 5.2, Fable 5.1, Haiku 5.5 and the `fable` alias, and their spend is priced exactly** ([#18753](https://github.com/hivecommons/hive/issues/18753)). The pinned Claude Code 2.1.326 accepts all four, but the dashboard's allowlist, its static fallback and the browser's first-paint list stopped at Fable 5 and Haiku 4.5, so a live Anthropic catalog that listed the newer models was cut back to the old ones. The price table gains Fable 5.2 ($8 in / $40 out, $0.20 cache read, $10 cache write) and Haiku 5.5 ($0.10 / $0.50, $0.01, $0.125) from Anthropic's pricing page, so their spend is no longer a tier guess. Haiku 5.5 is priced at its base rate for prompts up to 100,000 tokens; longer prompts bill higher and are undercounted.
70 changes: 70 additions & 0 deletions src/pkg/dashboard/cli_model_lists_9804_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dashboard

import (
"net/http"
"regexp"
"strings"
"testing"
Expand Down Expand Up @@ -93,6 +94,75 @@ func TestIssue9804AllowlistsKeepLiveSonnet55(t *testing.T) {
}
}

// TestIssue18753ClaudeListsOfferFableAndHaiku55 pins the #18753 refresh: the
// ids Claude Code 2.1.326 accepts (Fable 5.2 from 2.1.321, Fable 5.1 from
// 2.1.257, Haiku 5.5 from 2.1.293) and the bare `fable` alias are in every
// claude list, and the browser fallback still matches the Go one.
func TestIssue18753ClaudeListsOfferFableAndHaiku55(t *testing.T) {
newIDs := []string{"claude-fable-5-2", "claude-fable-5-1", "claude-haiku-5-5", "fable"}
html := indexHTML(t)
lists := []struct {
name string
ids []string
}{
{"claudeStaticModels", claudeStaticModels},
{"claudePinnedCLIModels", claudePinnedCLIModels},
{"CLAUDE_CLI_MODELS", htmlModelValues(t, html, "CLAUDE_CLI_MODELS")},
}
for _, l := range lists {
for _, id := range newIDs {
if !contains(l.ids, id) {
t.Errorf("%s missing %q: %v", l.name, id, l.ids)
}
}
}
if !contains(claudeAlwaysIncludeModels, "fable") {
t.Errorf("claudeAlwaysIncludeModels missing the bare fable alias: %v", claudeAlwaysIncludeModels)
}
// Newest first within the Fable family, as the lists already order Opus
// and Sonnet.
for _, l := range lists {
i52, i51, i5 := modelIndex(l.ids, "claude-fable-5-2"), modelIndex(l.ids, "claude-fable-5-1"), modelIndex(l.ids, "claude-fable-5")
if !(i52 < i51 && i51 < i5) {
t.Errorf("%s Fable order = 5.2@%d 5.1@%d 5@%d, want newest first", l.name, i52, i51, i5)
}
}
}

// TestIssue18753LiveClaudeModelsSurviveAllowlist: a live /v1/models answer
// carrying the new ids keeps them after the pinned-CLI cut, while an id the
// pinned CLI is not known to accept is still dropped.
func TestIssue18753LiveClaudeModelsSurviveAllowlist(t *testing.T) {
writeClaudeCredentials(t, "tok", futureExpiryMs())
t.Setenv("ANTHROPIC_API_KEY", "")
ts := claudeModelsTestServer(t, http.StatusOK,
`{"data":[{"id":"claude-fable-5-2"},{"id":"claude-haiku-5-5"},{"id":"claude-fable-5-1"},{"id":"claude-mythos-5-2"},{"id":"claude-opus-5-5"}]}`, nil)
redirectAnthropicEndpoint(t, ts.URL)

s := &Server{cliModels: newCLIModelCache(), logger: testLogger()}
r := s.queryCLIModels("claude")
if r.fallback {
t.Fatalf("live probe must not be fallback: %+v", r)
}
for _, want := range []string{"claude-fable-5-2", "claude-haiku-5-5", "claude-fable-5-1", "claude-opus-5-5", "fable"} {
if !contains(r.models, want) {
t.Errorf("live claude list lost %q: %v", want, r.models)
}
}
if contains(r.models, "claude-mythos-5-2") {
t.Errorf("claude-mythos-5-2 is not in claudePinnedCLIModels and must be cut: %v", r.models)
}
}

func modelIndex(list []string, want string) int {
for i, v := range list {
if v == want {
return i
}
}
return -1
}

func TestIssue9804OmpSonnet55ReasoningLevels(t *testing.T) {
if got := ompStaticReasoningEfforts["anthropic/claude-sonnet-5-5"]; !equalStrings(got, []string{"low", "medium", "high", "xhigh", "max"}) {
t.Fatalf("Sonnet 5.5 OMP reasoning levels = %v", got)
Expand Down
29 changes: 22 additions & 7 deletions src/pkg/dashboard/cli_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,22 @@ func setCopilotSDKHelperPathForTest(t interface {
// file) or fails. Live discovery via api.anthropic.com/v1/models is strongly
// preferred; this is only a floor so the dropdown is never empty. Refreshed
// 2026-08-03 from a live /v1/models response (11 ids, in API order);
// claude-sonnet-5-5 added per the Claude Code 2.1.284 changelog (#9804). Keep
// it in sync with CLAUDE_CLI_MODELS in static/index.html. Both the canonical
// ids AND the bare aliases the CLI accepts are included.
// claude-sonnet-5-5 added per the Claude Code 2.1.284 changelog (#9804).
// Refreshed 2026-11-17 (#18753) from Anthropic's models overview and the
// Claude Code changelog: claude-fable-5-2 (2.1.321), claude-fable-5-1
// (2.1.257), claude-haiku-5-5 (2.1.293) and the bare `fable` alias, all
// accepted by the pinned 2.1.326. Keep it in sync with CLAUDE_CLI_MODELS in
// static/index.html. Both the canonical ids AND the bare aliases the CLI
// accepts are included.
var claudeStaticModels = []string{
"claude-opus-5-5",
"claude-opus-5",
"claude-sonnet-5-5",
"claude-sonnet-5",
"claude-fable-5-2",
"claude-fable-5-1",
"claude-fable-5",
"claude-haiku-5-5",
"claude-opus-4-8",
"claude-opus-4-7",
"claude-sonnet-4-6",
Expand All @@ -287,6 +294,7 @@ var claudeStaticModels = []string{
"opus",
"sonnet",
"haiku",
"fable",
}

// copilotStaticModels is the fallback offered when the Copilot models probe
Expand Down Expand Up @@ -393,6 +401,7 @@ var claudeAlwaysIncludeModels = []string{
"opus",
"sonnet",
"haiku",
"fable",
}

// bobStaticModels is bob's complete model list: exactly one entry, the auto
Expand Down Expand Up @@ -443,16 +452,21 @@ var geminiStaticModels = []string{
}

// claudePinnedCLIModels is the closed model set accepted by the Claude Code
// version pinned in src/Dockerfile. The Anthropic account catalog can list
// models that the installed CLI refuses with "version X or newer is required";
// intersecting live and fallback lists with this set keeps the dashboard from
// offering a value this image cannot launch (#8418).
// version pinned in src/Dockerfile (2.1.326 as of #18753). The Anthropic
// account catalog can list models that the installed CLI refuses with
// "version X or newer is required"; intersecting live and fallback lists with
// this set keeps the dashboard from offering a value this image cannot launch
// (#8418). Each id's first accepting CLI version is recorded in
// src/scripts/cli-model-requirements.txt.
var claudePinnedCLIModels = []string{
"claude-opus-5-5",
"claude-opus-5",
"claude-sonnet-5-5",
"claude-sonnet-5",
"claude-fable-5-2",
"claude-fable-5-1",
"claude-fable-5",
"claude-haiku-5-5",
"claude-opus-4-8",
"claude-opus-4-7",
"claude-sonnet-4-6",
Expand All @@ -464,6 +478,7 @@ var claudePinnedCLIModels = []string{
"opus",
"sonnet",
"haiku",
"fable",
}

// geminiPinnedCLIModels is the conservative Gemini CLI allowlist used to bound
Expand Down
8 changes: 7 additions & 1 deletion src/pkg/dashboard/static-src/js/backends-tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,18 @@
// pkg/dashboard/cli_models.go; keep the two lists in sync). Refreshed
// 2026-08-03 from a live /v1/models response, in API order, plus the bare
// aliases the claude CLI accepts as --model values; Sonnet 5.5 added per
// the Claude Code 2.1.284 changelog (#9804).
// the Claude Code 2.1.284 changelog (#9804). Refreshed 2026-11-17
// (#18753) from Anthropic's models overview and the Claude Code
// changelog: Fable 5.2, Fable 5.1, Haiku 5.5 and the `fable` alias.
const CLAUDE_CLI_MODELS = [
{ value: 'claude-opus-5-5', label: 'Opus 5.5' },
{ value: 'claude-opus-5', label: 'Opus 5' },
{ value: 'claude-sonnet-5-5', label: 'Sonnet 5.5' },
{ value: 'claude-sonnet-5', label: 'Sonnet 5' },
{ value: 'claude-fable-5-2', label: 'Fable 5.2' },
{ value: 'claude-fable-5-1', label: 'Fable 5.1' },
{ value: 'claude-fable-5', label: 'Fable 5' },
{ value: 'claude-haiku-5-5', label: 'Haiku 5.5' },
{ value: 'claude-opus-4-8', label: 'Opus 4.8' },
{ value: 'claude-opus-4-7', label: 'Opus 4.7' },
{ value: 'claude-sonnet-4-6', label: 'Sonnet 4.6' },
Expand All @@ -67,6 +72,7 @@
{ value: 'opus', label: 'Opus (alias)' },
{ value: 'sonnet', label: 'Sonnet (alias)' },
{ value: 'haiku', label: 'Haiku (alias)' },
{ value: 'fable', label: 'Fable (alias)' },
];
const COPILOT_CLI_MODELS = [
// Auto sentinel: `copilot --model auto` lets the Copilot CLI pick/adjust
Expand Down
8 changes: 7 additions & 1 deletion src/pkg/dashboard/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39256,13 +39256,18 @@ <h2 class="config-title" id="activity-monitor-labels-title">All labels</h2>
// pkg/dashboard/cli_models.go; keep the two lists in sync). Refreshed
// 2026-08-03 from a live /v1/models response, in API order, plus the bare
// aliases the claude CLI accepts as --model values; Sonnet 5.5 added per
// the Claude Code 2.1.284 changelog (#9804).
// the Claude Code 2.1.284 changelog (#9804). Refreshed 2026-11-17
// (#18753) from Anthropic's models overview and the Claude Code
// changelog: Fable 5.2, Fable 5.1, Haiku 5.5 and the `fable` alias.
const CLAUDE_CLI_MODELS = [
{ value: 'claude-opus-5-5', label: 'Opus 5.5' },
{ value: 'claude-opus-5', label: 'Opus 5' },
{ value: 'claude-sonnet-5-5', label: 'Sonnet 5.5' },
{ value: 'claude-sonnet-5', label: 'Sonnet 5' },
{ value: 'claude-fable-5-2', label: 'Fable 5.2' },
{ value: 'claude-fable-5-1', label: 'Fable 5.1' },
{ value: 'claude-fable-5', label: 'Fable 5' },
{ value: 'claude-haiku-5-5', label: 'Haiku 5.5' },
{ value: 'claude-opus-4-8', label: 'Opus 4.8' },
{ value: 'claude-opus-4-7', label: 'Opus 4.7' },
{ value: 'claude-sonnet-4-6', label: 'Sonnet 4.6' },
Expand All @@ -39274,6 +39279,7 @@ <h2 class="config-title" id="activity-monitor-labels-title">All labels</h2>
{ value: 'opus', label: 'Opus (alias)' },
{ value: 'sonnet', label: 'Sonnet (alias)' },
{ value: 'haiku', label: 'Haiku (alias)' },
{ value: 'fable', label: 'Fable (alias)' },
];
const COPILOT_CLI_MODELS = [
// Auto sentinel: `copilot --model auto` lets the Copilot CLI pick/adjust
Expand Down
11 changes: 10 additions & 1 deletion src/pkg/tokens/pricing.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (
// - DeepSeek: https://api-docs.deepseek.com/quick_start/pricing
// - Kimi: https://platform.kimi.ai/docs/pricing/chat
// - Meta Llama / Gemini: representative OpenRouter/provider list prices
const priceTableDate = "2026-11-09"
const priceTableDate = "2026-11-17"

// PriceTableDate returns the date the price table was last reconciled with
// published list prices, so the UI can show "list prices as of <date>".
Expand Down Expand Up @@ -104,6 +104,9 @@ var modelPrices = map[string]ModelPrice{
// Fable 5.1 is the same list tier as Fable 5 (#13488); without this entry it
// fell to tierBig at roughly half the real rate and was flagged estimated.
"claude-fable-5-1": {InputPerMTok: 10.00, OutputPerMTok: 50.00, CacheReadPerMTok: 0.25, CacheWritePerMTok: 12.50},
// Fable 5.2: $8 in / $40 out; cache read $0.20 (0.025×), cache write $10
// (5-minute TTL) — per Anthropic's pricing page, 2026-11-17 (#18753).
"claude-fable-5-2": {InputPerMTok: 8.00, OutputPerMTok: 40.00, CacheReadPerMTok: 0.20, CacheWritePerMTok: 10.00},
// Sonnet 5.5: $2 in / $10 out; cache read $0.20, cache write $2.50 (1.25×)
// — per the Claude Code 2.1.284 changelog ("$2/$10 per Mtok with
// $0.20/Mtok cache reads", #9804).
Expand All @@ -114,6 +117,12 @@ var modelPrices = map[string]ModelPrice{
"claude-sonnet-4-5": {InputPerMTok: 3.00, OutputPerMTok: 15.00, CacheReadPerMTok: 0.30, CacheWritePerMTok: 3.75},
// Haiku tier: $1 in / $5 out; cache read $0.10, cache write $1.25.
"claude-haiku-4-5": {InputPerMTok: 1.00, OutputPerMTok: 5.00, CacheReadPerMTok: 0.10, CacheWritePerMTok: 1.25},
// Haiku 5.5: base rate for prompts up to 100,000 tokens — $0.10 in /
// $0.50 out; cache read $0.01, cache write $0.125 (5-minute TTL) — per
// Anthropic's pricing page, 2026-11-17 (#18753). Prompts over 100,000
// tokens bill at $0.50 / $2.50 (cache read $0.05, write $0.625); that
// tier is not tracked here, so long-prompt Haiku 5.5 spend is undercounted.
"claude-haiku-5-5": {InputPerMTok: 0.10, OutputPerMTok: 0.50, CacheReadPerMTok: 0.01, CacheWritePerMTok: 0.125},

// ---- OpenAI GPT-5.x (Copilot/Codex model ids; representative list prices) ----
// GPT-5.x flagship: $1.25 in / $10 out; cached input $0.125.
Expand Down
51 changes: 51 additions & 0 deletions src/pkg/tokens/pricing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,54 @@ func TestFable51PricedAtFable5ListRate(t *testing.T) {
t.Errorf("claude-fable-5.1 = %+v, want fable-5 input/output rates %+v", p, want)
}
}

// TestIssue18753FableAndHaiku55PricedExactly: Fable 5.2 and Haiku 5.5 have
// rows at Anthropic's published rates (Haiku 5.5 at its up-to-100K-token base
// rate), every spelling a spend record or Copilot can carry resolves to the
// same row, and a spend sample is priced exactly instead of by the tier guess.
func TestIssue18753FableAndHaiku55PricedExactly(t *testing.T) {
cases := []struct {
canonical string
spellings []string
want ModelPrice
// 1M input + 1M output + 1M cache read + 1M cache write.
wantUSD float64
}{
{
canonical: "claude-fable-5-2",
spellings: []string{"claude-fable-5.2", "anthropic/claude-fable-5.2", "Claude-Fable-5-2"},
want: ModelPrice{InputPerMTok: 8.00, OutputPerMTok: 40.00, CacheReadPerMTok: 0.20, CacheWritePerMTok: 10.00},
wantUSD: 8.00 + 40.00 + 0.20 + 10.00,
},
{
canonical: "claude-haiku-5-5",
spellings: []string{"claude-haiku-5.5", "anthropic/claude-haiku-5.5"},
want: ModelPrice{InputPerMTok: 0.10, OutputPerMTok: 0.50, CacheReadPerMTok: 0.01, CacheWritePerMTok: 0.125},
wantUSD: 0.10 + 0.50 + 0.01 + 0.125,
},
}
for _, tc := range cases {
t.Run(tc.canonical, func(t *testing.T) {
got, priced := LookupPrice(tc.canonical)
if !priced {
t.Fatalf("%s has no price row; it would fall back to the tier guess", tc.canonical)
}
if got != tc.want {
t.Errorf("%s = %+v, want %+v", tc.canonical, got, tc.want)
}
for _, s := range tc.spellings {
p, ok := LookupPrice(s)
if !ok || p != got {
t.Errorf("%q = %+v (priced=%v), want the %s row %+v", s, p, ok, tc.canonical, got)
}
}
usd, exact := EstimateCostUSD(tc.canonical, 1_000_000, 1_000_000, 1_000_000, 1_000_000)
if !exact {
t.Errorf("%s spend was tier-estimated, want an exact list price", tc.canonical)
}
if math.Abs(usd-tc.wantUSD) > 1e-6 {
t.Errorf("%s 1M of each token kind = $%.6f, want $%.6f", tc.canonical, usd, tc.wantUSD)
}
})
}
}
3 changes: 3 additions & 0 deletions src/scripts/cli-model-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
# version, its allowlist must contain the model. Add a line when a CLI release
# introduces a model (#9805).
claude claude-sonnet-5-5 2.1.284
claude claude-fable-5-1 2.1.257
claude claude-haiku-5-5 2.1.293
claude claude-fable-5-2 2.1.321
6 changes: 5 additions & 1 deletion src/scripts/test-check-cli-model-lists.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ var claudePinnedCLIModels = []string{
}
GO
}
# A fixed requirements file, not the real one: the cases below are about the
# Sonnet 5.5 line, and the real file grows a line with every model refresh
# (#18753), which would otherwise fail these fixtures' two-model allowlist.
printf '# fixture\nclaude claude-sonnet-5-5 2.1.284\n' > "$TMP/requirements.txt"
run() { HIVE_PIN_DOCKERFILE="$TMP/Dockerfile" HIVE_MODELS_GO="$TMP/models.go" \
HIVE_MODEL_REQUIREMENTS="$HERE/cli-model-requirements.txt" "$@" bash "$SCRIPT" >"$TMP/out" 2>&1 && RC=0 || RC=$?; }
HIVE_MODEL_REQUIREMENTS="$TMP/requirements.txt" "$@" bash "$SCRIPT" >"$TMP/out" 2>&1 && RC=0 || RC=$?; }

fixtures 2.1.284 2.1.284 '"claude-sonnet-5-5",'
run env; [ $RC -eq 0 ] && grep -q consistent "$TMP/out" && pass "consistent lists pass" || fail "consistent" "$(cat "$TMP/out")"
Expand Down
Loading