Merge pull request #1716 from QwenLM/fix/is-background-param-docs

Fix: clarify is_background parameter is required in docs and examples
This commit is contained in:
tanzhenxin 2026-02-05 17:21:17 +08:00 committed by GitHub
commit 143e00fb42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 32 additions and 21 deletions

View File

@ -149,7 +149,7 @@ model: true
<example>
user: start the server implemented in server.js
model: [tool_call: run_shell_command for 'node server.js &' because it must run in the background]
model: [tool_call: run_shell_command for 'node server.js &' with is_background: true because it must run in the background]
</example>
<example>
@ -383,7 +383,7 @@ model: true
<example>
user: start the server implemented in server.js
model: [tool_call: run_shell_command for 'node server.js &' because it must run in the background]
model: [tool_call: run_shell_command for 'node server.js &' with is_background: true because it must run in the background]
</example>
<example>
@ -597,7 +597,7 @@ model: true
<example>
user: start the server implemented in server.js
model: [tool_call: run_shell_command for 'node server.js &' because it must run in the background]
model: [tool_call: run_shell_command for 'node server.js &' with is_background: true because it must run in the background]
</example>
<example>
@ -811,7 +811,7 @@ model: true
<example>
user: start the server implemented in server.js
model: [tool_call: run_shell_command for 'node server.js &' because it must run in the background]
model: [tool_call: run_shell_command for 'node server.js &' with is_background: true because it must run in the background]
</example>
<example>
@ -1025,7 +1025,7 @@ model: true
<example>
user: start the server implemented in server.js
model: [tool_call: run_shell_command for 'node server.js &' because it must run in the background]
model: [tool_call: run_shell_command for 'node server.js &' with is_background: true because it must run in the background]
</example>
<example>
@ -1239,7 +1239,7 @@ model: true
<example>
user: start the server implemented in server.js
model: [tool_call: run_shell_command for 'node server.js &' because it must run in the background]
model: [tool_call: run_shell_command for 'node server.js &' with is_background: true because it must run in the background]
</example>
<example>
@ -1453,7 +1453,7 @@ model: true
<example>
user: start the server implemented in server.js
model: [tool_call: run_shell_command for 'node server.js &' because it must run in the background]
model: [tool_call: run_shell_command for 'node server.js &' with is_background: true because it must run in the background]
</example>
<example>
@ -1667,7 +1667,7 @@ model: true
<example>
user: start the server implemented in server.js
model: [tool_call: run_shell_command for 'node server.js &' because it must run in the background]
model: [tool_call: run_shell_command for 'node server.js &' with is_background: true because it must run in the background]
</example>
<example>
@ -1881,7 +1881,7 @@ model: true
<example>
user: start the server implemented in server.js
model: [tool_call: run_shell_command for 'node server.js &' because it must run in the background]
model: [tool_call: run_shell_command for 'node server.js &' with is_background: true because it must run in the background]
</example>
<example>
@ -2097,7 +2097,7 @@ model: true
user: start the server implemented in server.js
model:
<tool_call>
{"name": "run_shell_command", "arguments": {"command": "node server.js &"}}
{"name": "run_shell_command", "arguments": {"command": "node server.js &", "is_background": true}}
</tool_call>
</example>
@ -2332,12 +2332,15 @@ model: true
<example>
user: start the server implemented in server.js
model:
model:
<tool_call>
<function=run_shell_command>
<parameter=command>
node server.js &
</parameter>
<parameter=is_background>
true
</parameter>
</function>
</tool_call>
</example>
@ -2631,7 +2634,7 @@ model: true
user: start the server implemented in server.js
model:
<tool_call>
{"name": "run_shell_command", "arguments": {"command": "node server.js &"}}
{"name": "run_shell_command", "arguments": {"command": "node server.js &", "is_background": true}}
</tool_call>
</example>
@ -2866,12 +2869,15 @@ model: true
<example>
user: start the server implemented in server.js
model:
model:
<tool_call>
<function=run_shell_command>
<parameter=command>
node server.js &
</parameter>
<parameter=is_background>
true
</parameter>
</function>
</tool_call>
</example>
@ -3159,7 +3165,7 @@ model: true
<example>
user: start the server implemented in server.js
model: [tool_call: run_shell_command for 'node server.js &' because it must run in the background]
model: [tool_call: run_shell_command for 'node server.js &' with is_background: true because it must run in the background]
</example>
<example>
@ -3373,7 +3379,7 @@ model: true
<example>
user: start the server implemented in server.js
model: [tool_call: run_shell_command for 'node server.js &' because it must run in the background]
model: [tool_call: run_shell_command for 'node server.js &' with is_background: true because it must run in the background]
</example>
<example>

View File

@ -302,7 +302,9 @@ describe('Model-specific tool call formats', () => {
// Should contain JSON-style tool calls
expect(prompt).toContain('<tool_call>');
expect(prompt).toContain('{"name": "run_shell_command"');
expect(prompt).toContain('"arguments": {"command": "node server.js &"}');
expect(prompt).toContain(
'"arguments": {"command": "node server.js &", "is_background": true}',
);
expect(prompt).toContain('</tool_call>');
// Should NOT contain bracket-style tool calls

View File

@ -447,7 +447,7 @@ model: true
<example>
user: start the server implemented in server.js
model: [tool_call: ${ToolNames.SHELL} for 'node server.js &' because it must run in the background]
model: [tool_call: ${ToolNames.SHELL} for 'node server.js &' with is_background: true because it must run in the background]
</example>
<example>
@ -523,12 +523,15 @@ model: true
<example>
user: start the server implemented in server.js
model:
model:
<tool_call>
<function=${ToolNames.SHELL}>
<parameter=command>
node server.js &
</parameter>
<parameter=is_background>
true
</parameter>
</function>
</tool_call>
</example>
@ -679,7 +682,7 @@ model: true
user: start the server implemented in server.js
model:
<tool_call>
{"name": "${ToolNames.SHELL}", "arguments": {"command": "node server.js &"}}
{"name": "${ToolNames.SHELL}", "arguments": {"command": "node server.js &", "is_background": true}}
</tool_call>
</example>

View File

@ -543,7 +543,7 @@ export class ShellTool extends BaseDeclarativeTool<
is_background: {
type: 'boolean',
description:
'Whether to run the command in background. Default is false. Set to true for long-running processes like development servers, watchers, or daemons that should continue running without blocking further commands.',
'Optional: Whether to run the command in background. If not specified, defaults to false (foreground execution). Explicitly set to true for long-running processes like development servers, watchers, or daemons that should continue running without blocking further commands.',
},
timeout: {
type: 'number',
@ -560,7 +560,7 @@ export class ShellTool extends BaseDeclarativeTool<
'(OPTIONAL) The absolute path of the directory to run the command in. If not provided, the project root directory is used. Must be a directory within the workspace and must already exist.',
},
},
required: ['command', 'is_background'],
required: ['command'],
},
false, // output is not markdown
true, // output can be updated