fix(grok): preserve native question multi-select #20881
main fromrefs/pull/20881/head·merged by juliusmarminge View on GitHubProblem#
Grok's x.ai native question extension accepts multiSelect, but the adapter rebuilds each extracted question without that field. The UI then receives a single-select question even when Grok requested several answers.
Change#
Preserve the extracted question fields while copying the options array. Add a replay test that receives a multi-select question, selects two answers and checks the live JSON-RPC response contains both.
Scope and approval#
This is a small fix for an obvious dropped-field bug in an existing provider capability. It needs no new contract or product behavior. No prior discussion is required under the focused bug-fix exception in CONTRIBUTING.md.
Verification#
The focused GrokAdapterV2.test.ts suite passed in the Signalbox checkout, including the live replay regression. The adapter and test files in this PR are byte-for-byte identical to those tested files. This upstream-only commit starts from 89b42bfeb4; I did not run a separate upstream install or repo-wide suite. CI will check that environment.
Implemented with GPT-6 Luna and GPT-6.1 Sol through Codex.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
e6e012eMacroscope's review found this PR approvable — This is a narrowly scoped Grok adapter bug fix that preserves the existing native multi-select flag, with a focused replay test verifying multiple answers remain intact. It does not change product defaults, contracts, deployment behavior, or static-analysis configuration.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Important
Review skipped#
Review was skipped as selected files did not have any reviewable changes.
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f06fe238-e58c-4ea0-bf61-9dd08e236c21
📥 Commits
-
Reviewing files that changed from the base of the PR and between e6e012e0c6f680d3841ed1a36a0f2144096a1922 and 75da0ca90df3a92285c499d7f091b376d03e440b.
You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
- 🔍 Trigger review
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
71bc69cb-88d5-49a3-9fe0-24fc9f7b4f60
📥 Commits
-
Reviewing files that changed from the base of the PR and between 89b42bfeb4f79408af72fc7bb7a4482e22bb9493 and e6e012e0c6f680d3841ed1a36a0f2144096a1922.
📒 Files selected for processing: 2
-
apps/server/src/orchestration-v2/Adapters/GrokAdapterV2.test.tspackages/provider-grok/src/server/adapter.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
-
📝 Walkthrough
-
The Grok adapter now preserves all extracted question properties when it builds user-input requests, while still copying options. A replay integration test checks an x.ai multi-select question, its emitted request, submission of both answers, and turn termination.
Changes: Grok question flow
Layer / File(s) Summary Question mapping and replay validation
packages/provider-grok/src/server/adapter.ts,apps/server/src/orchestration-v2/Adapters/GrokAdapterV2.test.tsThe adapter copies all extracted question properties into the request and retains the options copy. The replay test verifies the emitted multi-select request, submission of both answers, and turn termination. Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
### Architecture SummaryMerge Risk: ⚪ Minimal · up to
e6e01-
The change preserves Grok multi-select questions, and the replay test detects a dropped answer. No issue remains that should block merging.
Architecture risk: 🔵 Low · up to
e6e01The change affects 2 systems.
Changed systems:
packages/provider-grok,apps/serverArchitecture concerns No architecture-level concerns identified.
Review details
-
Systems and components
- observed — packages/provider-grok (library) was modified; 1 changed file maps to changed impact.
- observed — apps/server (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
- observed — Modified behavior in apps/server/src/orchestration-v2/Adapters/GrokAdapterV2.test.ts: Added contract imports for message, node, run, and user-input question/request types used by the new replay test.
- observed — Modified behavior in apps/server/src/orchestration-v2/Adapters/GrokAdapterV2.test.ts: Added Effect imports for deferred synchronization, filesystem and path access, and event-stream consumption.
- observed — Modified behavior in apps/server/src/orchestration-v2/Adapters/GrokAdapterV2.test.ts: Added Grok provider and initialization metadata imports and the ACP replay runtime/transcript test helpers.
- observed — Modified behavior in apps/server/src/orchestration-v2/Adapters/GrokAdapterV2.test.ts: Added a live adapter test that replays initialization, session creation, a prompt, and an x.ai multi-select question with two options. It verifies the normalized question and live user-input request, responds with both selected answers, and waits for the prompt turn to become terminal.
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly and concisely describes the primary fix: preserving native Grok multi-select questions. Description check The description includes all required sections. It explains the problem, the change, the focused approval exception, verification results, test limitations, and the agent attribution. Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
juliusmarminge merged this69f4042
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes