Skip to content

Forced resolution on managed-tool max_rounds (don't discard the turn with 0 output) #284

@mostlydev

Description

@mostlydev

Problem

When a managed-tool turn hits max_rounds (clawdapus DefaultToolPolicy = 8; cllama resolveManagedToolPolicy), the turn hard-errors (managed tool max rounds exceeded (N)) and the agent produces no final output — all research gathered across the rounds is discarded.

Observed

On a trading-desk discovery agent (Grok 4.3): the agent researched 18 distinct candidate tickers (get_ticker_news + get_quote) across the rounds, consuming ~1,000,000 prompt tokens, then hit max_rounds and produced 0 durable output (no watchlist/trigger/proposal, no message). The entire run was wasted. Raising max_rounds 8→16 did not help — the model keeps researching without self-terminating, and prompt-level "stop after N, then resolve" instructions are not reliably honored.

Request

On max_rounds exhaustion, instead of hard-erroring, inject a final "tool budget reached — produce your final answer / commit your result now, no more tool calls" turn, so the gathered research becomes durable output. This salvages the work and converts non-terminating research into a usable result for any capped agent.

Secondary

Consider exposing max_rounds / total_timeout_ms as a pod/agent-level knob. They are currently a hardcoded DefaultToolPolicy with no clawdapus config surface, and runtime tools.json edits are clobbered on pod regen.

Companion to #282 (cron output cleanliness).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions