GeezerVison is showing github.com — fix(specialist): keep the pinned model when a specialist is resumed by Vasanthdev2004 · Pull Request #1009 · Twigpine/zero
Conversation
Vasanthdev2004
commented
Sep 4, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
A specialist pinned to a cheap model ran on that model exactly once.
Metadata.Model (internal/specialist/manifest.go:31) exists so a bounded, delegated task can run on something cheaper than its parent, and BuildArgs puts it on the child argv through appendModelArgs (exec.go:728). BuildResumeArgs never called it. So the moment the orchestrator resumed that specialist, the child fell back to whatever the parent's configured model resolved to.
Nothing surfaces it. The resumed child starts normally and does the work, so the only symptom is the bill. Cost-motivated delegation quietly stops saving anything.
Resuming does not restore the recorded model on its own, which is why the flag has to be passed again rather than relied upon: sessions.PrepareExec records the model a run used but never feeds it back into provider construction.
The fix
BuildResumeArgsInput now carries ParentModel and ParentReasoningEffort, the same fallbacks the fresh path takes, and runResume passes what TaskRunOptions already held. The reasoning-effort rule travels with the model unchanged: the parent's effort is inherited only when the manifest pins no model of its own, because a manifest that chose a different model has not agreed to the parent's effort for it.
Tests
Both builders are driven and compared, so the two paths cannot drift apart again: a pinned model survives resume, an unpinned one still inherits the parent's, both halves of the effort rule hold, and the flag keeps its position relative to --auto in both.
The second commit exists because of something the falsification caught. Every builder test calls BuildResumeArgs directly, and deleting the ParentModel field from the runResume call site still compiled and still passed all of them. The defect lived at the call site, not in the builder, so there is now a test that goes through the real Run dispatch with the RunChild seam capturing argv. Removing that one field fails it with:
the resumed child was launched with no --model, so it runs on whatever the
config default resolves to
Removing the appendModelArgs call itself fails the builder tests the same way.
Refs #554, where this came up while working out what Zero can already do for per-role models. Worth noting the answer there is "more than people think": manifest-level model selection already works, and this was the gap that made it look like it did not.
Summary by CodeRabbit
- Bug Fixes
- Resumed specialist tasks now retain their configured model when one is pinned.
- Specialists without a pinned model inherit the parent task’s model during fresh runs and resume operations.
- Reasoning-effort settings are consistently preserved or inherited across specialist launches.
- Model and autonomy options are now applied in the correct order, improving reliability for fresh and resumed tasks.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
greptile-apps[bot] reacted with thumbs up emoji
Metadata.Model exists so a bounded, delegated task can run on a cheaper model
than its parent, and BuildArgs appends it to the child argv through
appendModelArgs. BuildResumeArgs never did.
So a specialist pinned to a cheap model ran on that model exactly once. The
moment the orchestrator resumed it, the child fell back to whatever the
parent's configured model resolved to. Nothing surfaced it: the resumed child
starts normally and does the work, so the only symptom is the bill.
Cost-motivated delegation quietly stopped saving anything.
Resuming does not restore the recorded model on its own. sessions.PrepareExec
records the model a run used but never feeds it back into provider
construction, so the flag has to be passed again rather than relied upon.
BuildResumeArgsInput now carries ParentModel and ParentReasoningEffort, the
same fallbacks the fresh path takes, and runResume passes what TaskRunOptions
already held. The reasoning-effort rule travels with the model unchanged: the
parent's effort is inherited only when the manifest pins no model of its own,
because a manifest that chose a different model has not agreed to the parent's
effort for it.
Regressions drive both builders and compare them, so the two paths cannot
drift again: a pinned model survives resume, an unpinned one still inherits the
parent's, both halves of the effort rule hold, and the flag keeps its position
relative to --auto in both.
Refs #554
The builder tests all call BuildResumeArgs directly, so dropping the
ParentModel field from the runResume call site still compiled and still passed
every one of them. The defect this fixes lived at the call site, so it needs a
test that goes through Run.
Driven through the real dispatch with the RunChild seam capturing argv.
runFresh and runResume each construct their builder input by hand and carry a
byte-identical ParentModel line. Deleting either compiles and, until now,
deleting the fresh one was silent.
The resume half is what this branch repairs. This covers the other half so the
pair cannot drift again in the direction nobody was looking.
|
Added one more test commit at c4e7d816.
While falsifying the resume fix I found that runFresh carries a byte-identical ParentModel: options.ParentModel, line, and deleting THAT one was silent too. My own falsification actually hit the fresh occurrence first and reported the resume test as passing, which is how I noticed.
So both call sites are covered now. Deleting the fresh one fails with:
the fresh child was launched with --model "" (present=false), want the parent's
The resume half is still what this branch repairs. This just stops the pair drifting again in the direction nobody was looking.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Greptile Summary
The PR preserves model and reasoning-effort selection when resuming specialists by passing the parent fallbacks into BuildResumeArgs and applying the existing model argument logic.
- Adds model and reasoning-effort propagation to resumed specialist command lines.
- Adds builder-level coverage for pinned and inherited configurations.
- Adds a dispatch-level regression test confirming the real resume call site forwards the parent model.
Confidence Score: 5/5
The PR appears safe to merge, with resumed specialists now consistently retaining the intended model configuration.
The resume command accepts the newly forwarded flags, those values reach provider construction, and the implementation matches the established fresh-run precedence semantics with focused regression coverage.
Important Files Changed
| Filename |
Overview |
| internal/specialist/exec.go |
Aligns resumed-specialist argument construction with the fresh path and correctly forwards parent model and reasoning-effort options. |
| internal/specialist/resume_model_test.go |
Adds hermetic regression coverage for model inheritance, reasoning-effort precedence, argument ordering, and end-to-end resume dispatch. |
Reviews (1): Last reviewed commit: "test(specialist): cover the resume call ..." | Re-trigger Greptile
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Sep 4, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Essentials
Run ID: c6dd2906-c6fb-4c84-ab32-f1cb2d0c0c89
📥 Commits
Reviewing files that changed from the base of the PR and between 7c66a50 and c4e7d81.
📒 Files selected for processing (1)
internal/specialist/resume_model_test.go
Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.
Walkthrough
Resume execution preserves manifest-pinned model settings. It inherits parent model and reasoning-effort settings when the manifest does not define them. Runtime wiring forwards these options, and tests cover fresh and resumed execution paths.
Changes
Specialist resume settings
| Layer / File(s) |
Summary |
Resume argument construction internal/specialist/exec.go |
BuildResumeArgsInput accepts parent model and reasoning-effort values. BuildResumeArgs applies manifest-pinned values and parent fallbacks. |
Resume runtime wiring and validation internal/specialist/exec.go, internal/specialist/resume_model_test.go |
runResume forwards parent settings. Tests cover inheritance rules, argument ordering, and fresh and resumed model propagation. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Merge Risk: ⚪ Minimal · up to c4e7d
Specialist resumes now retain pinned models and otherwise inherit parent settings, with coverage for fresh and resumed launches. No merge-blocking risk remains.
Sequence Diagram(s)
sequenceDiagram
participant runResume
participant BuildResumeArgs
participant ChildSpecialist
runResume->>BuildResumeArgs: Forward parent model and reasoning effort
BuildResumeArgs->>BuildResumeArgs: Apply manifest pins or parent fallbacks
BuildResumeArgs->>ChildSpecialist: Launch with ordered model and autonomy flags
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name |
Status |
Explanation |
Resolution |
| Docstring Coverage |
⚠️ Warning |
Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 2 files. |
Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
| Check name |
Status |
Explanation |
| Description Check |
✅ Passed |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
✅ Passed |
The title clearly and concisely describes the main change: preserving a specialist's pinned model when it is resumed. |
| Linked Issues check |
✅ Passed |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
✅ Passed |
Check skipped because no linked issues were found for this pull request. |
- Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
fix/specialist-resume-model
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Zero automated PR review
Verdict: No blockers found
Blockers
Validation
- [pass] Diff hygiene:
git diff --check
- [pass] Tests:
go test ./...
- [pass] Build:
go run ./cmd/zero-release build
- [pass] Smoke build:
go run ./cmd/zero-release smoke
Scope
Head: c4e7d8165aba
Changed files (2): internal/specialist/exec.go, internal/specialist/resume_model_test.go
This deterministic review checks validation status and basic diff hygiene. A human reviewer still owns product judgment and design quality.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verdict: Approve. A quiet billing bug with a tight fix and genuinely good tests.
What it does
A specialist pinned to a cheap model ran on that model exactly once — on resume the child silently fell back to the parent's configured model. Same work, bigger bill, nothing surfaced. BuildResumeArgsInput now carries ParentModel/ParentReasoningEffort (the same fallbacks the fresh path takes) and runResume passes through what TaskRunOptions already held. The effort rule travels unchanged: parent effort inherits only when the manifest pins no model of its own.
What's good
- Both builders driven side by side. Pinned model survives resume, unpinned still inherits, both halves of the effort rule hold, and
--model keeps its position relative to --auto in both. The two paths can't drift apart again without a test firing.
- Call-site coverage, not just builder coverage.
TestRunResumePassesTheParentModelThroughToTheChild goes through the real Run dispatch with the RunChild seam capturing argv — the author documents that deleting the field from the call site still compiled and passed the builder tests, so this test is the one that actually guards the fix. The fresh path gets the same guard.
- Execution semantics unchanged. The
!ok error branches and flag ordering are identical; this only threads two already-held values one call deeper.
Verification (mine, isolated worktree)
go build, full internal/specialist suite green.
No blocking notes. Merge-ready.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Sep 7, 2026
Reviewers
jatmn
jatmn approved these changes
anandh8x
anandh8x approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|