fix(factory): dispatch after Slack triage clarification#34
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthrough
ChangesSlack Triage Escalation Retry & Dispatch
Sequence Diagram(s)sequenceDiagram
participant Client as FactoryLoop
participant Triage as TriageEngine
participant Slack as SlackClient
participant Handler as `#handleTriageEscalationSlackAnswer`
Client->>Triage: triage(issue)
Triage-->>Client: low-confidence / thin decision
Client->>Client: `#recordTriageEscalation`(decision, reason)
Client->>Slack: escalateTriageToSlack(issue, triageEscalationQuestion(decision))
Slack-->>Client: watch record stored
Note over Slack,Client: Human replies on Slack thread
Slack->>Client: `#routeSlackAnswerToImplementers`(record, replyText)
Client->>Client: isTriageEscalationWatchRecord(record) → true
Client->>Handler: `#handleTriageEscalationSlackAnswer`(record, replyText)
Handler->>Handler: issueWithSlackClarification(issue, replyText)
Handler->>Triage: triage(clarifiedIssue)
Triage-->>Handler: high-confidence decision
Handler->>Client: dispatch or queue clarified issue
Handler->>Client: update slackTriageAnswerDispatched counter
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/orchestrator/factory.test.ts`:
- Around line 6843-6845: The test has a timing issue where the assertion
checking factory.status().counters.slackTriageAnswersDispatched executes before
the Slack-triage dispatch operation completes its asynchronous counter update.
Add an additional async drain step before the assertions on lines 6844-6845 to
ensure the dispatch operation fully completes and updates the counters. This
will eliminate the race condition causing the counter to be undefined instead of
1 in CI.
🪄 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: 0489059f-03b1-48d7-9d7f-c2cd7667baa2
📒 Files selected for processing (2)
src/orchestrator/factory.test.tssrc/orchestrator/factory.ts
ebdecf9 to
dfcee4c
Compare
Summary
[factory] error {}for this pathWhy
AR-287 escalated before dispatch, so there was no implementer alive to receive the Slack answer. Existing Slack reply routing only injected replies into already in-flight implementer/babysitter agents. This patch handles the pre-dispatch case explicitly.
Local status check
/tmp/factory-run/factory-loop-registry.jsonwithagents: []ar-287Verification
npm run buildnpm test -- src/orchestrator/factory.test.ts(211 pass)npm test(545 pass)git diff --check