Skip to content

fix(core): render built-in command arguments - #45697

Merged
kitlangton merged 3 commits into
v2from
builtin-arguments
Aug 28, 2026
Merged

kitlangton merged 3 commits into
v2from
builtin-arguments

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Why

The built-in init and review templates place $ARGUMENTS where command input belongs, but the renderer left those markers in the prompt and appended the input at the end. Review contains the marker more than once, so the model received both stale placeholders and misplaced context.

What Changes

Template Before After
Contains $ARGUMENTS Leave markers and append trimmed input Replace every marker with trimmed input
Has no marker Append trimmed input Append trimmed input
Empty input Leave markers Remove markers without appending content

Path interpolation, attached files, and delivery mode continue through the existing command path.

Scope

This changes only built-in command rendering. It does not import configured-command shell interpolation or positional argument semantics, and it does not alter MCP prompt parsing.

Verification

From packages/core:

bun run test test/plugin/command.test.ts
bun typecheck

From the repository root:

bunx oxlint packages/core/src/plugin/command.ts packages/core/test/plugin/command.test.ts
bunx ast-grep scan -c script/ast-grep/sgconfig.yml packages/core/src/plugin/command.ts
bunx ast-grep scan -c script/ast-grep/effect-simplifications/sgconfig.yml --off=unused-suppression packages/core/src/plugin/command.ts
git diff --check
sh .husky/pre-push

The focused tests passed (2 tests), Core typecheck passed, both structural scans passed, diff-check passed, and the full 33-package pre-push typecheck passed. Scoped oxlint completed with four pre-existing warnings in unchanged command registration lines and no errors.

@kitlangton
kitlangton merged commit ee42eb3 into v2 Aug 28, 2026
10 checks passed
@kitlangton
kitlangton deleted the builtin-arguments branch August 28, 2026 20:55
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant