mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
fix(tools): remove tool:* prompt filtering per review feedback
LegGasai noted that filtering prompt sections by tool:* prefix is a poor heuristic: it conflates section naming convention with presentation semantics and would incorrectly drop tool:structured_output. The executor collapse already enforces the boundary — a model-direct native call is rejected as UNKNOWN_TOOL regardless of what the prompt says, so filtering the prompt adds no security and only risks losing useful guidance. The tool:read/tool:bash/etc sections describe capability usage patterns that apply to both native and code presentations, and keeping them does not reopen the native direct-call path because the executor blocks it.
This commit is contained in:
@@ -810,17 +810,6 @@ export class ToolRegistry extends Service {
|
||||
if (this.defaultMode !== 'native') {
|
||||
ctx.systemPrompt.section(this.sdkSection())
|
||||
}
|
||||
// Under `code` mode, filter out tool-specific guidance sections
|
||||
// (`tool:*`) that instruct the model to call native tools directly.
|
||||
// The `tools:sdk` section and SDK types remain — they teach the model
|
||||
// how to call tools through `run_code`.
|
||||
if (this.defaultMode === 'code') {
|
||||
ctx.on('system-prompt/assemble', async (_assembly, _context, next) => {
|
||||
const result = await next()
|
||||
result.sections = result.sections.filter(s => !s.name.startsWith('tool:'))
|
||||
return result
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user