Uh oh!
There was an error while loading. Please reload this page.
Teach workflow repairs from failed attempts - #54
Conversation
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThreads previous workforce-persona repair attempts through the auto-fix and prewrite repair flows, records structured repair-attempt metadata, surfaces prior attempts in repair prompts/tasks, and escalates persona resolver tier to "best" after repeated failures. ChangesRepair Attempt History & Tier Escalation
Sequence Diagram(s)sequenceDiagram
participant AutoFix as Auto-fix loop
participant Repairer as Workforce Persona Repairer
participant Pipeline as Generation Pipeline / Prewrite Loop
participant Writer as Workforce Persona Writer
AutoFix->>Repairer: call workflowRepairer(input with previousAttempts)
Repairer->>Repairer: evaluate options (attempt count -> tier)
Repairer-->>AutoFix: repair outcome (blocker / success + personaRunId)
AutoFix->>AutoFix: append pendingAttempt / aggregate previousAttempts
Pipeline->>Writer: buildWorkflowPersonaTask(validationFeedback with previousAttempts)
Writer-->>Pipeline: persona task (includes previousAttempts in prompt)
Pipeline->>Repairer: invoke prewrite repair iterations, passing previousAttempts
Repairer-->>Pipeline: updated repair attempt outcomes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/product/generation/pipeline.ts`:
- Around line 25-26: The default pre-write repair attempts constant
(DEFAULT_WORKFORCE_PERSONA_PREWRITE_REPAIR_ATTEMPTS) is set to 3 but the
escalation branch is gated on repairAttempt > 3, so the default never reaches
escalation; change DEFAULT_WORKFORCE_PERSONA_PREWRITE_REPAIR_ATTEMPTS to 4
(ensuring it remains <= MAX_WORKFORCE_PERSONA_PREWRITE_REPAIR_ATTEMPTS) so the
default retry budget will promote to the escalation/"best" path, and apply the
same change to the other matching default constant(s) referenced near the other
block (the ones around the 216-218 area) so both places use 4 as the default.
In `@src/product/generation/workforce-persona-repairer.ts`:
- Around line 219-225: personaResolverOptions currently defaults a missing tier
to DEFAULT_WORKFORCE_PERSONA_TIER (which is 'best'), so the attempt-based
escalation never changes behavior when callers (like the auto-fix loop in
src/local/auto-fix-loop.ts) omit a tier; change personaResolverOptions to treat
an omitted tier as a lower starting tier so escalation can take effect: compute
a baseTier = options.tier ?? 'standard' (or another non-'best' baseline), then
set tier = options.attempt !== undefined && options.attempt > 3 ? 'best' :
baseTier, and preserve the existing installRoot behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e1e95918-a797-493b-9580-1877231380f4
📒 Files selected for processing (8)
src/local/auto-fix-loop.test.tssrc/local/auto-fix-loop.tssrc/product/generation/pipeline.tssrc/product/generation/types.tssrc/product/generation/workforce-persona-repairer.test.tssrc/product/generation/workforce-persona-repairer.tssrc/product/generation/workforce-persona-writer.test.tssrc/product/generation/workforce-persona-writer.ts
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
khaliqgant
commented
May 6, 2026
Addressed the two review comments in d89eb2f:
Validation:
|
Uh oh!
There was an error while loading. Please reload this page.
Summary
bestafter the third repair attemptTests