Repository navigation
test(mock-server): serve an omp native-chat scenario - #14859
plotarmordev wants to merge 1 commit into
Conversation
MOCK_CHAT_AGENT=omp switches the native-chat mock's agent tab to omp: a providerSession without transcriptPath (the shape omp's hook reports) and a decoded transcript shaped like the runtime's omp decoder output, so mobile's omp readability gate and renderer can be exercised without a live runtime.
📝 WalkthroughWalkthroughThe native chat mock server now supports Claude and OMP agent selection through Merge Risk: ⚪ Minimal · up to This PR adds an OMP-only mock scenario while preserving the existing default behavior; no actionable merge-blocking risk remains, and the noted typing and comment cleanup can follow up normally. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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.
🧹 Nitpick comments (2)
mobile/scripts/mock-server-native-chat-scenario.ts (2)
113-113: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winType
mockTranscriptwith the native-chat message contract.Line 113 returns
unknown[]. This disables compile-time checks for message fields and block discriminators. Confirm the authoritative native-chat message type and use it as the return type. TypeScript can then detect fixture schema drift before mobile receives the RPC response.
28-30: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReduce each rationale comment to one concise line.
mobile/scripts/mock-server-native-chat-scenario.ts#L28-L30: keep only the reason that OMP has no transcript path.mobile/scripts/mock-server-native-chat-scenario.ts#L110-L112: keep only the reason that the fixture mirrors decoded OMP blocks.As per coding guidelines, “Comments must be concise, non-obvious, and brief—prefer one line.”
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 92025cf1-68f9-4f3b-96b3-4578baad3f6b
📒 Files selected for processing (2)
mobile/README.mdmobile/scripts/mock-server-native-chat-scenario.ts
Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review.
|
#20655 credited here |
Summary
The mock server's native-chat scenario is hardcoded to
claude, so mobile's omp support can only be exercised against a live runtime.MOCK_CHAT_AGENT=ompswitches the scenario's agent tab to omp with the two omp-specific shapes that matter:providerSessionwithouttranscriptPath— omp's hook discloses only its session id (extractAgentProviderSession), and mobile gates omp chat on readability, so this is the shape that must be mockable;decodeOmpTranscriptLine), so the phone runs the same render path a live omp pane would.Default behaviour is unchanged: without the env var the scenario is identical to today's claude one.
Screenshots
No visual change — this populates the existing mock with different data. Verified on the iOS simulator against
MOCK_NATIVE_CHAT=1 MOCK_CHAT_AGENT=omp: the omp chat view renders all four messages including the tool-call block.Testing
AI Review Report
Risks checked: whether omp needed a transcriptPath to stay realistic; whether the transcript shapes matched the real decoder rather than an invented format; whether default (claude) behaviour could change.
Findings and outcomes:
extractAgentProviderSessionexactly; adding a path would mock a shape the real runtime never sends.decodeOmpTranscriptLineoutput for a real session (text/thinking→text, toolCall→tool-call with object input, toolResult→tool with output) — no invented block types.Cross-platform: the change is a dev-only Node mock script plus a README line; no app code, no platform-conditional logic.
Security Audit
Follow-up: none identified.