Skip to content

feat: expose maxRetries in FillOptions for external retry control#162

Merged
jlevy merged 1 commit intomainfrom
feat/fill-options-max-retries
Feb 21, 2026
Merged

feat: expose maxRetries in FillOptions for external retry control#162
jlevy merged 1 commit intomainfrom
feat/fill-options-max-retries

Conversation

@jlevy
Copy link
Owner

@jlevy jlevy commented Feb 21, 2026

Summary

  • Add maxRetries?: number to FillOptions interface, mirroring the existing field on LiveAgentConfig
  • Thread maxRetries from FillOptions through to createLiveAgent() in both the serial fill path and the parallel fill path
  • Enables production harnesses to set maxRetries: 0 to disable hidden AI SDK retries and manage retries externally with full observability

Context

LiveAgentConfig already has maxRetries (line 196 of harnessTypes.ts) and LiveAgent already uses it (passes to generateText()), but fillForm() never passed it through — it always used DEFAULT_MAX_RETRIES = 3. This meant all consumers of the fillForm() API had hidden AI SDK retries with no way to disable them.

The existing LiveAgentConfig.maxRetries doc says "Set to 0 to disable retries" so this is the intended use case.

Test plan

  • pnpm typecheck passes
  • pnpm build succeeds and built types include the new field
  • All 2233 existing tests pass (pre-push hook)
  • Change is mechanical plumbing — no new logic paths to test

Made with Cursor

LiveAgentConfig already supports maxRetries (passed to generateText()),
but fillForm() never threaded it through — always using
DEFAULT_MAX_RETRIES = 3. Production harnesses need maxRetries: 0 to
manage retries externally with full observability.

Thread maxRetries from FillOptions to createLiveAgent() in both the
serial fill path and the parallel fill path.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions
Copy link
Contributor

Coverage Report for packages/markform

Status Category Percentage Covered / Total
🔵 Lines 66.14% (🎯 64%) 6101 / 9223
🔵 Statements 65.91% (🎯 64%) 6312 / 9576
🔵 Functions 65.34% (🎯 64%) 739 / 1131
🔵 Branches 62.5% (🎯 60%) 4393 / 7028
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/markform/src/harness/programmaticFill.ts 71.35% 68.97% 65.71% 71.87% 102-125, 203, 211-307, 316, 334, 354, 601-602, 657-661, 731-736, 746-747, 914-915, 931-947, 981-1003, 1060-1062, 1071, 1117-1129, 1134-1135, 1188-1193, 1210, 1241-1246, 1261, 1287
Generated in workflow #998 for commit e6fa30a by the Vitest Coverage Report Action

@jlevy jlevy merged commit d148b88 into main Feb 21, 2026
1 check passed
@jlevy jlevy deleted the feat/fill-options-max-retries branch February 21, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant