fix(opencode): preserve user request for skill slash commands - #40472
Open
BrickerP wants to merge 1 commit into
Open
fix(opencode): preserve user request for skill slash commands#40472BrickerP wants to merge 1 commit into
BrickerP wants to merge 1 commit into
Conversation
Skill slash commands were treated as command templates, so $ARGUMENTS/$N inside SKILL.md docs swallowed user args, or long skill bodies buried the request at the end. Wrap skill bodies without placeholder substitution and append a dedicated User request section. Closes anomalyco#40463
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found some related PRs but no duplicates of PR #40472: Related PRs (not duplicates):
These are addressing related issues around skill commands but are distinct from PR #40472's specific fix about preserving user requests and preventing placeholder substitution within skill bodies. No duplicate PRs found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #40463
Related / previously reported: #26185, #27686, #28241 (closed as dupes / stale)
Type of change
What does this PR do?
Skill slash commands (
/skill-name user request here) were registered as normal commands whosetemplateis the rawSKILL.mdbody.SessionPrompt.commandthen ran$ARGUMENTS/$Nsubstitution against that body.That caused two failure modes:
$ARGUMENTSor$1(common in examples) swallowed the real user args into those example spots.Fix: when
cmd.source === "skill", do not substitute placeholders inside the skill body. Wrap it as:Regular commands and MCP prompts keep the existing
$ARGUMENTS/$N/ append behavior.Also set skill command
hintsto["$ARGUMENTS"]so the slash UI can show that trailing input is supported.How did you verify your code works?
Result: 3 pass, 0 fail (includes new regression test that asserts
$ARGUMENTS/$1in skill docs stay literal and the user request appears under## User request).Screenshots / recordings
N/A — server-side prompt construction only.
Checklist