fix(composer): allow slash skill search within messages #19107
main fromrefs/pull/19107/head·merged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHubTyping / after other text did not open skill search. Detect slash tokens at the cursor in web/desktop and the shared mobile path, so Please use /review works. Existing provider-command placement rules still apply.
Verified: 133 focused tests, targeted lint and formatting, web/shared type checks, and a real web composer check with a sample skill. Native mobile UI was not exercised.
Before:
After:
Skill selection:
https://github.com/user-attachments/assets/1b39063a-7b76-438d-9031-11ebce79380e
Model: GPT-6.1-Sol. Harness: Codex in T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
Approvability#
Verdict: Approved at
19f687dMacroscope's review found this PR approvable — This is a focused composer bug fix that reuses the existing slash-command and skill-search flows for whitespace-delimited inline tokens. The production changes are limited to web and shared/mobile trigger detection, with targeted tests covering the new behavior and boundaries.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
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:
cc993785-5429-40a8-bbc7-2324b9c3be7c
📥 Commits
-
Reviewing files that changed from the base of the PR and between 4292720fd927f4c81c21da4e596bdfcedbde32ce and 19f687d8ec918604e45cec62a583497d410f45e8.
📒 Files selected for processing (4)
-
apps/web/src/composer-logic.test.tsapps/web/src/composer-logic.tspackages/shared/src/composerTrigger.test.tspackages/shared/src/composerTrigger.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
-
📝 Walkthrough
-
The composer trigger logic now detects slash commands from the current whitespace-delimited token, including when the token follows other text. The query and source range correspond to that token. Tests cover whitespace types and tokens that do not trigger detection.
Changes: Slash-command detection
Layer / File(s) Summary Token detection and coverage
apps/web/src/composer-logic.ts,packages/shared/src/composerTrigger.ts,apps/web/src/composer-logic.test.ts,packages/shared/src/composerTrigger.test.tsBoth trigger implementations detect a slash-prefixed current token and use its bounds for the query and range. Tests cover tokens after spaces, tabs, and newlines, as well as cases that return no trigger. Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
### Architecture SummaryMerge Risk: ⚪ Minimal · up to
19f68-
Typing a slash after other text now opens skill search, and existing provider-command placement rules still apply. No concrete merge-blocking risk was found.
Architecture risk: 🔵 Low · up to
19f68The change affects 2 systems.
Changed systems:
apps/web,packages/sharedArchitecture concerns No architecture-level concerns identified.
Review details
-
Systems and components
- observed — apps/web (ui) was modified; 2 changed files map to changed impact.
- observed — packages/shared (library) was modified; 2 changed files map to changed impact.
Before / after behavior
- observed — Modified behavior in apps/web/src/composer-logic.test.ts: Add expectations that slash-command detection recognizes
/skill:reviewafter whitespace, reports the query and token range, and accepts spaces, tabs, or a newline in the prefix. - observed — Modified behavior in apps/web/src/composer-logic.test.ts: Add expectations that
/and/reviewafterUsetrigger slash-command detection with the range beginning at the slash. - observed — Modified behavior in apps/web/src/composer-logic.test.ts: Add negative cases asserting that
Use/review, a URL ending in/review, and a slash command followed by a space do not trigger detection. - observed — Modified behavior in apps/web/src/composer-logic.ts:
detectComposerTriggernow checks the current token for a leading/and returns its token-based query and range. Previously, slash-command detection required the line prefix to start with/and match only/followed by non-whitespace characters; slash tokens elsewhere on the line now qualify.
Pre-merge checks ·
4-
Passed checks (4 passed)-
Check name Status Explanation Title check The title clearly and concisely describes the primary change: enabling slash skill search within messages. Description check The description explains the problem, change, verification steps, screenshots, and untested native mobile UI. It omits the required Scope and approval section and does not use the template headings, b… 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
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Yash-Singh1(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes