The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Rate a named gpt-6.1-sol by its own routing row, so it may review (#2271)
0xken158e5cedabee29
diff --git a/backend/src/routes/superTabs.ts b/backend/src/routes/superTabs.tsindex e8ddd2aca..fff01d1a2 100644--- a/backend/src/routes/superTabs.ts+++ b/backend/src/routes/superTabs.ts@@ -10,7 +10,7 @@ import { operationSchema } from '../superTabs/commands.js'import { fail, SuperTabError } from '../superTabs/model.js'import { SuperTabStore } from '../superTabs/store.js'import { redisPollMemory } from '../superTabs/pollMemory.js'-import { routingPolicySchema } from '../superTabs/routingPolicy.js'+import { routingPolicySaveSchema } from '../superTabs/routingPolicy.js'import { nativeEventSchema, openNativeSchema } from '../superTabs/native.js'import { machineObservationSchema } from '../superTabs/machines.js'import { joinSwarmSchema, previewJoinSchema, saveSharingSchema } from '../superTabs/sharing.js'@@ -104,7 +104,7 @@ const deliveryAction = z.discriminatedUnion('type', [])const mentionQuery = z.object({ state: z.enum(['waiting', 'earlier']) }).strict()const personDecisionQuery = agentQuery.extend({ state: z.enum(['open', 'answered', 'settled']) }).strict()-const savePolicy = z.object({ revision: z.number().int().nonnegative().safe(), policy: routingPolicySchema }).strict()+const savePolicy = z.object({ revision: z.number().int().nonnegative().safe(), policy: routingPolicySaveSchema }).strict()const stop = z.object({ assignmentId: id, receipt: z.string().min(1).max(2000) }).strict()const githubToken = z.object({ machineId: id }).strict()const githubStartToken = z.object({ always: z.boolean().optional() }).strict()diff --git a/backend/src/superTabs/commands.test.ts b/backend/src/superTabs/commands.test.tsindex 6fd5b9c4c..185694a43 100644--- a/backend/src/superTabs/commands.test.ts+++ b/backend/src/superTabs/commands.test.ts@@ -638,6 +638,12 @@ describe('tab.routingPolicy', () => {expect(() => commandSchema.parse({ type: 'tab.routingPolicy', policy: { quotaReserve: 99 } })).toThrow()expect(() => f.run({ type: 'tab.routingPolicy', policy: { quotaReserve: 99 } } as never)).toThrow()})+ it('refuses a second row for a built-in model', () => {+ const sol = DEFAULT_ROUTING_POLICY.models.find(m => m.model === 'gpt-6.1-sol')!+ expect(() => commandSchema.parse({ type: 'tab.routingPolicy', policy: { models: [sol, { ...sol, enabled: false }] } }))+ .toThrow('Only one row for codex gpt-6.1-sol.')+ expect(commandSchema.parse({ type: 'tab.routingPolicy', policy: { models: [sol] } })).toBeTruthy()+ })})describe('tab.tidy', () => {@@ -1396,8 +1402,11 @@ describe('Reviewer role', () => {// An agent from before the flag was kept is judged by its start: one that named the model is rated by that model's row.delete f.state.agents.find(a => a.id === reviewer)!.launchedDefaultexpect(member({ engine: 'codex', model: 'gpt-6.1-sol' })).not.toThrow()+ f.state.starts!.find(s => s.harnessId === 'native-reviewer')!.request.model = 'gpt-9-preview'+ expect(member({ engine: 'codex', model: 'gpt-9-preview' })).toThrow('Codex gpt-9-preview is 1.')+ // A named strong Codex model has its own row (Lead, 10-30): a start that named it reviews.f.state.starts!.find(s => s.harnessId === 'native-reviewer')!.request.model = 'gpt-6.1-sol'- expect(member({ engine: 'codex', model: 'gpt-6.1-sol' })).toThrow('Codex gpt-6.1-sol is 1.')+ expect(member({ engine: 'codex', model: 'gpt-6.1-sol' })).not.toThrow()})it('rates a Reviewer launched on its engine\'s default by the default row after it reports its model, once its start has finished', () => {@@ -1428,9 +1437,9 @@ describe('Reviewer role', () => {expect(pick).toThrow('Codex gpt-5.5-mini is 1.')// A replaced terminal (Change agent) is not the session its start launched: it is rated by the model it reports.f.run({ type: 'agent.rebind', agentId: reviewer, machineId: 'host', projectId: 'lead', previousHarnessId: 'native-reviewer', harnessId: 'native-reviewer-2',- configuration: { ...config, model: 'gpt-6.1-sol' } }, reviewerActor)+ configuration: { ...config, model: 'gpt-9-preview' } }, reviewerActor)expect(f.state.agents.find(a => a.id === reviewer)).not.toHaveProperty('launchedDefault')- expect(pick).toThrow('Codex gpt-6.1-sol is 1.')+ expect(pick).toThrow('Codex gpt-9-preview is 1.')})it('stores the role chosen at start and reads agents without one as Builders', () => {diff --git a/backend/src/superTabs/commands.ts b/backend/src/superTabs/commands.tsindex 91678288c..1318335cc 100644--- a/backend/src/superTabs/commands.ts+++ b/backend/src/superTabs/commands.ts@@ -10,7 +10,7 @@ import {} from './model.js'import { jobKindOf } from './evidence/jobKind.js'import { routeRecordSchema, routeTitle, startedAs, type RouteCandidate, type RouteDecision, type RouteFinal, type RouteOverride } from './routeRecord.js'-import { DEFAULT_ROUTING_POLICY, routingOverrideSchema, type RoutingPolicy } from './routingPolicy.js'+import { DEFAULT_ROUTING_POLICY, routingOverrideSaveSchema, type RoutingPolicy } from './routingPolicy.js'import { agentTarget, askedInSchema, broken, MAX_RULES, reviewRefusal, RULE_MESSAGE_MS, sameEngineReview, ruleSchema, ruleTextSchema, startTarget, unmet, type RunTarget } from './rules.js'import { MAX_ATTACHMENTS, type Attachment } from './attachments.js'import { checkMentions, MAX_MENTIONS, type MentionTarget } from './mentions.js'@@ -101,7 +101,7 @@ export const commandSchema = z.discriminatedUnion('type', [z.object({ type: z.literal('tab.rename'), name: title }).strict(),z.object({ type: z.literal('tab.project'), machineId: id, project }).strict(),z.object({ type: z.literal('tab.pause'), paused: z.boolean() }).strict(),- z.object({ type: z.literal('tab.routingPolicy'), policy: routingOverrideSchema.nullable() }).strict(),+ z.object({ type: z.literal('tab.routingPolicy'), policy: routingOverrideSaveSchema.nullable() }).strict(),z.object({ type: z.literal('tab.tidy'), enabled: z.boolean(), askedIn: askedInSchema.optional() }).strict(),z.object({ type: z.literal('rule.set'), projectId: id.optional(), rule: ruleSchema, text: ruleTextSchema, askedIn: askedInSchema.optional() }).strict(),z.object({ type: z.literal('rule.remove'), projectId: id.optional(), ruleId: id, askedIn: askedInSchema.optional() }).strict(),diff --git a/backend/src/superTabs/reviewRules.test.ts b/backend/src/superTabs/reviewRules.test.tsindex c25f66cfc..47fd9baa1 100644--- a/backend/src/superTabs/reviewRules.test.ts+++ b/backend/src/superTabs/reviewRules.test.ts@@ -1,6 +1,7 @@import { describe, it, expect } from 'vitest'import { DEFAULT_ROUTING_POLICY as policy } from './routingPolicy.js'-import { agentTarget, broken, reviewRefusal, targetQuality } from './rules.js'+import { agentTarget, broken, reviewRefusal, startTarget, targetQuality } from './rules.js'+import { effectivePolicy } from './routingPolicy.js'import { cheapAttempt } from './stepUp.js'import { recordRun } from './leaderboard/record.js'const builder = { id: 'builder', machineId: 'allowed', harnessId: 'hb', configuration: { engine: 'claude', model: 'opus', effort: 'high' } }@@ -34,3 +35,24 @@ describe('reviews and step-ups by what each attempt runs on', () => {})})+// A Codex Reviewer started on a model named for it (Lead, 10-30: a gpt-6.1-sol Reviewer was refused as quality 1, and on a Mac+// whose Codex default is a local model no review could run).+describe('a Codex Reviewer on a named model', () => {+ const codexOn = (model: string) => startTarget({ machineId: 'allowed', engine: 'codex', model, effort: 'high' })+ it('accepts gpt-6.1-sol at quality 3', () => {+ const state = stateOf({ id: 'other', machineId: 'allowed', harnessId: 'ho', configuration: { engine: 'claude', model: 'opus', effort: 'high' } })+ expect(targetQuality(policy, codexOn('gpt-6.1-sol'))).toBe(3)+ expect(reviewRefusal(state, 'work', codexOn('gpt-6.1-sol'), policy)).toBeNull()+ })+ it('still refuses a Codex model the policy does not name', () => {+ const state = stateOf({ id: 'other', machineId: 'allowed', harnessId: 'ho', configuration: { engine: 'claude', model: 'opus', effort: 'high' } })+ expect(targetQuality(policy, codexOn('gpt-7-unknown'))).toBe(1)+ expect(reviewRefusal(state, 'work', codexOn('gpt-7-unknown'), policy)).toBe('A review needs a model of quality 2 or more, and Codex gpt-7-unknown is 1.')+ })+ it('rates gpt-6.1-sol in a policy saved before its row, and keeps an owner\'s own row for it', () => {+ const saved = { ...policy, models: policy.models.filter(m => m.model !== 'gpt-6.1-sol') }+ expect(targetQuality(effectivePolicy(saved, null).policy, codexOn('gpt-6.1-sol'))).toBe(3)+ const owned = { ...policy, models: [...saved.models, { engine: 'codex' as const, model: 'gpt-6.1-sol', effort: 'high', quality: 2, cost: 2, enabled: false }] }+ expect(targetQuality(effectivePolicy(owned, null).policy, codexOn('gpt-6.1-sol'))).toBe(2)+ })+})diff --git a/backend/src/superTabs/routingPolicy.test.ts b/backend/src/superTabs/routingPolicy.test.tsindex 4b3e43f7c..9be764b60 100644--- a/backend/src/superTabs/routingPolicy.test.ts+++ b/backend/src/superTabs/routingPolicy.test.ts@@ -1,5 +1,5 @@import { describe, expect, it } from 'vitest'-import { DEFAULT_ROUTING_POLICY, effectivePolicy, gridQuality, priorFor, routingOverrideSchema, routingPolicySchema } from './routingPolicy.js'+import { DEFAULT_ROUTING_POLICY, effectivePolicy, gridQuality, priorFor, routingOverrideSaveSchema, routingOverrideSchema, routingPolicySaveSchema, routingPolicySchema } from './routingPolicy.js'import type { PriorsTable } from './benchmarkPriors/priors.js'describe('routing policy', () => {@@ -21,6 +21,72 @@ describe('routing policy', () => {expect(result.warnings).toEqual([])})+ it('reads a policy saved at the 40-row limit with the added rows, and saves and reads it back after an edit', () => {+ // Review of #2271: rows added on read must not push an owner's full policy past what saving accepts.+ const owner = Array.from({ length: 40 }, (_, i) => ({ engine: 'claude' as const, model: `model-${i}`, effort: 'high', quality: 2, cost: 2, enabled: true }))+ const read = effectivePolicy({ ...DEFAULT_ROUTING_POLICY, models: owner }, null).policy+ expect(read.models).toHaveLength(41)+ expect(read.models.slice(0, 40)).toEqual(owner)+ const saved = routingPolicySchema.parse({ ...read, notes: 'Edited.' })+ expect(saved.models).toEqual(read.models)+ expect(effectivePolicy(saved, null).policy.models).toEqual(read.models)+ })++ it('keeps the owner\'s limit at exactly 40 rows of their own, whatever built-in rows are added on read', () => {+ const own = (n: number) => Array.from({ length: n }, (_, i) => ({ engine: 'claude' as const, model: `model-${i}`, effort: 'high', quality: 2, cost: 2, enabled: true }))+ const parses = (models: unknown[]) => routingPolicySchema.safeParse({ ...DEFAULT_ROUTING_POLICY, models }).success+ expect(parses(own(40))).toBe(true)+ expect(parses(own(41))).toBe(false)+ const sol = DEFAULT_ROUTING_POLICY.models.find(m => m.model === 'gpt-6.1-sol')!+ expect(parses([...own(40), sol])).toBe(true)+ // The owner's own version of a built-in row takes its place, not one of their 40.+ expect(parses([...own(40), { ...sol, enabled: false }])).toBe(true)+ expect(parses([...own(41), sol])).toBe(false)+ })++ describe('a built-in row added on read (review of #2271 at 1d9499646)', () => {+ const sol = DEFAULT_ROUTING_POLICY.models.find(m => m.model === 'gpt-6.1-sol')!+ const codexDefault = DEFAULT_ROUTING_POLICY.models.find(m => m.engine === 'codex' && m.model === 'default')!+ const claudeRows = DEFAULT_ROUTING_POLICY.models.filter(m => m.engine === 'claude')+ const solOf = (models: Array<{ engine: string; model: string; enabled: boolean }>) => models.find(m => m.model === 'gpt-6.1-sol')++ it('is on only while its engine\'s default row is on, so an owner who turned Codex off keeps it off', () => {+ const off = effectivePolicy({ ...DEFAULT_ROUTING_POLICY, models: [...claudeRows, { ...codexDefault, enabled: false }] }, null)+ expect(solOf(off.policy.models)).toEqual({ ...sol, enabled: false })+ const absent = effectivePolicy({ ...DEFAULT_ROUTING_POLICY, models: claudeRows }, null)+ expect(solOf(absent.policy.models)).toEqual({ ...sol, enabled: false })+ const on = effectivePolicy({ ...DEFAULT_ROUTING_POLICY, models: [...claudeRows, codexDefault] }, null)+ expect(solOf(on.policy.models)).toEqual(sol)+ // A tab override without the row and with Codex off, over no saved account policy.+ const tab = effectivePolicy(null, { models: [...claudeRows, { ...codexDefault, enabled: false }] })+ expect(solOf(tab.policy.models)).toEqual({ ...sol, enabled: false })+ })++ it('comes from the account policy when a tab override saved without it', () => {+ const account = { ...DEFAULT_ROUTING_POLICY, models: [...claudeRows, codexDefault, { ...sol, enabled: false, quality: 2 }] }+ const tab = effectivePolicy(account, { models: [...claudeRows, codexDefault] })+ expect(solOf(tab.policy.models)).toEqual({ ...sol, enabled: false, quality: 2 })+ // The account's row on, but this tab turned Codex off: it stays off here.+ const accountOn = { ...DEFAULT_ROUTING_POLICY, models: [...claudeRows, codexDefault, sol] }+ const codexOff = effectivePolicy(accountOn, { models: [...claudeRows, { ...codexDefault, enabled: false }] })+ expect(solOf(codexOff.policy.models)).toEqual({ ...sol, enabled: false })+ expect(solOf(effectivePolicy(accountOn, { models: [...claudeRows, codexDefault] }).policy.models)).toEqual(sol)+ })+ })++ it('refuses saving a second row for a built-in model, and still reads an old policy saved with one', () => {+ const own = Array.from({ length: 39 }, (_, i) => ({ engine: 'claude' as const, model: `model-${i}`, effort: 'high', quality: 2, cost: 2, enabled: true }))+ const sol = DEFAULT_ROUTING_POLICY.models.find(m => m.model === 'gpt-6.1-sol')!+ const twice = { ...DEFAULT_ROUTING_POLICY, models: [...own, sol, { ...sol, enabled: false }] }+ const refused = routingPolicySaveSchema.safeParse(twice)+ expect(refused.success).toBe(false)+ expect(refused.error?.issues.map(i => i.message)).toEqual(['Only one row for codex gpt-6.1-sol.'])+ expect(routingOverrideSaveSchema.safeParse({ models: twice.models }).success).toBe(false)+ expect(routingPolicySaveSchema.safeParse({ ...twice, models: [...own, sol] }).success).toBe(true)+ // Saved before this check: still read as saved, never as unreadable.+ expect(effectivePolicy(twice, null)).toEqual({ policy: twice, warnings: [], overridden: [] })+ })+it('falls back to the default with a warning for a corrupt account policy or override', () => {const corrupt = effectivePolicy({ version: 9 }, { floor: { low: 7 } })expect(corrupt.policy).toEqual(DEFAULT_ROUTING_POLICY)diff --git a/backend/src/superTabs/routingPolicy.ts b/backend/src/superTabs/routingPolicy.tsindex 415be0b26..bdb4fb1d3 100644--- a/backend/src/superTabs/routingPolicy.ts+++ b/backend/src/superTabs/routingPolicy.ts@@ -5,6 +5,19 @@ import { z } from 'zod'import { BENCHMARK_PRIORS } from './benchmarkPriors/data.js'import { JOB_KINDS, priorLevel, type JobKind, type PriorsTable } from './benchmarkPriors/priors.js'+/** Built-in rows added after owners could save a policy, so saved policies read them too (effectivePolicy). Codex's own default+ * model, named: GPT-6.1 Sol scores 58.18 on Terminal-Bench 4.0 in Codex (benchmarkPriors/data.ts) and costs Sonnet's API rate+ * (costs/prices.ts). A start or Reviewer that names it is rated by this row, not as an unknown slug (Lead, 10-30). */+const ADDED_ROWS = [+ { engine: 'codex', model: 'gpt-6.1-sol', effort: 'high', quality: 3, cost: 2, enabled: true },+] as const satisfies ReadonlyArray<Record<string, unknown>>+/** An owner keeps exactly up to 40 rows of their own. A built-in row added on read, or the owner's own version of one (the same+ * engine and model), never counts against that, or a full policy could no longer be saved once read (reviews of #2271). */+const OWN_MODEL_ROWS = 40+type Named = { engine: string; model: string }+const same = (a: Named, b: Named) => a.engine === b.engine && a.model === b.model+const builtIn = (row: Named) => ADDED_ROWS.some(added => same(added, row))+const quality = z.number().int().min(1).max(3)const modelRow = z.object({engine: z.enum(['claude', 'codex']),@@ -15,8 +28,10 @@ const modelRow = z.object({cost: z.number().int().min(1).max(100),enabled: z.boolean(),}).strict()+const models = z.array(modelRow).min(1).max(OWN_MODEL_ROWS + ADDED_ROWS.length)+ .refine(rows => rows.filter(row => !builtIn(row)).length <= OWN_MODEL_ROWS, `At most ${OWN_MODEL_ROWS} rows of your own.`)const fields = {- models: z.array(modelRow).min(1).max(40),+ models,floor: z.object({ low: quality, medium: quality, high: quality }).strict(),quotaReserve: z.number().int().min(0).max(90),notes: z.string().trim().max(500),@@ -30,6 +45,14 @@ const fields = {}export const routingPolicySchema = z.object({ version: z.literal(1), ...fields }).strict()export const routingOverrideSchema = z.object(fields).partial().strict()+/** What a save accepts: also one row at most per built-in model, so a second copy never rides free of the 40 (review of #2271).+ * Only saves check it: a policy saved before it still reads as saved, never as unreadable. */+const saved = { ...fields, models: models.superRefine((rows, ctx) => {+ for (const added of ADDED_ROWS) if (rows.filter(row => same(row, added)).length > 1)+ ctx.addIssue({ code: 'custom', message: `Only one row for ${added.engine} ${added.model}.` })+}) }+export const routingPolicySaveSchema = z.object({ version: z.literal(1), ...saved }).strict()+export const routingOverrideSaveSchema = z.object(saved).partial().strict()export type RoutingPolicy = z.infer<typeof routingPolicySchema>export type RoutingOverride = z.infer<typeof routingOverrideSchema>export type RoutingModel = RoutingPolicy['models'][number]@@ -39,6 +62,8 @@ export const DEFAULT_ROUTING_POLICY: RoutingPolicy = {models: [{ engine: 'claude', model: 'opus', effort: 'high', quality: 3, cost: 3, enabled: true },{ engine: 'codex', model: 'default', effort: 'default', quality: 3, cost: 2, enabled: true },+ // Next to `default` so the form lists Codex's rows together. List order ranks nothing: the CLI route breaks ties by title.+ ...ADDED_ROWS,{ engine: 'claude', model: 'sonnet', effort: 'medium', quality: 2, cost: 2, enabled: true },{ engine: 'claude', model: 'haiku', effort: 'auto', quality: 1, cost: 1, enabled: true },],@@ -53,9 +78,10 @@ export const DEFAULT_ROUTING_POLICY: RoutingPolicy = {export function effectivePolicy(account: unknown, override: unknown) {const warnings: string[] = []let policy = DEFAULT_ROUTING_POLICY+ let accountModels: RoutingModel[] = []if (account !== null && account !== undefined) {const parsed = routingPolicySchema.safeParse(account)- if (parsed.success) policy = parsed.data+ if (parsed.success) { policy = parsed.data; accountModels = parsed.data.models }else warnings.push('The account routing policy is unreadable; the built-in default applies.')}const overridden: Array<keyof RoutingOverride> = []@@ -67,6 +93,15 @@ export function effectivePolicy(account: unknown, override: unknown) {overridden.push(...(Object.keys(parsed.data) as Array<keyof RoutingOverride>))}}+ // A policy saved before a named row was added has no row for that model, which rated it 1: the row joins it. A row of the+ // owner's own for the model, on or off, stays as it is. A tab override saved without it takes the account's row. Either is+ // on only while its engine's `default` row is: an owner who turned Codex off keeps it off (review of #2271).+ const engineOn = (engine: string) => policy.models.some(m => m.engine === engine && m.model === 'default' && m.enabled)+ const missing = ADDED_ROWS.filter(row => !policy.models.some(m => same(m, row))).map((row): RoutingModel => {+ const from = accountModels.find(m => same(m, row)) ?? row+ return { ...from, enabled: from.enabled && engineOn(row.engine) }+ })+ if (missing.length) policy = { ...policy, models: [...policy.models, ...missing] }const local = policy.localModels ?? DEFAULT_ROUTING_POLICY.localModels!policy = { ...policy, localModels: { ...local, models: local.models ?? DEFAULT_ROUTING_POLICY.localModels!.models } }return { policy, warnings, overridden }diff --git a/backend/src/superTabs/store.ts b/backend/src/superTabs/store.tsindex e62f9dc5e..936e4fed4 100644--- a/backend/src/superTabs/store.ts+++ b/backend/src/superTabs/store.ts@@ -59,7 +59,7 @@ import { closeAssignment, closeUnassignedStart, readDecision, recentDecisions, rimport { dropHeldTags, listMentions, markDone, mentionsWaiting, openTags, readMention, resolveByReply, resolveWhenWorked, writeMentions } from './mentions.js'import { answerable, fullFor, listDecisions, type DecisionList, readAskedDecision, recordAnswer, repeatOf, waitingFor, waitingIn, waitingInProject, writeDecisions } from './decisions.js'import { CATCH_UP_SCAN, catchUpSummary, type CatchUp } from './catchUp.js'-import { DEFAULT_ROUTING_POLICY, effectivePolicy, routingPolicySchema, type RoutingPolicy } from './routingPolicy.js'+import { DEFAULT_ROUTING_POLICY, effectivePolicy, routingPolicySaveSchema, type RoutingPolicy } from './routingPolicy.js'import { invitedSwarms } from './invitedSwarms.js'import { authenticatedEmail, authorizeSwarmJoin, configureSharing, joinSwarmSchema, requireSharingOwner,saveSharingSchema, sharingDetails, type JoinSwarm, type SaveSharing } from './sharing.js'@@ -557,7 +557,7 @@ export class SuperTabStore {async saveAccountPolicy(user: AuthUser, revision: number, input: RoutingPolicy) {this.personOnly(user)- const policy = routingPolicySchema.parse(input)+ const policy = routingPolicySaveSchema.parse(input)return transaction(this.db, async tx => {const id = this.policyId(user)const row = await tx.routingPolicy.findUnique({ where: { id } })diff --git a/cli/src/superTabs/route.spec.ts b/cli/src/superTabs/route.spec.tsindex 7a03a1a35..91026622d 100644--- a/cli/src/superTabs/route.spec.ts+++ b/cli/src/superTabs/route.spec.ts@@ -65,6 +65,11 @@ describe('quota and rates', () => {expect(rateFor(policy, 'codex', 'default', 'default')).toEqual({ quality: 3, cost: 2 })expect(rateFor(policy, 'claude', 'claude-opus-4-7', 'high', true)).toEqual({ quality: 3, cost: 3 })})+ it('rates a Codex model by its own row in the server\'s policy, and an unnamed slug 1', () => {+ const served = { ...policy, models: [...policy.models, { engine: 'codex' as const, model: 'gpt-6.1-sol', effort: 'high', quality: 3, cost: 2, enabled: true }] }+ expect(rateFor(served, 'codex', 'gpt-6.1-sol', 'xhigh')).toEqual({ quality: 3, cost: 2 })+ expect(rateFor(served, 'codex', 'gpt-7-unknown', 'high')).toEqual({ quality: 1, cost: 1 })+ })})describe('choose', () => {