Skip to content

fix(teamloader): preserve deferred toolset instructions#3680

Merged
Sayt-0 merged 1 commit into
docker:mainfrom
Piyush0049:fix/deferred-toolsets-instructions
Jul 16, 2026
Merged

fix(teamloader): preserve deferred toolset instructions#3680
Sayt-0 merged 1 commit into
docker:mainfrom
Piyush0049:fix/deferred-toolsets-instructions

Conversation

@Piyush0049

Copy link
Copy Markdown
Contributor

Description

This pull request fixes a logic bug in the teamloader where setting defer_all: true on a toolset would cause the entire toolset to be dropped from the agent's context.

Dropping the toolset had the unintended side effect of permanently deleting the toolset's custom Instructions, leaving the LLM completely unaware of when or how to ask for the deferred tools to be loaded.

Changes Made

  • Implemented WithNoToolsFilter in pkg/teamloader/filter.go to wrap toolsets.
  • This new filter intercepts all tool requests and returns an empty slice, guaranteeing the agent sees zero tools.
  • The filter safely delegates to the wrapped toolset for Instructions, ensuring the instructions are seamlessly preserved in the agent's system prompt.
  • Replaced the destructive continue block in pkg/teamloader/teamloader.go with the new filter.
  • Added comprehensive unit tests in pkg/teamloader/filter_test.go.

Verification

  • Ran go test and verified all unit tests pass.
  • Verified no formatting or linting regressions with go fmt and go vet.

@Piyush0049
Piyush0049 requested a review from a team as a code owner July 16, 2026 11:21
@aheritier aheritier added area/config For configuration parsing, YAML, environment variables kind/fix PR fixes a bug (maps to fix:). Use on PRs only. labels Jul 16, 2026

@rumpl rumpl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@Sayt-0
Sayt-0 enabled auto-merge July 16, 2026 11:45
@Sayt-0
Sayt-0 merged commit 2951b34 into docker:main Jul 16, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config For configuration parsing, YAML, environment variables kind/fix PR fixes a bug (maps to fix:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants