Agent Loop And Tools
Synax uses a bounded model-tool loop:
- Add the user task to the conversation.
- Send model-facing tools to the provider.
- Execute requested tool calls through local guardrails.
- Append compact tool results.
- Stop when the model returns a normal assistant answer or a configured limit is reached.
- Run configured verification for
synax runwhen available.
Tool Surface
The model-facing tool names are intentionally small:
| Tool | Purpose |
|---|---|
read | List files, read a bounded file range, or search text |
edit | Exact replace_in_file edit |
write | Create a new repo-local text file |
git | Show bounded git status or diff |
bash | Hidden unless enabled; disabled by default |
Internally, read and git calls map to more specific tools such as list_files, read_file_range, search_text, show_git_status, and show_git_diff.
Editing Rules
edit uses exact replacement. The file must already have been inspected, and the old string must match exactly once.
write creates new files only. It fails if the target path already exists.
Unsafe paths, generated directories, environment files, and path traversal are rejected by file policy.
Tool-Call Compatibility
Synax sends standard OpenAI-compatible tools with automatic tool choice. It accepts standard message.tool_calls and local-model fallback text blocks such as:
<tool_call>{"name":"read","arguments":{"path":"src/cli.ts"}}</tool_call>This makes Synax usable with local Qwen-style tool-call formats that some Relay-backed models emit.
Loop Limits
Defaults:
[agent]
context_budget_tokens = 131072
max_model_steps = 32
max_tool_calls = 96When the model keeps asking for tools at the final step or exceeds limits, Synax returns a terminal state instead of continuing indefinitely.