#11440: fix: preserve multi-line input for skill commands
stale
Cluster:
Skill Command Deduplication
## Bug
Skill commands with multi-line input lose everything after the first newline.
**Steps to reproduce:**
1. Configure a skill command (e.g. `/my_skill`)
2. Send a message with the command and multi-line content:
```
/my_skill FEEDBACK BELOW:
First item to review
Second item to review
```
3. The agent only receives `"FEEDBACK BELOW:"` as user input. All subsequent lines are dropped.
**Expected:** Full multi-line content is preserved as skill command args.
## Root Cause
`normalizeCommandBody()` in `commands-registry.ts` truncates at the first newline:
```typescript
const newline = trimmed.indexOf("\n");
const singleLine = newline === -1 ? trimmed : trimmed.slice(0, newline).trim();
```
This is correct for built-in commands (`/status`, `/reset`, etc.) but breaks skill commands that accept rich multi-line input. The downstream `resolveSkillCommandInvocation()` regex already uses `[\s\S]+` to handle newlines, but the input is truncated before it reaches that function.
## Fix
Rather than modifying `normalizeCommandBody()` (which would risk breaking built-in commands), the fix reconstructs the skill command body in `get-reply-inline-actions.ts` by:
1. Taking the normalised first line from `commandBodyNormalized` (with bot mentions stripped for groups)
2. Grafting the remaining lines from `rawBodyNormalized` back onto it
This preserves both normalisation (bot mention removal in groups) and multi-line content. Zero changes to `normalizeCommandBody` means zero risk to existing built-in command handling.
**Files changed:** 2 (`get-reply-inline-actions.ts` + `skill-commands.test.ts`)
## Tests Added
- Multi-line args with direct command syntax
- Multi-line args with `/skill` syntax
- Existing single-line tests unaffected
---
## Prompt Request
If you prefer to implement this differently:
```
Fix a bug where skill commands with multi-line input lose everything after the first newline.
normalizeCommandBody() in src/auto-reply/commands-registry.ts truncates at the
first \n. This is correct for built-in commands but breaks skill commands.
Key files:
- src/auto-reply/commands-registry.ts - normalizeCommandBody() truncates at \n (~line 375)
- src/auto-reply/reply/get-reply-inline-actions.ts - calls resolveSkillCommandInvocation (~line 153)
- src/auto-reply/skill-commands.ts - resolveSkillCommandInvocation() already handles \n via [\s\S]+
- src/auto-reply/reply/commands-context.ts - buildCommandContext() sets rawBodyNormalized (full) and commandBodyNormalized (truncated)
- src/auto-reply/reply/commands-types.ts - CommandContext type
Fix: in get-reply-inline-actions.ts, reconstruct a skill-specific body combining the
normalised first line (bot mentions stripped) with remaining lines from rawBodyNormalized.
Avoids changing normalizeCommandBody() (zero risk to built-in commands).
Add tests in src/auto-reply/skill-commands.test.ts for multi-line args.
Reproduce: /some_skill first line\nsecond line\nthird line
Expected args: "first line\nsecond line\nthird line"
Actual (before fix): "first line" (rest dropped)
```
Most Similar PRs
#14991: fix(telegram): deduplicate skill commands by skillName to prevent B...
by smartchainark · 2026-02-12
68.1%
#19164: fix(discord): dedupe native skill commands across agents by skill name
by seewhyme · 2026-02-17
67.7%
#22198: fix(skills): treat empty allowBundled array as block-all
by haitao-sjsu · 2026-02-20
67.1%
#17062: fix(telegram): prioritize workspace skills over bundled in native c...
by scout-wolfe · 2026-02-15
66.5%
#16792: fix(skills): use subsystem logger instead of console.log for debug ...
by Limitless2023 · 2026-02-15
65.6%
#15115: fix: pre-load skill docs in cron sessions to prevent hallucinated syn…
by joaolcorreia · 2026-02-13
65.6%
#21839: fix(skills): allowBundled: [] now blocks all bundled skills
by hydro13 · 2026-02-20
65.5%
#19664: fix(skills): log skill YAML parsing diagnostics with skill name
by orchidsun · 2026-02-18
65.2%
#13594: fix(skills): correct apple-notes SKILL.md memo -a syntax
by lailoo · 2026-02-10
64.9%
#22525: [Bug]: Session snapshot not reloading skills after gateway restart ...
by zwffff · 2026-02-21
64.8%