Concept from opencode:
Instead of forcing the LLM to make sequential, multi-turn tool calls, opencode gives the LLM a constrained JS subset runtime (packages/codemode). The LLM can write a small script that loops over data and calls host tools natively inside the sandbox, while strict budgets enforce limits.
How decafclaw could implement this:
decafclaw currently suffers from the overhead of multiple LLM round-trips when performing repetitive tasks (e.g., searching a codebase and reading 5 specific files based on the results).
Proposed Implementation:
- Introduce a restricted execution environment (e.g. a sandboxed Python AST evaluator or embedded Lua runtime) mapped as a specific tool (
execute_script).
- Allow the LLM to write procedural logic (loops, conditionals) that executes locally against
decafclaw's tool registry.
- Establish strict timeout and max-call budgets on the execution runtime.
Concept from opencode:
Instead of forcing the LLM to make sequential, multi-turn tool calls,
opencodegives the LLM a constrained JS subset runtime (packages/codemode). The LLM can write a small script that loops over data and calls host tools natively inside the sandbox, while strict budgets enforce limits.How
decafclawcould implement this:decafclawcurrently suffers from the overhead of multiple LLM round-trips when performing repetitive tasks (e.g., searching a codebase and reading 5 specific files based on the results).Proposed Implementation:
execute_script).decafclaw's tool registry.