Add role-play audio review workflow - #42
Conversation
|
Warning Review limit reached
Next review available in: 42 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughThis PR adds a scenario standardization review feature: a Gemini-backed service generates French-usage feedback from role-play messages, new UI components display and navigate reviews, App.tsx wires review lifecycle/state, and ConversationHistory gains a user-audio toggle. Separately, it adds six Codex workflow agent TOML configs and a UserPromptSubmit hook script. ChangesScenario Standardization Review Feature
Codex Workflow Agents and Hook
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant App
participant ReviewService as generateScenarioStandardizationReview
participant Gemini as GoogleGenAI
participant ScenarioReviewSummary
User->>App: complete scenario practice
App->>App: startScenarioReview(snapshot)
App->>ReviewService: generate review(messages, scenarioName)
ReviewService->>ReviewService: fetchAudioAsInlineData(audioUrl)
ReviewService->>Gemini: generateContent(prompt, JSON schema)
Gemini-->>ReviewService: response.text (JSON)
ReviewService-->>App: ScenarioStandardizationReview
App->>ScenarioReviewSummary: render overlay with review
User->>ScenarioReviewSummary: Restart or Done
ScenarioReviewSummary-->>App: onRestart/onDismiss
App->>App: revoke audio URLs, reset state
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
parle | d7487a0 | Commit Preview URL Branch Preview URL |
Jul 08 2026, 09:22 AM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
parle-personal | d7487a0 | Commit Preview URL Branch Preview URL |
Jul 08 2026, 09:23 AM |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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 @.codex/hooks.json:
- Line 8: The hooks configuration contains a machine-specific absolute path in
the command for detect-workflow.cjs, which should be made portable. Update the
command in hooks.json to use the same relative invocation pattern used by the
.claude/settings.json equivalent, and verify the detect-workflow.cjs hook still
resolves correctly from the repository root.
In `@App.tsx`:
- Around line 191-236: Scenario review generation is missing abort handling and
stale-response protection, so older in-flight results can overwrite newer state.
Update startScenarioReview and regenerateScenarioReview to create/pass an
AbortController signal into generateScenarioStandardizationReview, and guard all
.then/.catch/.finally state updates with a request token check like
requestIdRef.current so only the latest review request can win. Also abort any
pending scenario review request in handleDismissScenarioSummary and
handleRestartScenarioFromSummary, and apply the same pattern consistently where
the review flow is triggered.
In `@components/ScenarioReviewSummary.tsx`:
- Around line 83-88: The “Done” action in ScenarioReviewSummary should be
disabled while isReviewLoading is true, just like the “Restart Scenario”
control. Update the button in ScenarioReviewSummary to respect the loading state
and prevent onDismiss from firing during an in-flight
generateScenarioStandardizationReview request, using the existing
isReviewLoading prop/state and the same disabled/guard pattern already used for
the restart flow.
In `@services/scenarioStandardizationReviewService.ts`:
- Around line 14-18: The initialization fallback in the GoogleGenAI setup is
invalid because calling GoogleGenAI without new will always fail and mask the
original error. Remove the fallback invocation in
scenarioStandardizationReviewService and keep only the constructor-based
initialization in the try block, using the GoogleGenAI symbol directly so any
real initialization issue is surfaced instead of being hidden.
🪄 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
Run ID: 4825c256-1cd8-43c2-b23b-abe5fd41d5b6
📒 Files selected for processing (16)
.codex/agents/workflow-builder.toml.codex/agents/workflow-docs.toml.codex/agents/workflow-reviewer-cr.toml.codex/agents/workflow-reviewer-manual.toml.codex/agents/workflow-test-designer.toml.codex/agents/workflow-test-runner.toml.codex/hooks.json.codex/hooks/detect-workflow.cjsApp.tsx__tests__/ConversationHistory.userAudioToggle.test.tsx__tests__/scenarioStandardizationReviewService.test.tscomponents/ConversationHistory.tsxcomponents/ScenarioReviewSummary.tsxcomponents/ScenarioStandardizationReviewPanel.tsxservices/scenarioStandardizationReviewService.tstypes.ts
| <button | ||
| onClick={onDismiss} | ||
| className="py-3 bg-blue-600 hover:bg-blue-500 text-white rounded-xl font-medium transition-colors" | ||
| > | ||
| Done | ||
| </button> |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
"Done" button isn't disabled during isReviewLoading, unlike "Restart Scenario".
This lets a user dismiss the summary while generateScenarioStandardizationReview is still fetching/generating in the background — compounding the missing-cancellation issue flagged in App.tsx (startScenarioReview/regenerateScenarioReview don't create/pass an AbortSignal). Once App.tsx wires cancellation, disabling this button too would prevent the in-flight request from continuing to burn network/audio-fetch cost after the user has already left.
🔧 Proposed fix
<button
onClick={onDismiss}
+ disabled={isReviewLoading}
- className="py-3 bg-blue-600 hover:bg-blue-500 text-white rounded-xl font-medium transition-colors"
+ className="py-3 bg-blue-600 hover:bg-blue-500 text-white rounded-xl font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
>
Done
</button>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <button | |
| onClick={onDismiss} | |
| className="py-3 bg-blue-600 hover:bg-blue-500 text-white rounded-xl font-medium transition-colors" | |
| > | |
| Done | |
| </button> | |
| <button | |
| onClick={onDismiss} | |
| disabled={isReviewLoading} | |
| className="py-3 bg-blue-600 hover:bg-blue-500 text-white rounded-xl font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed" | |
| > | |
| Done | |
| </button> |
🤖 Prompt for 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.
In `@components/ScenarioReviewSummary.tsx` around lines 83 - 88, The “Done” action
in ScenarioReviewSummary should be disabled while isReviewLoading is true, just
like the “Restart Scenario” control. Update the button in ScenarioReviewSummary
to respect the loading state and prevent onDismiss from firing during an
in-flight generateScenarioStandardizationReview request, using the existing
isReviewLoading prop/state and the same disabled/guard pattern already used for
the restart flow.
What changed
Why
Role-play sessions needed two follow-ups after practice: access to the user's own recordings inside the conversation, and a focused review that rewrites only the user's less standard French into more established phrasing without grading the AI or relying on transcripts as the source of truth.
Validation
Summary by CodeRabbit
New Features
Bug Fixes