Skip to content

The agent that grows with you

test(desktop): a leading slash now chips, superseding #71664's exclusion

Brooklyn Nicholsonddd6b57938af
diff --git a/apps/desktop/src/components/assistant-ui/directive-text.test.ts b/apps/desktop/src/components/assistant-ui/directive-text.test.ts
index d5f7074e5d1..c177e2f5066 100644
--- a/apps/desktop/src/components/assistant-ui/directive-text.test.ts
+++ b/apps/desktop/src/components/assistant-ui/directive-text.test.ts
@@ -74,8 +74,14 @@ describe('inline skill references', () => {
expect(skills('roughly 3 /4 of it')).toEqual([])
})
- it('does not chip a leading slash — that is a command invocation, not prose', () => {
- expect(skills('/clean')).toEqual([])
+ it('chips a leading slash, which now reaches the transcript as a skill invocation', () => {
+ // #71664 asserted the opposite, and was right at the time: a leading slash
+ // only ever EXECUTED, so it never reached a rendered message as text —
+ // the turn that reached the bubble was the expanded skill body. Projecting
+ // a skill turn back onto `/work fix it` changes that precondition, so the
+ // invocation now has to chip like any other skill reference.
+ expect(skills('/clean')).toEqual(['/clean'])
+ expect(skills('/work fix the leak')).toEqual(['/work'])
})
it('parses a skill chip alongside an @ reference', () => {
diff --git a/apps/desktop/src/components/assistant-ui/directive-text.tsx b/apps/desktop/src/components/assistant-ui/directive-text.tsx
index f04340c5d6e..418f59eda71 100644
--- a/apps/desktop/src/components/assistant-ui/directive-text.tsx
+++ b/apps/desktop/src/components/assistant-ui/directive-text.tsx
@@ -183,6 +183,11 @@ const HERMES_DIRECTIVE_RE = new RegExp(
// pills, so the sent message renders them as pills too rather than flattening
// back to raw text.
//
+// #71664 deliberately excluded a LEADING slash, and was right then: a command
+// only ever executed, so it never reached a rendered message as text. Skill
+// turns now project back onto their invocation, so that precondition is gone
+// and `^` joins the lookbehind.
+//
// Unlike the composer's caret-anchored trigger, this scans finished text, so
// it must reject a token that continues into a path: `/usr/local/bin` would
// otherwise chip as `/usr`. `(?![\w-]*\/)` requires the token to end at