Skip to content

fix(master): auto-retry on turn exhaustion + fix flaky tests - #22

Merged
medomar merged 2 commits into
developfrom
fix/test-stability-and-turn-escalation
Mar 24, 2026
Merged

fix(master): auto-retry on turn exhaustion + fix flaky tests#22
medomar merged 2 commits into
developfrom
fix/test-stability-and-turn-escalation

Conversation

@medomar

@medomar medomar commented Mar 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • OB-F232 (Critical): Master-level turn-escalation retry — when the Master session hits turnsExhausted, auto-retries with ceil(maxTurns × 1.5) (capped at 50), injecting partial output as continuation context. Only surfaces guidance to the user if the escalated retry also fails. Mirrors the existing worker pattern (OB-903).
  • Flaky test suite fix: setup.ts cleanStaleTestWorkspaces() was deleting active temp dirs used by parallel test forks, causing 6-14 intermittent ENOENT/EINVAL failures per run. Added 5-minute staleness threshold.
  • Exploration tuning: DEFAULT_MAX_TURNS_EXPLORATION 15→25 (monorepo headroom), PHASE_TIMEOUT 300s→600s (large workspaces). Test assertions updated.
  • Findings audit: Added OB-F231 through OB-F235 from real-world testing, marked OB-F232 as fixed.

Test plan

  • npm run typecheck — passes
  • npm run lint — 0 errors (57 pre-existing warnings)
  • npm run test — 240/240 files, 5518/5518 tests pass (verified on 3 consecutive runs, 0 flaky failures)
  • Verify on CI (GitHub Actions)

🤖 Generated with Claude Code

medomar and others added 2 commits March 23, 2026 13:05
Merge develop into main for v0.1.0 release
- OB-F232: Master-level turn-escalation retry mirrors worker pattern (OB-903).
  On first turnsExhausted, auto-retries with ceil(maxTurns × 1.5) capped at 50,
  injecting partial output as continuation context. Only surfaces guidance to
  the user if the escalated retry also fails.

- Fix flaky test suite: setup.ts cleanStaleTestWorkspaces() was deleting active
  temp dirs used by parallel test forks. Added 5-minute staleness threshold so
  only truly stale dirs are cleaned.

- Update DEFAULT_MAX_TURNS_EXPLORATION from 15 → 25 for monorepo headroom,
  PHASE_TIMEOUT from 300s → 600s for large workspaces. Test assertions updated.

- docs/audit/FINDINGS.md: added 5 new findings from real-world audit (OB-F231
  through OB-F235), marked OB-F232 as fixed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@medomar
medomar merged commit e366fbe into develop Mar 24, 2026
5 checks passed
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