Repository navigation
feat: gate sampling tool registration behind agent.sampling config flag - #1562
Merged
Merged
Conversation
Adds an agent.sampling boolean to config.yaml that controls whether the sampling tool is registered, mirroring how agent.decision.baseUrl gates the decision tool. Defaults to true to preserve existing behavior. - src/config/schemas/agent.js: add sampling boolean (default true) - src/tools/index.js: gate sampling registration on samplingEnabled - src/memory/prompts.js + prompts/SYSTEM_PROMPT.md: conditional sampling instruction via SAMPLING_TOOL_INSTRUCTION token - config.yaml: add agent.sampling flag - tests: gating tests in tool_index.test.js and prompts.test.js
Adds the gate-sampling-tool-config OpenSpec change documenting the agent.sampling config flag that gates sampling tool registration. Includes proposal, design, delta spec for ephemeral-sampling, and tasks.
…pling spec Archives the completed gate-sampling-tool-config OpenSpec change to openspec/changes/archive/2026-10-28-gate-sampling-tool-config/ and syncs its delta spec into openspec/specs/ephemeral-sampling/spec.md, adding the config-gated registration and conditional instruction requirements.
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.
Description
Adds an
agent.samplingboolean config flag that gates registration of thesamplingtool, mirroring howagent.decision.baseUrlgates thedecisiontool. Defaults totrue, preserving existing behavior. When set tofalse, the tool is not registered and its system-prompt instruction is omitted.Type of Change
Testing
Added gating tests in
tests/unit/tool_index.test.js(registers by default / when true / not when false) and token injection/removal tests intests/unit/prompts.test.js. Full suite passes: 4445 tests, 0 failures. Lint clean (oxlint 0 warnings, 0 errors).Coverage
Checklist
npm run lintpasses