코딩 에이전트의 5턴 vs command_run 1회: 전체 예제
안녕하세요. 오픈소스 Tura를 유지보수하고 있습니다.
코딩 에이전트를 만드는 분들이 바로 이해할 수 있는 간단한 예제입니다.
보통 agent는 아래 작업을 5번의 LLM 턴으로 처리합니다.
Turn 1 — 확인
rg -n "TODO|command_run|handler" crates/
rg --files crates/runtime/src crates/tools/src
Turn 2 — 패치 적용
- // old command handler logic
+ // patched command handler logic
Turn 3 — 빌드
cargo build -p runtime
Turn 4 — 테스트
cargo test -p runtime --lib
Turn 5 — lint
cargo clippy -p runtime --all-targets
명령 자체보다 큰 오버헤드는 모델을 5번 깨우고, 길어진 대화 기록을 매번 다시 보내는 부분입니다.
Tura는 command_run이라는 Macro 도구 하나로 같은 작업 흐름을 한 번에 보냅니다.
{
"name": "command_run",
"arguments": {
"commands": [
{ "step": 1, "command_type": "shell_command", "command_line": "rg -n \"TODO|command_run|handler\" crates/" },
{ "step": 1, "command_type": "shell_command", "command_line": "rg --files crates/runtime/src crates/tools/src" },
{ "step": 2, "command_type": "apply_patch", "command_line": "*** Begin Patch\n*** Update File: crates/tools/src/command_run/handler.rs\n@@\n- // old command handler logic\n+ // patched command handler logic\n*** End Patch" },
{ "step": 3, "command_type": "shell_command", "command_line": "cargo build -p runtime" },
{ "step": 4, "command_type": "shell_command", "command_line": "cargo test -p runtime --lib" },
{ "step": 4, "command_type": "shell_command", "command_line": "cargo clippy -p runtime --all-targets" }
]
}
}
빌드, 테스트, lint를 생략하는 것이 아닙니다. 예측 가능한 단계 사이에서 LLM을 다시 호출하지 않는 것입니다.
전체 DeepSWE 비교에서 Balanced는 Codex CLI보다 턴을 35.8%, 토큰을 31.1% 적게 사용했습니다. Direct는 턴을 69.1%, 토큰을 77.5% 적게 사용했습니다. 약 80% 절감은 이 benchmark의 결과이며 모든 작업에 대한 보장은 아닙니다.
GitHub: https://github.com/Tura-AI/tura
Benchmark: https://turaai.net/benchmark