Problem
When a headless implementation session (e.g. implement step using opus[1m]) fails and triggers a retry_worktree step, the retry session silently downgrades to sonnet (200K context) regardless of what model the original session used.
This caused Issue #711's retry session to hit "Prompt is too long" at 176,593 tokens — one edit away from completion — when it had 823K tokens of headroom on the original model.
Root Cause
The retry_worktree step in implementation.yaml has no model: key in its with: block. The resolution chain:
- Recipe step → no
model: → run_skill(model="")
_resolve_model(step_model="", config) → falls through to config.model.default = "sonnet"
- Session launches with
--model sonnet instead of the original opus[1m]
There is no mechanism to carry the model from the implement step to its retry.
Scope
All retry/resolve steps in implementation.yaml are affected:
retry_worktree — no model key
resolve_failures — no model key
resolve_review — no model key
Additionally, remediation.yaml and merge-prs.yaml should be audited for the same gap.
Proposed Fix (Recipe Remediation)
- Add a semantic validation rule (e.g.
model-required-for-claude-steps) that ensures any recipe step calling run_skill includes a model: parameter — either explicit or via context variable
- Add
model: to all affected recipe steps, using a context variable that the orchestrator sets from the original step's resolved model
Evidence
Investigation report: .autoskillit/temp/investigate/investigation_issue711_context_limit_2026-04-10_232500.md
Session 1 (implement): claude-opus-4-6 confirmed in JSONL
Session 2 (retry_worktree): claude-sonnet-4-6 confirmed in JSONL — silent downgrade
Clarification: run_skill already accepts a model parameter — the tool interface is fine. The bug is that the retry_worktree (and resolve_failures, resolve_review) recipe steps in implementation.yaml don't include model: in their with: block, so the parameter is never passed through to the headless session.
Problem
When a headless implementation session (e.g.
implementstep usingopus[1m]) fails and triggers aretry_worktreestep, the retry session silently downgrades tosonnet(200K context) regardless of what model the original session used.This caused Issue #711's retry session to hit "Prompt is too long" at 176,593 tokens — one edit away from completion — when it had 823K tokens of headroom on the original model.
Root Cause
The
retry_worktreestep inimplementation.yamlhas nomodel:key in itswith:block. The resolution chain:model:→run_skill(model="")_resolve_model(step_model="", config)→ falls through toconfig.model.default = "sonnet"--model sonnetinstead of the originalopus[1m]There is no mechanism to carry the model from the implement step to its retry.
Scope
All retry/resolve steps in
implementation.yamlare affected:retry_worktree— no model keyresolve_failures— no model keyresolve_review— no model keyAdditionally,
remediation.yamlandmerge-prs.yamlshould be audited for the same gap.Proposed Fix (Recipe Remediation)
model-required-for-claude-steps) that ensures any recipe step callingrun_skillincludes amodel:parameter — either explicit or via context variablemodel:to all affected recipe steps, using a context variable that the orchestrator sets from the original step's resolved modelEvidence
Investigation report:
.autoskillit/temp/investigate/investigation_issue711_context_limit_2026-04-10_232500.mdSession 1 (implement):
claude-opus-4-6confirmed in JSONLSession 2 (retry_worktree):
claude-sonnet-4-6confirmed in JSONL — silent downgradeClarification: run_skill already accepts a model parameter — the tool interface is fine. The bug is that the retry_worktree (and resolve_failures, resolve_review) recipe steps in implementation.yaml don't include model: in their with: block, so the parameter is never passed through to the headless session.