[Feature]: Add Programmatic Tool Calling (PTC) mode
Version line
2.x — Reasonix Studio, studio branch (active development)
What problem does this solve?
reasonix currently exposes its tools directly to the model as individual tool definitions. the agent loop then executes the generated tool calls and feeds their results back into the conversation before continuing.
this works well for simple tool usage, but it becomes increasingly expensive and context-heavy for workflows that require multiple dependent or repetitive tool calls.
for example, a task such as:
- search several files;
- filter the results;
- read the matching files;
- extract information from them;
- run another tool for each result;
- aggregate the outputs;
can require many model/tool round trips. each intermediate result becomes part of the conversation context, increasing latency, token usage, and potentially reducing prefix-cache efficiency.
deepseek's own harness dsh has introduced Programmatic Tool Calling (PTC) for this class of workload: instead of exposing every tool as a model-facing function, the harness exposes a code execution entry point plus a generated SDK. the model can then write a small program that orchestrates multiple tool calls inside a single execution.
i think this would fit reasonix well
Proposed solution
add an optional PTC mode to the reasonix harness.
instead of exposing every available tool directly to the model, reasonix could expose a single code-execution tool, with an SDK generated from the tools available in the current session.
for example, the model could generate something conceptually like:
const results = await Promise.all(
files.map(file => tools.read_file({ path: file }))
);
return results.filter(result => result.includes("TODO"));the harness would execute this program and route each SDK call through the existing tool system, returning only the final result to the model. ideally, this should work with both reasonix's built-in tools and MCP tools, while preserving the existing permission, approval, and sandbox mechanisms.
native tool calling should remain available as the default, with PTC being an opt-in alternative for tool-heavy workflows
Source: esengine/DeepSeek-Reasonix