[System]
You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

[User] show me the current branch

[Tool] main

[Assistant] Done. Output above.

<｜begin▁of▁sentence｜>You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

## Tools

You have access to a set of tools to help answer the user question. You can invoke tools by writing a "<｜DSML｜tool_calls>" block like the following:

<｜DSML｜tool_calls>
<｜DSML｜invoke name="$TOOL_NAME">
<｜DSML｜parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</｜DSML｜parameter>
...
</｜DSML｜invoke>
<｜DSML｜invoke name="$TOOL_NAME2">
...
</｜DSML｜invoke>
</｜DSML｜tool_calls>

String parameters should be specified as raw text and set `string="true"`. Preserve characters such as `>`, `&`, and `&&` exactly; never replace normal string characters with XML or HTML entity escapes. Only if a string value itself contains the exact closing parameter tag `</｜DSML｜parameter>`, write that tag as `</｜DSML｜parameter>` inside the value. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`.

If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.

Otherwise, output directly after </think> with tool calls or final response.

### Available Tool Schemas

{"name":"bash","description":"Run a shell command in the workspace.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The command line to execute."},"description":{"type":"string","description":"Short description of intent."},"timeout":{"type":"integer","description":"Timeout in seconds.","default":30}},"required":["command"]}}
{"name":"read_file","description":"Read a region of a file from the workspace.","parameters":{"type":"object","properties":{"path":{"type":"string"},"start":{"type":"integer","default":1},"lines":{"type":"integer","default":200}},"required":["path"]}}
{"name":"grep","description":"Search files for a regex pattern.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"path":{"type":"string","default":"."},"glob":{"type":"string","description":"Filename glob filter."},"ignore_case":{"type":"boolean","default":false}},"required":["pattern"]}}
{"name":"list_files","description":"List files matching a glob pattern, depth-limited.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"max_depth":{"type":"integer","default":3}},"required":["pattern"]}}
{"name":"edit","description":"Apply a small old/new text edit to a file.","parameters":{"type":"object","properties":{"path":{"type":"string"},"old_string":{"type":"string"},"new_string":{"type":"string"},"line_number":{"type":"integer","description":"Disambiguate when old_string occurs more than once."},"replace_all":{"type":"boolean","default":false}},"required":["path","old_string","new_string"]}}
{"name":"web_fetch","description":"Fetch a URL and return the body as text.","parameters":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"timeout":{"type":"integer","default":20},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}}

You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. Use the exact parameter names from the schemas.<｜User｜>show me the current branch<｜Assistant｜></think>

<｜DSML｜tool_calls>
<｜DSML｜invoke name="bash">
<｜DSML｜parameter name="command" string="true">git rev-parse --abbrev-ref HEAD</｜DSML｜parameter>
<｜DSML｜parameter name="description" string="true">current git branch</｜DSML｜parameter>
</｜DSML｜invoke>
</｜DSML｜tool_calls><｜end▁of▁sentence｜><｜User｜><tool_result>main
</tool_result><｜Assistant｜></think>Done. Output above.<｜end▁of▁sentence｜>


[System]
You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

[User] show me the current branch

[Tool] main

[Assistant] Done. Output above.

<｜begin▁of▁sentence｜>You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

## Tools

You have access to a set of tools to help answer the user question. You can invoke tools by writing a "<｜DSML｜tool_calls>" block like the following:

<｜DSML｜tool_calls>
<｜DSML｜invoke name="$TOOL_NAME">
<｜DSML｜parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</｜DSML｜parameter>
...
</｜DSML｜invoke>
<｜DSML｜invoke name="$TOOL_NAME2">
...
</｜DSML｜invoke>
</｜DSML｜tool_calls>

String parameters should be specified as raw text and set `string="true"`. Preserve characters such as `>`, `&`, and `&&` exactly; never replace normal string characters with XML or HTML entity escapes. Only if a string value itself contains the exact closing parameter tag `</｜DSML｜parameter>`, write that tag as `</｜DSML｜parameter>` inside the value. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`.

If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.

Otherwise, output directly after </think> with tool calls or final response.

### Available Tool Schemas

