Download this file
| 1 | package schedule |
| 2 | |
| 3 | // Copy has a hard ceiling: the normal lowest-available fallback cannot spend |
| 4 | // above either standard or the account's current cap. Unclassified plans wait. |
| 5 | func copyInput(in Input) Input { |
| 6 | out := make([]Conn, 0, len(in.Conns)) |
| 7 | for _, c := range in.Conns { |
| 8 | cap := min(tierRank(TierStandard), tierRank(TierCap(c))) |
| 9 | models := []Model{} |
| 10 | for _, m := range c.Models { |
| 11 | rank := tierRank(m.Tier) |
| 12 | if rank >= tierRank(TierCheap) && rank <= cap { |
| 13 | models = append(models, m) |
| 14 | } |
| 15 | } |
| 16 | c.Models = models |
| 17 | if len(models) == 0 { |
| 18 | c.Capable = false |
| 19 | } |
| 20 | out = append(out, c) |
| 21 | } |
| 22 | in.Conns = out |
| 23 | return in |
| 24 | } |
| 25 | |
| 26 | // Only these exact subscription model IDs have a v1 Copy tier. A new alias |
| 27 | // waits for classification instead of inheriting a tier from its spelling. |
| 28 | func CopySubscriptionModel(provider, model string) (Model, bool) { |
| 29 | known := provider == "claude" && (model == "claude-haiku-5" || model == "claude-haiku-5-5") || provider == "codex" && model == "gpt-6-luna" |
| 30 | if !known { |
| 31 | return Model{}, false |
| 32 | } |
| 33 | return Model{ID: model, Family: provider, Tier: TierCheap}, true |
| 34 | } |
| 35 | |