Repository navigation
fix(model-guard): drop an inherited agent option; compare Claude levels with T3's model list - #660
Conversation
…ls with T3's model list A delegate_task or create_threads pick that names its model no longer inherits the parent's OpenCode `agent` or Kiro `mode` option: the fork's delegation checks drop it on a fresh dispatch (a retry passes untouched), unless the call names the option itself. The model guard never sees an inherited option, so it could not refuse it. The self-check now compares each claudeAgent row's efforts with the levels T3's model list offers the model (and ultracode when the model has the ultracode option). A level the model does not offer, a model with no option list, an unreadable list or no list named is a problem; a model not in the list is a note. A contract test keeps the server's agent option ids and the guard's list in step. Fixes #643 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review lens B, head 49a6835 (read-only): NOT SAFE to merge as it standsVerdict: NOT SAFE, for one blocking reason: CI is red on the fork seam check. The guard logic itself has no blocking or major findings. The self-check does not pass a level the model lacks in any case I tried. It reports a missing, unreadable or half-written list and does not take it as clean. Its output holds no file content. The new tests fail on the old code, and they kill 9 of my 11 lib mutants. Fix the seam check and this is SAFE from my side. Blocking
MajorNone. Minor
Checked and fine
🤖 Generated with Claude Code |
Review lens A, head 49a6835 (read-only): NOT SAFEVerdict: NOT SAFE. The local fix is right: both seats drop the inherited Blocking
Major
Minor
Checked and fine
🤖 Generated with Claude Code |
While a model policy is on (server setting modelPolicy, advise or enforce), a call that names its model keeps from the parent only the options the call names, on every launch path: local delegate_task (both seats, and the target the usage pacer moves to), create_threads, and remote delegate_task. One shared rule (ownOptions in fork/delegateChecks.ts) replaces the list of agent option ids. A call that names no model, a retry of an accepted call, and every call with the policy off keep upstream's inheritance, so upstream's own inheritance tests stay as they are. An unreadable setting applies the rule. The tests move out of upstream's OrchestratorMcpService.test.ts into fork/delegateOwnOptions.test.ts; OrchestratorMcpService.ts loses a fork line (pending ceiling 35 -> 34). Self-check: T3's model match order (exact slug, then the first alias), an ultracode choice stands for xhigh, only a select offers levels, and a model list that names none of the policy's models is reported. README fixes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Its header comment is not a seam line; the docs say what reads the setting. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fix (head 13afecc)1. Option inheritance: one rule on every path
2. Seam check
3. Minors
TestsNew tests fail on the old code (49a6835):
What the tests cover:
Local results:
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Head moved to 7ab0d28: a merge of main, since the branch conflicted and no PR CI could run. The only hand-resolved conflict was the FORK_CHANGES.md row; the fix itself is unchanged from 13afecc. After the merge: the seam check against main is clean (OrchestratorMcpService.ts stays at 34), both model-guard test files and the delegate/usage-gate/upstream MCP tests pass, typecheck is clean, and CI is green. |
…ork-follow refuses the series) (#795) #660 changed upstream's remote delegate_task target line to go through delegateChecks.remoteTarget and lowered the file's pending ceiling to 34, but the series against upstream has 35 fork lines and 5 lost lines (limit 4). The pull request check let it through; fork-follow's check from the upstream tag refuses it, so the fork cannot follow upstream (#792). This records what main already has; no code change. Co-authored-by: Claude Opus 5.5 <[email protected]>
…ls with T3's model list (#660) * fix(model-guard): drop an inherited agent option; compare Claude levels with T3's model list A delegate_task or create_threads pick that names its model no longer inherits the parent's OpenCode `agent` or Kiro `mode` option: the fork's delegation checks drop it on a fresh dispatch (a retry passes untouched), unless the call names the option itself. The model guard never sees an inherited option, so it could not refuse it. The self-check now compares each claudeAgent row's efforts with the levels T3's model list offers the model (and ultracode when the model has the ultracode option). A level the model does not offer, a model with no option list, an unreadable list or no list named is a problem; a model not in the list is a note. A contract test keeps the server's agent option ids and the guard's list in step. Fixes #643 Co-Authored-By: Claude Opus 5.5 <[email protected]> * model guard follow-ups: a child keeps only the options its call names While a model policy is on (server setting modelPolicy, advise or enforce), a call that names its model keeps from the parent only the options the call names, on every launch path: local delegate_task (both seats, and the target the usage pacer moves to), create_threads, and remote delegate_task. One shared rule (ownOptions in fork/delegateChecks.ts) replaces the list of agent option ids. A call that names no model, a retry of an accepted call, and every call with the policy off keep upstream's inheritance, so upstream's own inheritance tests stay as they are. An unreadable setting applies the rule. The tests move out of upstream's OrchestratorMcpService.test.ts into fork/delegateOwnOptions.test.ts; OrchestratorMcpService.ts loses a fork line (pending ceiling 35 -> 34). Self-check: T3's model match order (exact slug, then the first alias), an ultracode choice stands for xhigh, only a select offers levels, and a model list that names none of the policy's models is reported. README fixes. Co-Authored-By: Claude Opus 5.5 <[email protected]> * model guard follow-ups: keep modelPolicy.ts as on main Its header comment is not a seam line; the docs say what reads the setting. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ork-follow refuses the series) (#795) #660 changed upstream's remote delegate_task target line to go through delegateChecks.remoteTarget and lowered the file's pending ceiling to 34, but the series against upstream has 35 fork lines and 5 lost lines (limit 4). The pull request check let it through; fork-follow's check from the upstream tag refuses it, so the fork cannot follow upstream (#792). This records what main already has; no code change. Co-authored-by: Claude Opus 5.5 <[email protected]>
…ls with T3's model list (#660) * fix(model-guard): drop an inherited agent option; compare Claude levels with T3's model list A delegate_task or create_threads pick that names its model no longer inherits the parent's OpenCode `agent` or Kiro `mode` option: the fork's delegation checks drop it on a fresh dispatch (a retry passes untouched), unless the call names the option itself. The model guard never sees an inherited option, so it could not refuse it. The self-check now compares each claudeAgent row's efforts with the levels T3's model list offers the model (and ultracode when the model has the ultracode option). A level the model does not offer, a model with no option list, an unreadable list or no list named is a problem; a model not in the list is a note. A contract test keeps the server's agent option ids and the guard's list in step. Fixes #643 Co-Authored-By: Claude Opus 5.5 <[email protected]> * model guard follow-ups: a child keeps only the options its call names While a model policy is on (server setting modelPolicy, advise or enforce), a call that names its model keeps from the parent only the options the call names, on every launch path: local delegate_task (both seats, and the target the usage pacer moves to), create_threads, and remote delegate_task. One shared rule (ownOptions in fork/delegateChecks.ts) replaces the list of agent option ids. A call that names no model, a retry of an accepted call, and every call with the policy off keep upstream's inheritance, so upstream's own inheritance tests stay as they are. An unreadable setting applies the rule. The tests move out of upstream's OrchestratorMcpService.test.ts into fork/delegateOwnOptions.test.ts; OrchestratorMcpService.ts loses a fork line (pending ceiling 35 -> 34). Self-check: T3's model match order (exact slug, then the first alias), an ultracode choice stands for xhigh, only a select offers levels, and a model list that names none of the policy's models is reported. README fixes. Co-Authored-By: Claude Opus 5.5 <[email protected]> * model guard follow-ups: keep modelPolicy.ts as on main Its header comment is not a seam line; the docs say what reads the setting. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ork-follow refuses the series) (#795) #660 changed upstream's remote delegate_task target line to go through delegateChecks.remoteTarget and lowered the file's pending ceiling to 34, but the series against upstream has 35 fork lines and 5 lost lines (limit 4). The pull request check let it through; fork-follow's check from the upstream tag refuses it, so the fork cannot follow upstream (#792). This records what main already has; no code change. Co-authored-by: Claude Opus 5.5 <[email protected]>
…ls with T3's model list (#660) * fix(model-guard): drop an inherited agent option; compare Claude levels with T3's model list A delegate_task or create_threads pick that names its model no longer inherits the parent's OpenCode `agent` or Kiro `mode` option: the fork's delegation checks drop it on a fresh dispatch (a retry passes untouched), unless the call names the option itself. The model guard never sees an inherited option, so it could not refuse it. The self-check now compares each claudeAgent row's efforts with the levels T3's model list offers the model (and ultracode when the model has the ultracode option). A level the model does not offer, a model with no option list, an unreadable list or no list named is a problem; a model not in the list is a note. A contract test keeps the server's agent option ids and the guard's list in step. Fixes #643 Co-Authored-By: Claude Opus 5.5 <[email protected]> * model guard follow-ups: a child keeps only the options its call names While a model policy is on (server setting modelPolicy, advise or enforce), a call that names its model keeps from the parent only the options the call names, on every launch path: local delegate_task (both seats, and the target the usage pacer moves to), create_threads, and remote delegate_task. One shared rule (ownOptions in fork/delegateChecks.ts) replaces the list of agent option ids. A call that names no model, a retry of an accepted call, and every call with the policy off keep upstream's inheritance, so upstream's own inheritance tests stay as they are. An unreadable setting applies the rule. The tests move out of upstream's OrchestratorMcpService.test.ts into fork/delegateOwnOptions.test.ts; OrchestratorMcpService.ts loses a fork line (pending ceiling 35 -> 34). Self-check: T3's model match order (exact slug, then the first alias), an ultracode choice stands for xhigh, only a select offers levels, and a model list that names none of the policy's models is reported. README fixes. Co-Authored-By: Claude Opus 5.5 <[email protected]> * model guard follow-ups: keep modelPolicy.ts as on main Its header comment is not a seam line; the docs say what reads the setting. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ork-follow refuses the series) (#795) #660 changed upstream's remote delegate_task target line to go through delegateChecks.remoteTarget and lowered the file's pending ceiling to 34, but the series against upstream has 35 fork lines and 5 lost lines (limit 4). The pull request check let it through; fork-follow's check from the upstream tag refuses it, so the fork cannot follow upstream (#792). This records what main already has; no code change. Co-authored-by: Claude Opus 5.5 <[email protected]>
…ls with T3's model list (#660) * fix(model-guard): drop an inherited agent option; compare Claude levels with T3's model list A delegate_task or create_threads pick that names its model no longer inherits the parent's OpenCode `agent` or Kiro `mode` option: the fork's delegation checks drop it on a fresh dispatch (a retry passes untouched), unless the call names the option itself. The model guard never sees an inherited option, so it could not refuse it. The self-check now compares each claudeAgent row's efforts with the levels T3's model list offers the model (and ultracode when the model has the ultracode option). A level the model does not offer, a model with no option list, an unreadable list or no list named is a problem; a model not in the list is a note. A contract test keeps the server's agent option ids and the guard's list in step. Fixes #643 Co-Authored-By: Claude Opus 5.5 <[email protected]> * model guard follow-ups: a child keeps only the options its call names While a model policy is on (server setting modelPolicy, advise or enforce), a call that names its model keeps from the parent only the options the call names, on every launch path: local delegate_task (both seats, and the target the usage pacer moves to), create_threads, and remote delegate_task. One shared rule (ownOptions in fork/delegateChecks.ts) replaces the list of agent option ids. A call that names no model, a retry of an accepted call, and every call with the policy off keep upstream's inheritance, so upstream's own inheritance tests stay as they are. An unreadable setting applies the rule. The tests move out of upstream's OrchestratorMcpService.test.ts into fork/delegateOwnOptions.test.ts; OrchestratorMcpService.ts loses a fork line (pending ceiling 35 -> 34). Self-check: T3's model match order (exact slug, then the first alias), an ultracode choice stands for xhigh, only a select offers levels, and a model list that names none of the policy's models is reported. README fixes. Co-Authored-By: Claude Opus 5.5 <[email protected]> * model guard follow-ups: keep modelPolicy.ts as on main Its header comment is not a seam line; the docs say what reads the setting. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ork-follow refuses the series) (#795) #660 changed upstream's remote delegate_task target line to go through delegateChecks.remoteTarget and lowered the file's pending ceiling to 34, but the series against upstream has 35 fork lines and 5 lost lines (limit 4). The pull request check let it through; fork-follow's check from the upstream tag refuses it, so the fork cannot follow upstream (#792). This records what main already has; no code change. Co-authored-by: Claude Opus 5.5 <[email protected]>
…ls with T3's model list (#660) * fix(model-guard): drop an inherited agent option; compare Claude levels with T3's model list A delegate_task or create_threads pick that names its model no longer inherits the parent's OpenCode `agent` or Kiro `mode` option: the fork's delegation checks drop it on a fresh dispatch (a retry passes untouched), unless the call names the option itself. The model guard never sees an inherited option, so it could not refuse it. The self-check now compares each claudeAgent row's efforts with the levels T3's model list offers the model (and ultracode when the model has the ultracode option). A level the model does not offer, a model with no option list, an unreadable list or no list named is a problem; a model not in the list is a note. A contract test keeps the server's agent option ids and the guard's list in step. Fixes #643 Co-Authored-By: Claude Opus 5.5 <[email protected]> * model guard follow-ups: a child keeps only the options its call names While a model policy is on (server setting modelPolicy, advise or enforce), a call that names its model keeps from the parent only the options the call names, on every launch path: local delegate_task (both seats, and the target the usage pacer moves to), create_threads, and remote delegate_task. One shared rule (ownOptions in fork/delegateChecks.ts) replaces the list of agent option ids. A call that names no model, a retry of an accepted call, and every call with the policy off keep upstream's inheritance, so upstream's own inheritance tests stay as they are. An unreadable setting applies the rule. The tests move out of upstream's OrchestratorMcpService.test.ts into fork/delegateOwnOptions.test.ts; OrchestratorMcpService.ts loses a fork line (pending ceiling 35 -> 34). Self-check: T3's model match order (exact slug, then the first alias), an ultracode choice stands for xhigh, only a select offers levels, and a model list that names none of the policy's models is reported. README fixes. Co-Authored-By: Claude Opus 5.5 <[email protected]> * model guard follow-ups: keep modelPolicy.ts as on main Its header comment is not a seam line; the docs say what reads the setting. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ork-follow refuses the series) (#795) #660 changed upstream's remote delegate_task target line to go through delegateChecks.remoteTarget and lowered the file's pending ceiling to 34, but the series against upstream has 35 fork lines and 5 lost lines (limit 4). The pull request check let it through; fork-follow's check from the upstream tag refuses it, so the fork cannot follow upstream (#792). This records what main already has; no code change. Co-authored-by: Claude Opus 5.5 <[email protected]>
Fixes #643
What
delegate_taskandcreate_threads, T3 puts the parent's options under the pick when the instance and model are the same. The child of an OpenCode parent that ran anagent, or a Kiro parent that ran amode, kept that agent, and the model guard could not see it. Now the fork's delegation checks (apps/server/src/fork/delegateChecks.ts,withoutInheritedAgent) drop an inheritedagentormodeoption when the pick names its model, unless the call names that option itself. A pick that names no model keeps the parent's options, as before; the guard refuses such a T3 pick. The drop runs in both seats:beforeWorkspace, after pacing, so a moved pick is covered too, andbeforeCreateThread. A retry passes both seats untouched, as every seat does.--self-checknow compares eachclaudeAgentrow'seffortswith T3's model list (t3ModelManifests, building on the model-guard: self-check reports an "ultracodeOption": false row whose model now has the option #600 reading). It checks the choices of theeffortoption, plusultracodewhen the model has the ultracode option; with several lists, a level must be offered in each. These are reported as problems: a level the model does not offer, a model the list gives no option list, a list that cannot be read, and rows with efforts but no list named. A model that is not in the list (a custom model) is anote:line.A contract test keeps the server's
AGENT_OPTION_IDSand the guard'sDRIVER_MODEL_OPTION_IDSin step, and the fork CI's three sparse checkouts now includedelegateChecks.ts. Every existing guard refusal is kept.Why
The guard checks only the call. An option inherited on the server side sat outside the guard's view. An allowed level that the model does not offer runs the model's default level outside
delegate_task: on launch, configure, or a project's default.General vs project
All general. The agent option ids are T3's own drivers' ids (OpenCode
agent, Kiromode), and the self-check reads whatever model list and policy a machine names. Nothing here is specific to one machine or project.State
withoutInheritedAgentreturns the same result on a second run, and every case in the table checks this. The self-check keeps nothing between runs and reads the lists again each time; a test runs it twice and gets the same report.t3ModelManifestsis now reported when the policy has aclaudeAgentrow with efforts. A list that is missing or unreadable is reported. In modeoff, nothing is compared. A model that loses a level in a T3 reload is reported on the next run.Tests
apps/server/src/fork/delegateChecks.test.ts: a cases table forwithoutInheritedAgent(opencode, kiro, an unknown instance, an agent named by the call, no model, a codex id that is not an agent option, opencodemode), both seats drop the option, and a retry keeps it.OrchestratorMcpService.test.ts:delegate_taskandcreate_threadsend to end (model named, model and effort named, agent named by the call, no model).OrchestratorMcpService.usageGate.test.ts: in enforce, a pick moved to another instance does not take the parent's agent.guard.test.py:test_t3_model_list_levels_are_compared, with contract tests for the bundled list and forAGENT_OPTION_IDS. The red check gained 9 mutations, one per new self-check rule.install.test.py: a level the model does not offer, in the installed self-check, and 2 new mutations.Red on the old code (run): vitest had 3 failures in the service and seat tests and 1 in usageGate. In
guard.test.py, the new functions were missing and theAGENT_OPTION_IDScontract failed. Ininstall.test.py, the new test failed because the report was absent. All green now: guard 97 OK, install 36 OK, the three vitest files 134 passed, and typecheck, fmt, lint and knip are clean.Not fixed / why
effortsonly the levels the model offers" for those rows. A possible follow-up is to read T3's provider status caches, which hold the runtime option descriptors of Codex and others.🤖 Generated with Claude Code