Consume @agent-relay/integration-prompts for adapter doc parsing#379
Conversation
|
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 ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR adds ChangesTwo-stage writable-resource parsing pipeline
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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.
Code Review
This pull request integrates the @agent-relay/integration-prompts package to parse writable resources from adapter documentation, falling back to the legacy heading parser if no results are found. Feedback on the changes suggests adding optional chaining and a fallback value when accessing descriptor.path in toWritableResource to prevent potential runtime TypeError crashes.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| function toWritableResource(descriptor: WritableResourceDescriptor): WritableResource { | ||
| const path = descriptor.path.replace(/^\//u, '') | ||
| return { name: descriptor.name ?? lastMeaningfulSegment(path), pathTemplate: path } | ||
| } |
There was a problem hiding this comment.
If descriptor.path is undefined or null, calling .replace on it will throw a TypeError at runtime. To prevent potential crashes, use optional chaining and provide a fallback value.
| function toWritableResource(descriptor: WritableResourceDescriptor): WritableResource { | |
| const path = descriptor.path.replace(/^\//u, '') | |
| return { name: descriptor.name ?? lastMeaningfulSegment(path), pathTemplate: path } | |
| } | |
| function toWritableResource(descriptor: WritableResourceDescriptor): WritableResource { | |
| const path = descriptor.path?.replace(/^\//u, '') ?? '' | |
| return { name: descriptor.name ?? lastMeaningfulSegment(path), pathTemplate: path } | |
| } |
Summary
Installs
@agent-relay/integration-prompts@^8.8.3(resolved to8.8.4) and replaces the localparseWritableResourcesfunction with the package's more comprehensive parser, falling back to the legacy heading format for adapter docs still using it.Bumps
@agent-relay/evalslockfile resolution from8.8.2to8.8.4so pear gains access to the integration-prompts re-exports.Changes
src/main/integrations.ts: ImportparseWritableResourcesfrom the package. The local function now delegates to the package parser first (handles markdown tables and write-field-contract formats), then falls back to the heading format for backward compat. AddedtoWritableResourceadapter to mapWritableResourceDescriptor→ localWritableResource.package.json: Added@agent-relay/integration-prompts: ^8.8.3, updated@agent-relay/evalsto^8.8.4.Testing
broker.test.ts— asar path mismatch).