Raise tracker agent max turns to avoid errors

The tracker-mapping and common-pattern enrichment agents ran with
4 and 3 max turns. Those budgets are smaller than the tool-call
rounds their prompts authorize (two/one DB searches plus up to
three web searches) plus the forced structured-output synthesis
turn, so the run loop tripped MaxTurnsExceededError before it
could emit JSON.

Raise the budgets to 10 across every layer that drives them: the
bootstrap env-var defaults, the Helm chart values and production
example, and the in-code fallback. Update the bootstrap test
defaults to match.

Revert the prompt instructions that told the model to reserve a
turn for its final answer; the model cannot reliably count its
remaining turns, so the fix belongs in the turn budget rather
than the prompt text.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-06-01 16:40:03 +02:00
parent a3b330ca29
commit b9eac20c9c
7 changed files with 19 additions and 13 deletions

View File

@@ -36,9 +36,15 @@ const (
// defaultMappingMaxTurns and defaultEnrichmentMaxTurns bound the
// agent reasoning loop (LLM call + tool round-trips) when the worker
// config does not supply a value.
defaultMappingMaxTurns = 4
defaultEnrichmentMaxTurns = 3
// config does not supply a value. The budget must exceed the number
// of tool rounds each prompt authorizes (the mapping prompt allows
// two DB searches plus up to three web searches, the enrichment
// prompt one DB search plus up to three web searches) and still
// leave a turn for the forced structured-output synthesis turn;
// otherwise the loop trips MaxTurnsExceededError before emitting
// JSON. Ten matches agent.DefaultMaxTurns and gives ample headroom.
defaultMappingMaxTurns = 10
defaultEnrichmentMaxTurns = 10
// defaultAgentMaxTokens caps the output of the mapping and
// enrichment agents when the agent config carries no max-tokens