One turn through Qwen Code

    architecture node:

    Representation at this boundary

    Source modules

      Loop map

      One pass — prompt → turn budget → loop guard → model resolution → model call → scheduler lifecycle → L3 → L4 → L5 permissions → feedback → recursive re-entry. Every tool call pays the permission cost, even in AUTO mode.
      Recursive, not iterative — there is no processTurn loop. handleCompletedTools calls submitQuery(responses, {isContinuation: true}) with SendMessageType.ToolResult and the turn re-enters at the budget check with boundedTurns - 1.
      Rules are strings, approval is layered — no TOML policy engine: permission rules are plain strings like "Bash(git *)" in settings.json, evaluated deny > ask > allow > default. AUTO mode's fail-closed LLM classifier is the fork's signature addition.