Repository navigation
✨ feat: support per-rung models under --vm — ladder and advisor work in VM mode - #33
Merged
Merged
Conversation
The coverage hook failed on a clean checkout for two reasons: - Four untested branches (NewEscalation negative clamp, ResolveStrategy retry hint, AnalyzeModels read error + sort tie-break, agent.New unknown advisor/rung provider) were below the 100% bar. - macOS mktemp treats a template with a suffix (coverage-XXXXXX.out) as a literal path, so concurrent runs shared one file and raced on it. Also adds the implementation plan for #28.
vm.Exec previously ignored its context (exec.Command, not CommandContext), so cancellation and timeouts never reached the mb ssh process — in particular the advisor's 5-minute planning timeout could not cancel a hung VM invocation.
…#28) agent.New now applies options before cfg resolution (injected executors still win; resolution only fills what is unset) and gains WithVMExecutorFactory. Under --vm the base worker, each escalation rung, and the advisor are constructed through the factory — claude models only; a cross-provider rung or non-claude advisor provider disables that capability with a warning instead of the previous blanket gate.
The useVM block now injects agent.WithVMExecutorFactory instead of a pre-built base executor; agent.New constructs the base worker, ladder rungs, and advisor from the factory with their configured models.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #28. Follow-up to #25, #24, and #20.
Problem
VM isolation (
--vm) and the cost-optimization features (escalation ladder, advisor) were mutually exclusive:agent.New()warned and disabled both under VM mode because the VM executor hardcoded aclaudeinvocation with no--modelplumbing.Changes
worker.NewVMExecutortakesVMExecConfig{Model}— passes--modelinside the VM claude invocation and stampsProvider/Modelon results sofix_attempttelemetry can compare tiers under VM mode (the base worker model gap from Plumb --model through to claude and codex executors #20).agent.WithVMExecutorFactory—cmd/run.goinjects afunc(model string) worker.Executorclosure over the VM handle;agent.Newbuilds the base worker, each ladder rung, and the advisor through it undercfg.VM.Newnow applies options before cfg resolution (injected executors still win; resolution only fills what's unset).claudeprovider under--vm; a cross-provider rung (e.g.ollama/...) or non-claude advisor disables that capability with a warning. Cross-provider rungs inside VMs stay out of scope.vm.Exechonors its context (exec.CommandContext) — the advisor's 5-minute planning timeout can now actually cancel a hungmb sshinvocation.example.config.toml, and the sweeper skill note the claude-only constraint under[vm].Also unblocks the repo's pre-commit coverage gate, which failed on a clean checkout: covers four untested branches and fixes a macOS
mktempbug inscripts/check-coverage.sh(a suffixed template likecoverage-XXXXXX.outis treated as a literal path, so concurrent runs raced on one shared file).Testing
--modelarg construction and result metadata; ctx propagation through the vm runner; agent factory wiring for base/rungs/advisor plus the disable paths (no factory, cross-provider rung, non-claude advisor).go build ./... && go vet ./... && go test ./...all green.