fix(skills): unbreak main after fork-skill refactor merge#2527
Merged
dgageot merged 1 commit intodocker:mainfrom Apr 27, 2026
Merged
fix(skills): unbreak main after fork-skill refactor merge#2527dgageot merged 1 commit intodocker:mainfrom
dgageot merged 1 commit intodocker:mainfrom
Conversation
The merge of docker#2524 (move fork-skill validation into SkillsToolset) on top of docker#2525 (skill model-override) left handleRunSkill referencing identifiers that no longer exist in its scope: skill.Model and params.Name. The refactor renamed params -> args and dropped the local skill variable in favour of a PreparedSkillFork bundle, but the model-override block introduced by docker#2525 was not updated, so package github.com/docker/docker-agent/pkg/runtime failed to build. Restore the build by surfacing the model override through the toolset, in line with the refactor's intent of keeping skill-specific business rules out of the runtime. - Add Model to PreparedSkillFork and populate it from skill.Model inside (*SkillsToolset).PrepareForkSubSession, so the runtime no longer needs a direct skills.Skill reference. - Switch handleRunSkill's override block to prepared.Model and prepared.SkillName; the WithAgentModel call, defer restore(), and warning log are otherwise unchanged. - Extend the PrepareForkSubSession happy-path test to assert the Model field is propagated, and add a _NoModelOverride case that pins down the empty-Model contract the runtime relies on to skip the override path. Validated with go build, go vet, golangci-lint (0 issues), and go test on pkg/runtime, pkg/tools/builtin, pkg/skills, and pkg/agent. Assisted-By: docker-agent
gtardif
approved these changes
Apr 27, 2026
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.
Why
mainis currently broken:package github.com/docker/docker-agent/pkg/runtimefails to build becausepkg/runtime/skill_runner.goreferences identifiers that no longer exist in scope:The breakage was introduced by the merge of two PRs that touched
handleRunSkill:skill.Modelandparams.Name.handleRunSkillto delegate toSkillsToolset.PrepareForkSubSession, dropping the localskillvariable and renamingparams→args.The merge applied #2524 cleanly on top of #2525 but did not update the new model-override block, leaving four references to undefined identifiers.
Fix
Restore the build by surfacing the model override through the toolset, in line with the refactor's intent of keeping skill-specific business rules out of the runtime.
Model stringtoPreparedSkillForkand populate it fromskill.Modelinside(*SkillsToolset).PrepareForkSubSession. The runtime no longer needs a directskills.Skillreference.handleRunSkill's override block toprepared.Modelandprepared.SkillName. TheWithAgentModelcall,defer restore(), and warning log are otherwise unchanged — runtime behaviour is identical to what Skills: allow fork skills to override the model #2525 intended.TestSkillsToolset_PrepareForkSubSessionto assert theModelfield is propagated, and addTestSkillsToolset_PrepareForkSubSession_NoModelOverrideto pin down the empty-Modelcontract the runtime relies on to skip the override path.Validation
go build ./...— cleango vet ./...— cleangolangci-lint run ./pkg/runtime/... ./pkg/tools/builtin/...— 0 issuesgo test ./pkg/runtime/... ./pkg/tools/builtin/... ./pkg/skills/... ./pkg/agent/...— all greenDiffstat
Assisted-By: docker-agent