docs(tarko): agent README documents maxIterations default as 10, code ships 1000

Author: sxh313Created Sep 24, 2026Updated Sep 24, 2026

Observed

multimodal/tarko/agent/README.md:128, in the API Reference → Agent Constructor block, documents:

typescript
  maxIterations?: number;         // Max reasoning loops (default: 10)

The constructor applies a different default (multimodal/tarko/agent/src/agent/agent.ts:90):

typescript
    this.maxIterations = options.maxIterations ?? 1000;

Measured on main at 2ff41a9e with this package's own vitest (3.2.4), constructing the real class from multimodal/tarko/agent/src the way tests/agent/agent-modes.test.ts does:

PROBE maxIterations=1000
PROBE explicit1=1

Expected

The README should state the default the code applies, the way the same block already does for temperature on line 130 (default: 0.7, matching agent.ts:139).

Which side is stale

feat(tarko): adjust maxIterations default to 1000 (#1289, commit 94e890b) changed exactly this value and updated the typed contract in the same step:

  • multimodal/tarko/agent/src/agent/agent.ts — options.maxIterations ?? 10 → ?? 1000
  • multimodal/tarko/agent-interface/src/agent-options.ts — @defaultValue 50 → 1000

Both patches are quoted from that PR's file list, which contains no README at all, so the documented default was left behind. multimodal/CHANGELOG.md:248 records the change. So 1000 is the intended behaviour and the README's 10 is the stale side, not the other way round.

Everywhere else the docs are silent rather than wrong: multimodal/websites/docs/docs/en/api/runtime/agent-api.md:292 and its zh sibling list maxIterations?: number without stating a default, so line 128 is the only place in the repo that gives a reader a number to rely on.

Impact

Someone who sizes their budget from the README gets 100x the loop count they planned for. Each loop is at least one model request plus tool calls, so an agent left on defaults spends a materially larger token and wall-clock budget than the documentation promises, and nothing at runtime points out the discrepancy.

Proposal

One-line documentation correction: default: 10 → default: 1000 on multimodal/tarko/agent/README.md:128, matching the @defaultValue 1000 already in agent-options.ts:158.

Environment

  • Package: @tarko/agent (multimodal/tarko/agent)
  • Branch: main at 2ff41a9e
  • Node 24, pnpm workspace, vitest 3.2.4

Source: bytedance/UI-TARS-desktop