Skip to content

fix(skills): unbreak main after fork-skill refactor merge#2527

Merged
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/fixing-the-main-branch-5ec8453a
Apr 27, 2026
Merged

fix(skills): unbreak main after fork-skill refactor merge#2527
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/fixing-the-main-branch-5ec8453a

Conversation

@dgageot
Copy link
Copy Markdown
Member

@dgageot dgageot commented Apr 27, 2026

Why

main is currently broken: package github.com/docker/docker-agent/pkg/runtime fails to build because pkg/runtime/skill_runner.go references identifiers that no longer exist in scope:

pkg/runtime/skill_runner.go:67:5:  undefined: skill
pkg/runtime/skill_runner.go:68:45: undefined: skill
pkg/runtime/skill_runner.go:73:14: undefined: params
pkg/runtime/skill_runner.go:74:14: undefined: skill

The breakage was introduced by the merge of two PRs that touched handleRunSkill:

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.

  • Add Model string to PreparedSkillFork and populate it from skill.Model inside (*SkillsToolset).PrepareForkSubSession. 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 — runtime behaviour is identical to what Skills: allow fork skills to override the model #2525 intended.
  • Extend TestSkillsToolset_PrepareForkSubSession to assert the Model field is propagated, and add TestSkillsToolset_PrepareForkSubSession_NoModelOverride to pin down the empty-Model contract the runtime relies on to skip the override path.

Validation

  • go build ./... — clean
  • go vet ./... — clean
  • golangci-lint run ./pkg/runtime/... ./pkg/tools/builtin/... — 0 issues
  • go test ./pkg/runtime/... ./pkg/tools/builtin/... ./pkg/skills/... ./pkg/agent/... — all green

Diffstat

 pkg/runtime/skill_runner.go      |  8 ++++----
 pkg/tools/builtin/skills.go      |  4 ++++
 pkg/tools/builtin/skills_test.go | 19 ++++++++++++++++++-
 3 files changed, 26 insertions(+), 5 deletions(-)

Assisted-By: docker-agent

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
@dgageot dgageot requested a review from a team as a code owner April 27, 2026 12:02
@dgageot dgageot merged commit 79cba5a into docker:main Apr 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants