v6

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-01485121699.8 KB

Task Diff

Return the diff for a task's working branch against the base ref.

Strategy: 1. Resolve the working branch from the task's assigned_agent -- agent/<session-id>. If no agent is assigned (or the branch does not exist yet), fall back to git diff HEAD so the user still sees uncommitted scratch work. 2. Run git diff <base>...<branch> (three-dot, symmetric difference relative to the merge base) and parse the output into a structured per-file representation. 3. Cap the unified diff at _DIFF_MAX_BYTES to keep payloads sane.

The sync _run_git helper is reused (it is also called from other sync helpers in this module). To keep the event loop responsive under load (issue #1723) every blocking _run_git invocation is offloaded to the default executor via asyncio.to_thread. The helper itself stays sync so non-route callers keep working.

get/dashboard/tasks/{task_id}/diff

Path parameters

task_idstring required

Response

Successful Response

task_idstring required
branchstring nullable required
base_refstring required
head_refstring nullable required
additionsinteger required
deletionsinteger required
unifiedstring required
truncatedboolean
generated_atnumber required
notestring nullable