{"name":"bash","description":"Run a shell command in the workspace.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The command line to execute."},"description":{"type":"string","description":"Short description of intent."},"timeout":{"type":"integer","description":"Timeout in seconds.","default":30}},"required":["command"]}}
{"name":"read_file","description":"Read a region of a file from the workspace.","parameters":{"type":"object","properties":{"path":{"type":"string"},"start":{"type":"integer","default":1},"lines":{"type":"integer","default":200}},"required":["path"]}}
{"name":"grep","description":"Search files for a regex pattern.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"path":{"type":"string","default":"."},"glob":{"type":"string","description":"Filename glob filter."},"ignore_case":{"type":"boolean","default":false}},"required":["pattern"]}}
{"name":"list_files","description":"List files matching a glob pattern, depth-limited.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"max_depth":{"type":"integer","default":3}},"required":["pattern"]}}
{"name":"edit","description":"Apply a small old/new text edit to a file.","parameters":{"type":"object","properties":{"path":{"type":"string"},"old_string":{"type":"string"},"new_string":{"type":"string"},"line_number":{"type":"integer","description":"Disambiguate when old_string occurs more than once."},"replace_all":{"type":"boolean","default":false}},"required":["path","old_string","new_string"]}}
{"name":"web_fetch","description":"Fetch a URL and return the body as text.","parameters":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"timeout":{"type":"integer","default":20},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}}

You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. Use the exact parameter names from the schemas.<｜User｜>show me the current branch<｜Assistant｜><think>Direct call; the answer is in the tool output.</think>

<｜DSML｜tool_calls>
<｜DSML｜invoke name="bash">
<｜DSML｜parameter name="command" string="true">git rev-parse --abbrev-ref HEAD</｜DSML｜parameter>
<｜DSML｜parameter name="description" string="true">current git branch</｜DSML｜parameter>
</｜DSML｜invoke>
</｜DSML｜tool_calls><｜end▁of▁sentence｜><｜User｜><tool_result>main
</tool_result><｜Assistant｜><think></think>Done. Output above.<｜end▁of▁sentence｜>


[System]
You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

[User] count lines in ds4.c

[Tool] 23456 ds4.c

[Assistant] Done. Output above.

<｜begin▁of▁sentence｜>You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

## Tools

You have access to a set of tools to help answer the user question. You can invoke tools by writing a "<｜DSML｜tool_calls>" block like the following:

<｜DSML｜tool_calls>
<｜DSML｜invoke name="$TOOL_NAME">
<｜DSML｜parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</｜DSML｜parameter>
...
</｜DSML｜invoke>
<｜DSML｜invoke name="$TOOL_NAME2">
...
</｜DSML｜invoke>
</｜DSML｜tool_calls>

String parameters should be specified as raw text and set `string="true"`. Preserve characters such as `>`, `&`, and `&&` exactly; never replace normal string characters with XML or HTML entity escapes. Only if a string value itself contains the exact closing parameter tag `</｜DSML｜parameter>`, write that tag as `</｜DSML｜parameter>` inside the value. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`.

If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.

Otherwise, output directly after </think> with tool calls or final response.

### Available Tool Schemas

{"name":"bash","description":"Run a shell command in the workspace.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The command line to execute."},"description":{"type":"string","description":"Short description of intent."},"timeout":{"type":"integer","description":"Timeout in seconds.","default":30}},"required":["command"]}}
{"name":"read_file","description":"Read a region of a file from the workspace.","parameters":{"type":"object","properties":{"path":{"type":"string"},"start":{"type":"integer","default":1},"lines":{"type":"integer","default":200}},"required":["path"]}}
{"name":"grep","description":"Search files for a regex pattern.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"path":{"type":"string","default":"."},"glob":{"type":"string","description":"Filename glob filter."},"ignore_case":{"type":"boolean","default":false}},"required":["pattern"]}}
{"name":"list_files","description":"List files matching a glob pattern, depth-limited.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"max_depth":{"type":"integer","default":3}},"required":["pattern"]}}
{"name":"edit","description":"Apply a small old/new text edit to a file.","parameters":{"type":"object","properties":{"path":{"type":"string"},"old_string":{"type":"string"},"new_string":{"type":"string"},"line_number":{"type":"integer","description":"Disambiguate when old_string occurs more than once."},"replace_all":{"type":"boolean","default":false}},"required":["path","old_string","new_string"]}}
{"name":"web_fetch","description":"Fetch a URL and return the body as text.","parameters":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"timeout":{"type":"integer","default":20},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}}

You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. Use the exact parameter names from the schemas.<｜User｜>count lines in ds4.c<｜Assistant｜></think>

<｜DSML｜tool_calls>
<｜DSML｜invoke name="bash">
<｜DSML｜parameter name="command" string="true">wc -l ds4.c</｜DSML｜parameter>
<｜DSML｜parameter name="description" string="true">line count of ds4.c</｜DSML｜parameter>
</｜DSML｜invoke>
</｜DSML｜tool_calls><｜end▁of▁sentence｜><｜User｜><tool_result> 23456 ds4.c
</tool_result><｜Assistant｜></think>Done. Output above.<｜end▁of▁sentence｜>


[System]
You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

[User] count lines in ds4.c

[Tool] 23456 ds4.c

[Assistant] Done. Output above.

<｜begin▁of▁sentence｜>You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

## Tools

You have access to a set of tools to help answer the user question. You can invoke tools by writing a "<｜DSML｜tool_calls>" block like the following:

<｜DSML｜tool_calls>
<｜DSML｜invoke name="$TOOL_NAME">
<｜DSML｜parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</｜DSML｜parameter>
...
</｜DSML｜invoke>
<｜DSML｜invoke name="$TOOL_NAME2">
...
</｜DSML｜invoke>
</｜DSML｜tool_calls>

String parameters should be specified as raw text and set `string="true"`. Preserve characters such as `>`, `&`, and `&&` exactly; never replace normal string characters with XML or HTML entity escapes. Only if a string value itself contains the exact closing parameter tag `</｜DSML｜parameter>`, write that tag as `</｜DSML｜parameter>` inside the value. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`.

If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.

Otherwise, output directly after </think> with tool calls or final response.

### Available Tool Schemas

{"name":"bash","description":"Run a shell command in the workspace.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The command line to execute."},"description":{"type":"string","description":"Short description of intent."},"timeout":{"type":"integer","description":"Timeout in seconds.","default":30}},"required":["command"]}}
{"name":"read_file","description":"Read a region of a file from the workspace.","parameters":{"type":"object","properties":{"path":{"type":"string"},"start":{"type":"integer","default":1},"lines":{"type":"integer","default":200}},"required":["path"]}}
{"name":"grep","description":"Search files for a regex pattern.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"path":{"type":"string","default":"."},"glob":{"type":"string","description":"Filename glob filter."},"ignore_case":{"type":"boolean","default":false}},"required":["pattern"]}}
{"name":"list_files","description":"List files matching a glob pattern, depth-limited.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"max_depth":{"type":"integer","default":3}},"required":["pattern"]}}
{"name":"edit","description":"Apply a small old/new text edit to a file.","parameters":{"type":"object","properties":{"path":{"type":"string"},"old_string":{"type":"string"},"new_string":{"type":"string"},"line_number":{"type":"integer","description":"Disambiguate when old_string occurs more than once."},"replace_all":{"type":"boolean","default":false}},"required":["path","old_string","new_string"]}}
{"name":"web_fetch","description":"Fetch a URL and return the body as text.","parameters":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"timeout":{"type":"integer","default":20},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}}

You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. Use the exact parameter names from the schemas.<｜User｜>count lines in ds4.c<｜Assistant｜><think>Direct call; the answer is in the tool output.</think>

<｜DSML｜tool_calls>
<｜DSML｜invoke name="bash">
<｜DSML｜parameter name="command" string="true">wc -l ds4.c</｜DSML｜parameter>
<｜DSML｜parameter name="description" string="true">line count of ds4.c</｜DSML｜parameter>
</｜DSML｜invoke>
</｜DSML｜tool_calls><｜end▁of▁sentence｜><｜User｜><tool_result> 23456 ds4.c
</tool_result><｜Assistant｜><think></think>Done. Output above.<｜end▁of▁sentence｜>


[System]
You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

[User] find TODO comments

[Tool] ds4_server.c:842:    // TODO: revisit when streaming usage is finalized

[Assistant] Done. Output above.

<｜begin▁of▁sentence｜>You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

## Tools

You have access to a set of tools to help answer the user question. You can invoke tools by writing a "<｜DSML｜tool_calls>" block like the following:

<｜DSML｜tool_calls>
<｜DSML｜invoke name="$TOOL_NAME">
<｜DSML｜parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</｜DSML｜parameter>
...
</｜DSML｜invoke>
<｜DSML｜invoke name="$TOOL_NAME2">
...
</｜DSML｜invoke>
</｜DSML｜tool_calls>

String parameters should be specified as raw text and set `string="true"`. Preserve characters such as `>`, `&`, and `&&` exactly; never replace normal string characters with XML or HTML entity escapes. Only if a string value itself contains the exact closing parameter tag `</｜DSML｜parameter>`, write that tag as `</｜DSML｜parameter>` inside the value. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`.

If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.

Otherwise, output directly after </think> with tool calls or final response.

### Available Tool Schemas

{"name":"bash","description":"Run a shell command in the workspace.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The command line to execute."},"description":{"type":"string","description":"Short description of intent."},"timeout":{"type":"integer","description":"Timeout in seconds.","default":30}},"required":["command"]}}
{"name":"read_file","description":"Read a region of a file from the workspace.","parameters":{"type":"object","properties":{"path":{"type":"string"},"start":{"type":"integer","default":1},"lines":{"type":"integer","default":200}},"required":["path"]}}
{"name":"grep","description":"Search files for a regex pattern.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"path":{"type":"string","default":"."},"glob":{"type":"string","description":"Filename glob filter."},"ignore_case":{"type":"boolean","default":false}},"required":["pattern"]}}
{"name":"list_files","description":"List files matching a glob pattern, depth-limited.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"max_depth":{"type":"integer","default":3}},"required":["pattern"]}}
{"name":"edit","description":"Apply a small old/new text edit to a file.","parameters":{"type":"object","properties":{"path":{"type":"string"},"old_string":{"type":"string"},"new_string":{"type":"string"},"line_number":{"type":"integer","description":"Disambiguate when old_string occurs more than once."},"replace_all":{"type":"boolean","default":false}},"required":["path","old_string","new_string"]}}
{"name":"web_fetch","description":"Fetch a URL and return the body as text.","parameters":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"timeout":{"type":"integer","default":20},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}}

You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. Use the exact parameter names from the schemas.<｜User｜>find TODO comments<｜Assistant｜></think>

<｜DSML｜tool_calls>
<｜DSML｜invoke name="grep">
<｜DSML｜parameter name="pattern" string="true">TODO</｜DSML｜parameter>
<｜DSML｜parameter name="path" string="true">.</｜DSML｜parameter>
</｜DSML｜invoke>
</｜DSML｜tool_calls><｜end▁of▁sentence｜><｜User｜><tool_result>ds4_server.c:842:    // TODO: revisit when streaming usage is finalized
</tool_result><｜Assistant｜></think>Done. Output above.<｜end▁of▁sentence｜>


[System]
You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

[User] find TODO comments

[Tool] ds4_server.c:842:    // TODO: revisit when streaming usage is finalized

[Assistant] Done. Output above.

<｜begin▁of▁sentence｜>You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

## Tools

You have access to a set of tools to help answer the user question. You can invoke tools by writing a "<｜DSML｜tool_calls>" block like the following:

<｜DSML｜tool_calls>
<｜DSML｜invoke name="$TOOL_NAME">
<｜DSML｜parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</｜DSML｜parameter>
...
</｜DSML｜invoke>
<｜DSML｜invoke name="$TOOL_NAME2">
...
</｜DSML｜invoke>
</｜DSML｜tool_calls>

String parameters should be specified as raw text and set `string="true"`. Preserve characters such as `>`, `&`, and `&&` exactly; never replace normal string characters with XML or HTML entity escapes. Only if a string value itself contains the exact closing parameter tag `</｜DSML｜parameter>`, write that tag as `</｜DSML｜parameter>` inside the value. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`.

If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.

Otherwise, output directly after </think> with tool calls or final response.

### Available Tool Schemas

{"name":"bash","description":"Run a shell command in the workspace.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The command line to execute."},"description":{"type":"string","description":"Short description of intent."},"timeout":{"type":"integer","description":"Timeout in seconds.","default":30}},"required":["command"]}}
{"name":"read_file","description":"Read a region of a file from the workspace.","parameters":{"type":"object","properties":{"path":{"type":"string"},"start":{"type":"integer","default":1},"lines":{"type":"integer","default":200}},"required":["path"]}}
{"name":"grep","description":"Search files for a regex pattern.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"path":{"type":"string","default":"."},"glob":{"type":"string","description":"Filename glob filter."},"ignore_case":{"type":"boolean","default":false}},"required":["pattern"]}}
{"name":"list_files","description":"List files matching a glob pattern, depth-limited.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"max_depth":{"type":"integer","default":3}},"required":["pattern"]}}
{"name":"edit","description":"Apply a small old/new text edit to a file.","parameters":{"type":"object","properties":{"path":{"type":"string"},"old_string":{"type":"string"},"new_string":{"type":"string"},"line_number":{"type":"integer","description":"Disambiguate when old_string occurs more than once."},"replace_all":{"type":"boolean","default":false}},"required":["path","old_string","new_string"]}}
{"name":"web_fetch","description":"Fetch a URL and return the body as text.","parameters":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"timeout":{"type":"integer","default":20},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}}

You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. Use the exact parameter names from the schemas.<｜User｜>find TODO comments<｜Assistant｜><think>Direct call; the answer is in the tool output.</think>

<｜DSML｜tool_calls>
<｜DSML｜invoke name="grep">
<｜DSML｜parameter name="pattern" string="true">TODO</｜DSML｜parameter>
<｜DSML｜parameter name="path" string="true">.</｜DSML｜parameter>
</｜DSML｜invoke>
</｜DSML｜tool_calls><｜end▁of▁sentence｜><｜User｜><tool_result>ds4_server.c:842:    // TODO: revisit when streaming usage is finalized
</tool_result><｜Assistant｜><think></think>Done. Output above.<｜end▁of▁sentence｜>


[System]
You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

[User] list .metal kernels

[Tool]
metal/dsv4_hc.metal
metal/moe.metal
metal/sampling.metal

[Assistant] Done. Output above.

<｜begin▁of▁sentence｜>You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

## Tools

You have access to a set of tools to help answer the user question. You can invoke tools by writing a "<｜DSML｜tool_calls>" block like the following:

<｜DSML｜tool_calls>
<｜DSML｜invoke name="$TOOL_NAME">
<｜DSML｜parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</｜DSML｜parameter>
...
</｜DSML｜invoke>
<｜DSML｜invoke name="$TOOL_NAME2">
...
</｜DSML｜invoke>
</｜DSML｜tool_calls>

String parameters should be specified as raw text and set `string="true"`. Preserve characters such as `>`, `&`, and `&&` exactly; never replace normal string characters with XML or HTML entity escapes. Only if a string value itself contains the exact closing parameter tag `</｜DSML｜parameter>`, write that tag as `</｜DSML｜parameter>` inside the value. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`.

If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.

Otherwise, output directly after </think> with tool calls or final response.

### Available Tool Schemas

{"name":"bash","description":"Run a shell command in the workspace.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The command line to execute."},"description":{"type":"string","description":"Short description of intent."},"timeout":{"type":"integer","description":"Timeout in seconds.","default":30}},"required":["command"]}}
{"name":"read_file","description":"Read a region of a file from the workspace.","parameters":{"type":"object","properties":{"path":{"type":"string"},"start":{"type":"integer","default":1},"lines":{"type":"integer","default":200}},"required":["path"]}}
{"name":"grep","description":"Search files for a regex pattern.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"path":{"type":"string","default":"."},"glob":{"type":"string","description":"Filename glob filter."},"ignore_case":{"type":"boolean","default":false}},"required":["pattern"]}}
{"name":"list_files","description":"List files matching a glob pattern, depth-limited.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"max_depth":{"type":"integer","default":3}},"required":["pattern"]}}
{"name":"edit","description":"Apply a small old/new text edit to a file.","parameters":{"type":"object","properties":{"path":{"type":"string"},"old_string":{"type":"string"},"new_string":{"type":"string"},"line_number":{"type":"integer","description":"Disambiguate when old_string occurs more than once."},"replace_all":{"type":"boolean","default":false}},"required":["path","old_string","new_string"]}}
{"name":"web_fetch","description":"Fetch a URL and return the body as text.","parameters":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"timeout":{"type":"integer","default":20},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}}

You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. Use the exact parameter names from the schemas.<｜User｜>list .metal kernels<｜Assistant｜></think>

<｜DSML｜tool_calls>
<｜DSML｜invoke name="list_files">
<｜DSML｜parameter name="pattern" string="true">metal/*.metal</｜DSML｜parameter>
<｜DSML｜parameter name="max_depth" string="false">2</｜DSML｜parameter>
</｜DSML｜invoke>
</｜DSML｜tool_calls><｜end▁of▁sentence｜><｜User｜><tool_result>metal/dsv4_hc.metal
metal/moe.metal
metal/sampling.metal
</tool_result><｜Assistant｜></think>Done. Output above.<｜end▁of▁sentence｜>


[System]
You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

[User] list .metal kernels

[Tool]
metal/dsv4_hc.metal
metal/moe.metal
metal/sampling.metal

[Assistant] Done. Output above.

<｜begin▁of▁sentence｜>You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

## Tools

You have access to a set of tools to help answer the user question. You can invoke tools by writing a "<｜DSML｜tool_calls>" block like the following:

<｜DSML｜tool_calls>
<｜DSML｜invoke name="$TOOL_NAME">
<｜DSML｜parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</｜DSML｜parameter>
...
</｜DSML｜invoke>
<｜DSML｜invoke name="$TOOL_NAME2">
...
</｜DSML｜invoke>
</｜DSML｜tool_calls>

String parameters should be specified as raw text and set `string="true"`. Preserve characters such as `>`, `&`, and `&&` exactly; never replace normal string characters with XML or HTML entity escapes. Only if a string value itself contains the exact closing parameter tag `</｜DSML｜parameter>`, write that tag as `</｜DSML｜parameter>` inside the value. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`.

If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.

Otherwise, output directly after </think> with tool calls or final response.

### Available Tool Schemas

{"name":"bash","description":"Run a shell command in the workspace.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The command line to execute."},"description":{"type":"string","description":"Short description of intent."},"timeout":{"type":"integer","description":"Timeout in seconds.","default":30}},"required":["command"]}}
{"name":"read_file","description":"Read a region of a file from the workspace.","parameters":{"type":"object","properties":{"path":{"type":"string"},"start":{"type":"integer","default":1},"lines":{"type":"integer","default":200}},"required":["path"]}}
{"name":"grep","description":"Search files for a regex pattern.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"path":{"type":"string","default":"."},"glob":{"type":"string","description":"Filename glob filter."},"ignore_case":{"type":"boolean","default":false}},"required":["pattern"]}}
{"name":"list_files","description":"List files matching a glob pattern, depth-limited.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"max_depth":{"type":"integer","default":3}},"required":["pattern"]}}
{"name":"edit","description":"Apply a small old/new text edit to a file.","parameters":{"type":"object","properties":{"path":{"type":"string"},"old_string":{"type":"string"},"new_string":{"type":"string"},"line_number":{"type":"integer","description":"Disambiguate when old_string occurs more than once."},"replace_all":{"type":"boolean","default":false}},"required":["path","old_string","new_string"]}}
{"name":"web_fetch","description":"Fetch a URL and return the body as text.","parameters":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"timeout":{"type":"integer","default":20},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}}

You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. Use the exact parameter names from the schemas.<｜User｜>list .metal kernels<｜Assistant｜><think>Direct call; the answer is in the tool output.</think>

<｜DSML｜tool_calls>
<｜DSML｜invoke name="list_files">
<｜DSML｜parameter name="pattern" string="true">metal/*.metal</｜DSML｜parameter>
<｜DSML｜parameter name="max_depth" string="false">2</｜DSML｜parameter>
</｜DSML｜invoke>
</｜DSML｜tool_calls><｜end▁of▁sentence｜><｜User｜><tool_result>metal/dsv4_hc.metal
metal/moe.metal
metal/sampling.metal
</tool_result><｜Assistant｜><think></think>Done. Output above.<｜end▁of▁sentence｜>


[System]
You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

[User] open Makefile

[Tool]
CC ?= cc
CFLAGS ?= -O3 -ffast-math ...

[Assistant] Done. Output above.

<｜begin▁of▁sentence｜>You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

## Tools

You have access to a set of tools to help answer the user question. You can invoke tools by writing a "<｜DSML｜tool_calls>" block like the following:

<｜DSML｜tool_calls>
<｜DSML｜invoke name="$TOOL_NAME">
<｜DSML｜parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</｜DSML｜parameter>
...
</｜DSML｜invoke>
<｜DSML｜invoke name="$TOOL_NAME2">
...
</｜DSML｜invoke>
</｜DSML｜tool_calls>

String parameters should be specified as raw text and set `string="true"`. Preserve characters such as `>`, `&`, and `&&` exactly; never replace normal string characters with XML or HTML entity escapes. Only if a string value itself contains the exact closing parameter tag `</｜DSML｜parameter>`, write that tag as `</｜DSML｜parameter>` inside the value. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`.

If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.

Otherwise, output directly after </think> with tool calls or final response.

### Available Tool Schemas

{"name":"bash","description":"Run a shell command in the workspace.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The command line to execute."},"description":{"type":"string","description":"Short description of intent."},"timeout":{"type":"integer","description":"Timeout in seconds.","default":30}},"required":["command"]}}
{"name":"read_file","description":"Read a region of a file from the workspace.","parameters":{"type":"object","properties":{"path":{"type":"string"},"start":{"type":"integer","default":1},"lines":{"type":"integer","default":200}},"required":["path"]}}
{"name":"grep","description":"Search files for a regex pattern.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"path":{"type":"string","default":"."},"glob":{"type":"string","description":"Filename glob filter."},"ignore_case":{"type":"boolean","default":false}},"required":["pattern"]}}
{"name":"list_files","description":"List files matching a glob pattern, depth-limited.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"max_depth":{"type":"integer","default":3}},"required":["pattern"]}}
{"name":"edit","description":"Apply a small old/new text edit to a file.","parameters":{"type":"object","properties":{"path":{"type":"string"},"old_string":{"type":"string"},"new_string":{"type":"string"},"line_number":{"type":"integer","description":"Disambiguate when old_string occurs more than once."},"replace_all":{"type":"boolean","default":false}},"required":["path","old_string","new_string"]}}
{"name":"web_fetch","description":"Fetch a URL and return the body as text.","parameters":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"timeout":{"type":"integer","default":20},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}}

You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. Use the exact parameter names from the schemas.<｜User｜>open Makefile<｜Assistant｜></think>

<｜DSML｜tool_calls>
<｜DSML｜invoke name="read_file">
<｜DSML｜parameter name="path" string="true">Makefile</｜DSML｜parameter>
<｜DSML｜parameter name="start" string="false">1</｜DSML｜parameter>
<｜DSML｜parameter name="lines" string="false">40</｜DSML｜parameter>
</｜DSML｜invoke>
</｜DSML｜tool_calls><｜end▁of▁sentence｜><｜User｜><tool_result>CC ?= cc
CFLAGS ?= -O3 -ffast-math ...
</tool_result><｜Assistant｜></think>Done. Output above.<｜end▁of▁sentence｜>


[System]
You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

[User] open Makefile

[Tool]
CC ?= cc
CFLAGS ?= -O3 -ffast-math ...

[Assistant] Done. Output above.

<｜begin▁of▁sentence｜>You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

## Tools

You have access to a set of tools to help answer the user question. You can invoke tools by writing a "<｜DSML｜tool_calls>" block like the following:

<｜DSML｜tool_calls>
<｜DSML｜invoke name="$TOOL_NAME">
<｜DSML｜parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</｜DSML｜parameter>
...
</｜DSML｜invoke>
<｜DSML｜invoke name="$TOOL_NAME2">
...
</｜DSML｜invoke>
</｜DSML｜tool_calls>

String parameters should be specified as raw text and set `string="true"`. Preserve characters such as `>`, `&`, and `&&` exactly; never replace normal string characters with XML or HTML entity escapes. Only if a string value itself contains the exact closing parameter tag `</｜DSML｜parameter>`, write that tag as `</｜DSML｜parameter>` inside the value. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`.

If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.

Otherwise, output directly after </think> with tool calls or final response.

### Available Tool Schemas

{"name":"bash","description":"Run a shell command in the workspace.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The command line to execute."},"description":{"type":"string","description":"Short description of intent."},"timeout":{"type":"integer","description":"Timeout in seconds.","default":30}},"required":["command"]}}
{"name":"read_file","description":"Read a region of a file from the workspace.","parameters":{"type":"object","properties":{"path":{"type":"string"},"start":{"type":"integer","default":1},"lines":{"type":"integer","default":200}},"required":["path"]}}
{"name":"grep","description":"Search files for a regex pattern.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"path":{"type":"string","default":"."},"glob":{"type":"string","description":"Filename glob filter."},"ignore_case":{"type":"boolean","default":false}},"required":["pattern"]}}
{"name":"list_files","description":"List files matching a glob pattern, depth-limited.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"max_depth":{"type":"integer","default":3}},"required":["pattern"]}}
{"name":"edit","description":"Apply a small old/new text edit to a file.","parameters":{"type":"object","properties":{"path":{"type":"string"},"old_string":{"type":"string"},"new_string":{"type":"string"},"line_number":{"type":"integer","description":"Disambiguate when old_string occurs more than once."},"replace_all":{"type":"boolean","default":false}},"required":["path","old_string","new_string"]}}
{"name":"web_fetch","description":"Fetch a URL and return the body as text.","parameters":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"timeout":{"type":"integer","default":20},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}}

You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. Use the exact parameter names from the schemas.<｜User｜>open Makefile<｜Assistant｜><think>Direct call; the answer is in the tool output.</think>

<｜DSML｜tool_calls>
<｜DSML｜invoke name="read_file">
<｜DSML｜parameter name="path" string="true">Makefile</｜DSML｜parameter>
<｜DSML｜parameter name="start" string="false">1</｜DSML｜parameter>
<｜DSML｜parameter name="lines" string="false">40</｜DSML｜parameter>
</｜DSML｜invoke>
</｜DSML｜tool_calls><｜end▁of▁sentence｜><｜User｜><tool_result>CC ?= cc
CFLAGS ?= -O3 -ffast-math ...
</tool_result><｜Assistant｜><think></think>Done. Output above.<｜end▁of▁sentence｜>


[System]
You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

[User] fix typo in README

[Tool] edit applied: 1 occurrence replaced

[Assistant] Done. Output above.

<｜begin▁of▁sentence｜>You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

## Tools

You have access to a set of tools to help answer the user question. You can invoke tools by writing a "<｜DSML｜tool_calls>" block like the following:

<｜DSML｜tool_calls>
<｜DSML｜invoke name="$TOOL_NAME">
<｜DSML｜parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</｜DSML｜parameter>
...
</｜DSML｜invoke>
<｜DSML｜invoke name="$TOOL_NAME2">
...
</｜DSML｜invoke>
</｜DSML｜tool_calls>

String parameters should be specified as raw text and set `string="true"`. Preserve characters such as `>`, `&`, and `&&` exactly; never replace normal string characters with XML or HTML entity escapes. Only if a string value itself contains the exact closing parameter tag `</｜DSML｜parameter>`, write that tag as `</｜DSML｜parameter>` inside the value. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`.

If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.

Otherwise, output directly after </think> with tool calls or final response.

### Available Tool Schemas

{"name":"bash","description":"Run a shell command in the workspace.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The command line to execute."},"description":{"type":"string","description":"Short description of intent."},"timeout":{"type":"integer","description":"Timeout in seconds.","default":30}},"required":["command"]}}
{"name":"read_file","description":"Read a region of a file from the workspace.","parameters":{"type":"object","properties":{"path":{"type":"string"},"start":{"type":"integer","default":1},"lines":{"type":"integer","default":200}},"required":["path"]}}
{"name":"grep","description":"Search files for a regex pattern.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"path":{"type":"string","default":"."},"glob":{"type":"string","description":"Filename glob filter."},"ignore_case":{"type":"boolean","default":false}},"required":["pattern"]}}
{"name":"list_files","description":"List files matching a glob pattern, depth-limited.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"max_depth":{"type":"integer","default":3}},"required":["pattern"]}}
{"name":"edit","description":"Apply a small old/new text edit to a file.","parameters":{"type":"object","properties":{"path":{"type":"string"},"old_string":{"type":"string"},"new_string":{"type":"string"},"line_number":{"type":"integer","description":"Disambiguate when old_string occurs more than once."},"replace_all":{"type":"boolean","default":false}},"required":["path","old_string","new_string"]}}
{"name":"web_fetch","description":"Fetch a URL and return the body as text.","parameters":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"timeout":{"type":"integer","default":20},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}}

You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. Use the exact parameter names from the schemas.<｜User｜>fix typo in README<｜Assistant｜></think>

<｜DSML｜tool_calls>
<｜DSML｜invoke name="edit">
<｜DSML｜parameter name="path" string="true">README.md</｜DSML｜parameter>
<｜DSML｜parameter name="old_string" string="true">DrawfStar</｜DSML｜parameter>
<｜DSML｜parameter name="new_string" string="true">DwarfStar</｜DSML｜parameter>
</｜DSML｜invoke>
</｜DSML｜tool_calls><｜end▁of▁sentence｜><｜User｜><tool_result>edit applied: 1 occurrence replaced
</tool_result><｜Assistant｜></think>Done. Output above.<｜end▁of▁sentence｜>


[System]
You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

[User] fix typo in README

[Tool] edit applied: 1 occurrence replaced

[Assistant] Done. Output above.

<｜begin▁of▁sentence｜>You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

## Tools

You have access to a set of tools to help answer the user question. You can invoke tools by writing a "<｜DSML｜tool_calls>" block like the following:

<｜DSML｜tool_calls>
<｜DSML｜invoke name="$TOOL_NAME">
<｜DSML｜parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</｜DSML｜parameter>
...
</｜DSML｜invoke>
<｜DSML｜invoke name="$TOOL_NAME2">
...
</｜DSML｜invoke>
</｜DSML｜tool_calls>

String parameters should be specified as raw text and set `string="true"`. Preserve characters such as `>`, `&`, and `&&` exactly; never replace normal string characters with XML or HTML entity escapes. Only if a string value itself contains the exact closing parameter tag `</｜DSML｜parameter>`, write that tag as `</｜DSML｜parameter>` inside the value. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`.

If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.

Otherwise, output directly after </think> with tool calls or final response.

### Available Tool Schemas

{"name":"bash","description":"Run a shell command in the workspace.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The command line to execute."},"description":{"type":"string","description":"Short description of intent."},"timeout":{"type":"integer","description":"Timeout in seconds.","default":30}},"required":["command"]}}
{"name":"read_file","description":"Read a region of a file from the workspace.","parameters":{"type":"object","properties":{"path":{"type":"string"},"start":{"type":"integer","default":1},"lines":{"type":"integer","default":200}},"required":["path"]}}
{"name":"grep","description":"Search files for a regex pattern.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"path":{"type":"string","default":"."},"glob":{"type":"string","description":"Filename glob filter."},"ignore_case":{"type":"boolean","default":false}},"required":["pattern"]}}
{"name":"list_files","description":"List files matching a glob pattern, depth-limited.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"max_depth":{"type":"integer","default":3}},"required":["pattern"]}}
{"name":"edit","description":"Apply a small old/new text edit to a file.","parameters":{"type":"object","properties":{"path":{"type":"string"},"old_string":{"type":"string"},"new_string":{"type":"string"},"line_number":{"type":"integer","description":"Disambiguate when old_string occurs more than once."},"replace_all":{"type":"boolean","default":false}},"required":["path","old_string","new_string"]}}
{"name":"web_fetch","description":"Fetch a URL and return the body as text.","parameters":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"timeout":{"type":"integer","default":20},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}}

You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. Use the exact parameter names from the schemas.<｜User｜>fix typo in README<｜Assistant｜><think>Direct call; the answer is in the tool output.</think>

<｜DSML｜tool_calls>
<｜DSML｜invoke name="edit">
<｜DSML｜parameter name="path" string="true">README.md</｜DSML｜parameter>
<｜DSML｜parameter name="old_string" string="true">DrawfStar</｜DSML｜parameter>
<｜DSML｜parameter name="new_string" string="true">DwarfStar</｜DSML｜parameter>
</｜DSML｜invoke>
</｜DSML｜tool_calls><｜end▁of▁sentence｜><｜User｜><tool_result>edit applied: 1 occurrence replaced
</tool_result><｜Assistant｜><think></think>Done. Output above.<｜end▁of▁sentence｜>


[System]
You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

[User] note that streaming is on

[Tool] todo updated: 2 open, 0 done

[Assistant] Done. Output above.

<｜begin▁of▁sentence｜>You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

## Tools

You have access to a set of tools to help answer the user question. You can invoke tools by writing a "<｜DSML｜tool_calls>" block like the following:

<｜DSML｜tool_calls>
<｜DSML｜invoke name="$TOOL_NAME">
<｜DSML｜parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</｜DSML｜parameter>
...
</｜DSML｜invoke>
<｜DSML｜invoke name="$TOOL_NAME2">
...
</｜DSML｜invoke>
</｜DSML｜tool_calls>

String parameters should be specified as raw text and set `string="true"`. Preserve characters such as `>`, `&`, and `&&` exactly; never replace normal string characters with XML or HTML entity escapes. Only if a string value itself contains the exact closing parameter tag `</｜DSML｜parameter>`, write that tag as `</｜DSML｜parameter>` inside the value. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`.

If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.

Otherwise, output directly after </think> with tool calls or final response.

### Available Tool Schemas

{"name":"bash","description":"Run a shell command in the workspace.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The command line to execute."},"description":{"type":"string","description":"Short description of intent."},"timeout":{"type":"integer","description":"Timeout in seconds.","default":30}},"required":["command"]}}
{"name":"read_file","description":"Read a region of a file from the workspace.","parameters":{"type":"object","properties":{"path":{"type":"string"},"start":{"type":"integer","default":1},"lines":{"type":"integer","default":200}},"required":["path"]}}
{"name":"grep","description":"Search files for a regex pattern.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"path":{"type":"string","default":"."},"glob":{"type":"string","description":"Filename glob filter."},"ignore_case":{"type":"boolean","default":false}},"required":["pattern"]}}
{"name":"list_files","description":"List files matching a glob pattern, depth-limited.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"max_depth":{"type":"integer","default":3}},"required":["pattern"]}}
{"name":"edit","description":"Apply a small old/new text edit to a file.","parameters":{"type":"object","properties":{"path":{"type":"string"},"old_string":{"type":"string"},"new_string":{"type":"string"},"line_number":{"type":"integer","description":"Disambiguate when old_string occurs more than once."},"replace_all":{"type":"boolean","default":false}},"required":["path","old_string","new_string"]}}
{"name":"web_fetch","description":"Fetch a URL and return the body as text.","parameters":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"timeout":{"type":"integer","default":20},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}}

You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. Use the exact parameter names from the schemas.<｜User｜>note that streaming is on<｜Assistant｜></think>

<｜DSML｜tool_calls>
<｜DSML｜invoke name="todo">
<｜DSML｜parameter name="items" string="false">["validate streaming","add backpressure test"]</｜DSML｜parameter>
</｜DSML｜invoke>
</｜DSML｜tool_calls><｜end▁of▁sentence｜><｜User｜><tool_result>todo updated: 2 open, 0 done
</tool_result><｜Assistant｜></think>Done. Output above.<｜end▁of▁sentence｜>


[System]
You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

[User] note that streaming is on

[Tool] todo updated: 2 open, 0 done

[Assistant] Done. Output above.

<｜begin▁of▁sentence｜>You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

## Tools

You have access to a set of tools to help answer the user question. You can invoke tools by writing a "<｜DSML｜tool_calls>" block like the following:

<｜DSML｜tool_calls>
<｜DSML｜invoke name="$TOOL_NAME">
<｜DSML｜parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</｜DSML｜parameter>
...
</｜DSML｜invoke>
<｜DSML｜invoke name="$TOOL_NAME2">
...
</｜DSML｜invoke>
</｜DSML｜tool_calls>

String parameters should be specified as raw text and set `string="true"`. Preserve characters such as `>`, `&`, and `&&` exactly; never replace normal string characters with XML or HTML entity escapes. Only if a string value itself contains the exact closing parameter tag `</｜DSML｜parameter>`, write that tag as `</｜DSML｜parameter>` inside the value. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`.

If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.

Otherwise, output directly after </think> with tool calls or final response.

### Available Tool Schemas

{"name":"bash","description":"Run a shell command in the workspace.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The command line to execute."},"description":{"type":"string","description":"Short description of intent."},"timeout":{"type":"integer","description":"Timeout in seconds.","default":30}},"required":["command"]}}
{"name":"read_file","description":"Read a region of a file from the workspace.","parameters":{"type":"object","properties":{"path":{"type":"string"},"start":{"type":"integer","default":1},"lines":{"type":"integer","default":200}},"required":["path"]}}
{"name":"grep","description":"Search files for a regex pattern.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"path":{"type":"string","default":"."},"glob":{"type":"string","description":"Filename glob filter."},"ignore_case":{"type":"boolean","default":false}},"required":["pattern"]}}
{"name":"list_files","description":"List files matching a glob pattern, depth-limited.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"max_depth":{"type":"integer","default":3}},"required":["pattern"]}}
{"name":"edit","description":"Apply a small old/new text edit to a file.","parameters":{"type":"object","properties":{"path":{"type":"string"},"old_string":{"type":"string"},"new_string":{"type":"string"},"line_number":{"type":"integer","description":"Disambiguate when old_string occurs more than once."},"replace_all":{"type":"boolean","default":false}},"required":["path","old_string","new_string"]}}
{"name":"web_fetch","description":"Fetch a URL and return the body as text.","parameters":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"timeout":{"type":"integer","default":20},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}}

You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. Use the exact parameter names from the schemas.<｜User｜>note that streaming is on<｜Assistant｜><think>Direct call; the answer is in the tool output.</think>

<｜DSML｜tool_calls>
<｜DSML｜invoke name="todo">
<｜DSML｜parameter name="items" string="false">["validate streaming","add backpressure test"]</｜DSML｜parameter>
</｜DSML｜invoke>
</｜DSML｜tool_calls><｜end▁of▁sentence｜><｜User｜><tool_result>todo updated: 2 open, 0 done
</tool_result><｜Assistant｜><think></think>Done. Output above.<｜end▁of▁sentence｜>


[System]
You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

[User] record decision about quant width

[Tool] noted

[Assistant] Done. Output above.

<｜begin▁of▁sentence｜>You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

## Tools

You have access to a set of tools to help answer the user question. You can invoke tools by writing a "<｜DSML｜tool_calls>" block like the following:

<｜DSML｜tool_calls>
<｜DSML｜invoke name="$TOOL_NAME">
<｜DSML｜parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</｜DSML｜parameter>
...
</｜DSML｜invoke>
<｜DSML｜invoke name="$TOOL_NAME2">
...
</｜DSML｜invoke>
</｜DSML｜tool_calls>

String parameters should be specified as raw text and set `string="true"`. Preserve characters such as `>`, `&`, and `&&` exactly; never replace normal string characters with XML or HTML entity escapes. Only if a string value itself contains the exact closing parameter tag `</｜DSML｜parameter>`, write that tag as `</｜DSML｜parameter>` inside the value. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`.

If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.

Otherwise, output directly after </think> with tool calls or final response.

### Available Tool Schemas

{"name":"bash","description":"Run a shell command in the workspace.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The command line to execute."},"description":{"type":"string","description":"Short description of intent."},"timeout":{"type":"integer","description":"Timeout in seconds.","default":30}},"required":["command"]}}
{"name":"read_file","description":"Read a region of a file from the workspace.","parameters":{"type":"object","properties":{"path":{"type":"string"},"start":{"type":"integer","default":1},"lines":{"type":"integer","default":200}},"required":["path"]}}
{"name":"grep","description":"Search files for a regex pattern.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"path":{"type":"string","default":"."},"glob":{"type":"string","description":"Filename glob filter."},"ignore_case":{"type":"boolean","default":false}},"required":["pattern"]}}
{"name":"list_files","description":"List files matching a glob pattern, depth-limited.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"max_depth":{"type":"integer","default":3}},"required":["pattern"]}}
{"name":"edit","description":"Apply a small old/new text edit to a file.","parameters":{"type":"object","properties":{"path":{"type":"string"},"old_string":{"type":"string"},"new_string":{"type":"string"},"line_number":{"type":"integer","description":"Disambiguate when old_string occurs more than once."},"replace_all":{"type":"boolean","default":false}},"required":["path","old_string","new_string"]}}
{"name":"web_fetch","description":"Fetch a URL and return the body as text.","parameters":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"timeout":{"type":"integer","default":20},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}}

You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. Use the exact parameter names from the schemas.<｜User｜>record decision about quant width<｜Assistant｜></think>

<｜DSML｜tool_calls>
<｜DSML｜invoke name="think">
<｜DSML｜parameter name="note" string="true">stay at IQ2_XXS for routed gate/up; bump scratch buffers to fp16</｜DSML｜parameter>
</｜DSML｜invoke>
</｜DSML｜tool_calls><｜end▁of▁sentence｜><｜User｜><tool_result>noted
</tool_result><｜Assistant｜></think>Done. Output above.<｜end▁of▁sentence｜>


[System]
You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

[User] record decision about quant width

[Tool] noted

[Assistant] Done. Output above.

<｜begin▁of▁sentence｜>You are Swival, a coding agent with a friendly, human-like personality. You solve tasks autonomously using the tools provided, taking the optimal decisions at every step. Keep going until the task is fully complete. Do not call tools for simple math, greetings, or unclear standalone questions. For minor ambiguity, pick the most likely intent and briefly state your choice.

## Workflow

- Use tools only when needed; answer plain questions directly.
- Explore before editing: outline, list_files, grep, then read_file.
- Use think before multi-step coding tasks, debugging, choosing alternatives, and editing code.
- Use todo for multi-step work and mark items done as you finish.
- One logical change at a time. Do not re-read files after editing.
- On tool errors, use think to diagnose before retrying.

## Editing

- Copy old_string verbatim from read_file.
- For multiple matches, pass line_number. Use replace_all only when every occurrence should change.

## Safety

- Never print secrets to the console.
- Do not take any action that could degrade the workspace.

## Tools

You have access to a set of tools to help answer the user question. You can invoke tools by writing a "<｜DSML｜tool_calls>" block like the following:

<｜DSML｜tool_calls>
<｜DSML｜invoke name="$TOOL_NAME">
<｜DSML｜parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE</｜DSML｜parameter>
...
</｜DSML｜invoke>
<｜DSML｜invoke name="$TOOL_NAME2">
...
</｜DSML｜invoke>
</｜DSML｜tool_calls>

String parameters should be specified as raw text and set `string="true"`. Preserve characters such as `>`, `&`, and `&&` exactly; never replace normal string characters with XML or HTML entity escapes. Only if a string value itself contains the exact closing parameter tag `</｜DSML｜parameter>`, write that tag as `</｜DSML｜parameter>` inside the value. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`.

If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.

Otherwise, output directly after </think> with tool calls or final response.

### Available Tool Schemas

{"name":"bash","description":"Run a shell command in the workspace.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The command line to execute."},"description":{"type":"string","description":"Short description of intent."},"timeout":{"type":"integer","description":"Timeout in seconds.","default":30}},"required":["command"]}}
{"name":"read_file","description":"Read a region of a file from the workspace.","parameters":{"type":"object","properties":{"path":{"type":"string"},"start":{"type":"integer","default":1},"lines":{"type":"integer","default":200}},"required":["path"]}}
{"name":"grep","description":"Search files for a regex pattern.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"path":{"type":"string","default":"."},"glob":{"type":"string","description":"Filename glob filter."},"ignore_case":{"type":"boolean","default":false}},"required":["pattern"]}}
{"name":"list_files","description":"List files matching a glob pattern, depth-limited.","parameters":{"type":"object","properties":{"pattern":{"type":"string"},"max_depth":{"type":"integer","default":3}},"required":["pattern"]}}
{"name":"edit","description":"Apply a small old/new text edit to a file.","parameters":{"type":"object","properties":{"path":{"type":"string"},"old_string":{"type":"string"},"new_string":{"type":"string"},"line_number":{"type":"integer","description":"Disambiguate when old_string occurs more than once."},"replace_all":{"type":"boolean","default":false}},"required":["path","old_string","new_string"]}}
{"name":"web_fetch","description":"Fetch a URL and return the body as text.","parameters":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"timeout":{"type":"integer","default":20},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}}

You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. Use the exact parameter names from the schemas.<｜User｜>record decision about quant width<｜Assistant｜><think>Direct call; the answer is in the tool output.</think>

<｜DSML｜tool_calls>
<｜DSML｜invoke name="think">
<｜DSML｜parameter name="note" string="true">stay at IQ2_XXS for routed gate/up; bump scratch buffers to fp16</｜DSML｜parameter>
</｜DSML｜invoke>
</｜DSML｜tool_calls><｜end▁of▁sentence｜><｜User｜><tool_result>noted
</tool_result><｜Assistant｜><think></think>Done. Output above.<｜end▁of▁sentence｜>