Skip to content

feat: retry malformed JSON with minimal context#24

Merged
drewstone merged 1 commit intomainfrom
experiment/json-retry-minimal-context
Mar 19, 2026
Merged

feat: retry malformed JSON with minimal context#24
drewstone merged 1 commit intomainfrom
experiment/json-retry-minimal-context

Conversation

@drewstone
Copy link
Copy Markdown
Contributor

Summary

  • On unparseable LLM JSON, retry with just current page + correction hint (~7K tokens)
  • Avoids wasting a full turn that re-sends entire history (~25K tokens) for zero progress
  • If retry fails, falls back to existing wait(1000) behavior — zero regression risk

Context

SportingNews benchmark case lost 2 turns (~50K tokens) to malformed JSON responses.
Each wasted turn re-sends the full conversation history at 25K+ tokens for no progress.
This retry catches the failure inline with a cheap minimal-context call.

Test plan

  • pnpm lint — clean
  • pnpm test — 629/629 passing
  • Code review: only activates on parse failure, transparent to runner
  • Fallback: if retry also fails, existing wait(1000) behavior preserved

🤖 Generated with Claude Code

…turn

When the LLM returns unparseable JSON, retry with just the current page
state + correction hint (~7K tokens) instead of accepting wait(1000) and
re-sending full history (~25K tokens) on the next turn.

If retry succeeds: use the corrected response, no turn wasted.
If retry fails: fall back to existing wait(1000) behavior.
@drewstone drewstone merged commit cef0193 into main Mar 19, 2026
5 checks passed
drewstone added a commit that referenced this pull request Mar 19, 2026
Unpublished since 0.10.0:
- feat: screenX/screenY CDP fix for Cloudflare Turnstile (#29)
- fix: boost output tokens near max turns (#28)
- feat: canvas fingerprint noise + stealth patches (#27)
- fix: headless UA override — platform-agnostic Akamai bypass (#26)
- fix: nightly CI — Xvfb headed stealth + system Chrome (#25)
- feat: retry malformed JSON with minimal context (#24)
- feat: three-tier history compression -22% cost (#23)
- feat: headless passthrough + Docker benchmark runner (#22)
- feat: WebVoyager + WebArena benchmark adapters (#20)
- fix: graceful recovery from execute wall-clock timeouts (#21)
- feat: showcase command for marketing asset capture (#18)
- feat: research pipeline + speed-v1 experiment results (#19)
- feat: design rip, compare, and extract-tokens overhaul (#17)
- feat: CDP connection, browser profiles, and asset downloader (#16)
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