2.1 KiB
2.1 KiB
Agent Execution Policy
Coka MCP long-running work
Use the managed-task tools for builds, tests, package installs, Docker builds, integration tests, migrations, benchmarks, and any command that may take more than a few seconds or emit substantial output.
- Prefer
start_managed_taskoverexec_commandfor long-running work. - Give every managed task a stable, descriptive
taskKeysuch asroot-ci,backend-tests, ordocker-build-api. - Reuse the same
taskKeywhen recovering after a ChatGPT/message-stream interruption. Do not start the same command again merely because the response stream was interrupted. - Before retrying work after an interruption, call
list_managed_tasksorread_managed_taskand inspect the existing task state. - Use
read_managed_taskwith long waits rather than repeatedly polling at short intervals. - Managed-task responses are intentionally compact. Full stdout/stderr is stored in the task log file; inspect only the reported tail/highlights unless deeper diagnostics are required.
- Do not dump full build/test logs into MCP responses. Prefer exit status, important lines, and a bounded tail.
- Group related repository inspection and edits into coherent calls instead of issuing many tiny shell commands.
- Run targeted tests before the full suite. Run the full CI/build once near the end unless a failure requires another run.
- Never re-run an already successful build/test solely to reconstruct conversational context.
Low-level process tools
Use exec_command, read_process, write_stdin, and terminate_process when interactive stdin, exact paged stdout/stderr, or low-level process control is specifically required. They remain the escape hatch, not the default for long-running non-interactive work.
Recovery order
When a response is interrupted:
- Inspect
list_managed_tasks. - Reuse the matching task by
taskKey. - If it is still running, wait with
read_managed_task. - If it finished, consume its existing result and log summary.
- Re-run only when the prior task failed for a reason that requires a retry, or when an explicit fresh run is requested.