Skip to content

feat(coding-agent): let extensions expand skills in sendUserMessage - #14608

Open
andrebrait wants to merge 7 commits into
can1357:mainfrom
andrebrait:fix/send-user-message-expand-templates
Open

andrebrait wants to merge 7 commits into
can1357:mainfrom
andrebrait:fix/send-user-message-expand-templates

Conversation

@andrebrait

@andrebrait andrebrait commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What

Honor expandPromptTemplates: true to allow Ponytail's pi extension to work on omp. For context: an omp-native extension was proposed to upstream Ponytail, but ultimately rejected because the pi extension works well enough. I did send a PR to fix how their pi extension interfaces with omp, but some things still require addressing on omp's side. This is one of them.

Related: DietrichGebert/ponytail#858 (the rejected omp-native extension) and DietrichGebert/ponytail#1050 (the Pi extension fix).

pi.sendUserMessage() now accepts expandPromptTemplates (default false), as Pi does. When it is set, a registered /skill:<name> command becomes the user-invoked skill message on every delivery path (idle, steer, follow-up, aside), and any other text gets prompt-template expansion. Extension, custom, and file slash commands still run only through prompt(), which handles an omitted deliverAs and aside while idle. If the extension passes attribution: "agent", the expanded skill body is sent as plain user-role text, the same as every other sendUserMessage path.

The shared #queueCustomMessage now drops a steer or follow-up, and promptCustomMessage resolves false, when an abort, a session change, or disposal lands during image preparation. Before, the message was queued after abort() had cleared the queues, which could restart the run the user had just stopped. The same race affected skill commands with images sent from RPC or the TUI while a turn was streaming.

Why

omp kept Pi's original hardcoded expandPromptTemplates: false and never added Pi's later opt-in. Pi extensions that register skill aliases therefore broke in omp. ponytail's /ponytail-review, for example, sent the literal /skill:ponytail-review text, and the model never received the skill.

Testing

  • agent-session-send-user-message-expand.test.ts (9 tests) covers: default literal vs opt-in expansion, the disabled-skill-commands gate, an idle explicit follow-up staying queued, an expanded template that the submitted text can still remove, abort during the SKILL.md read, abort or disposal during image normalization (promptCustomMessage resolves false), agent attribution delivered as a user-role message, and a follow-up queued while streaming. The expansion, drop, and attribution tests failed before their fixes. Mutating the gate, queueOnly, queued template expansion, or rawText makes the matching branch test fail.
  • 2633 related coding-agent tests pass (agent-session, rpc, acp, collab, extensions, task, input-controller, interactive-mode-loop). bun run check:ts passes. I didn't run check:rs because the PR has no Rust changes.
  • I ran a real RPC session with the ponytail Pi extension and sent /ponytail-review focus on the diff. omp 18.6.2 sends the literal /skill: text to the model. This branch sends the skill body, ending in User: focus on the diff.
  • Not covered: omp -p "/ponytail-help" still produces no turn. Print mode never waits for turns that an extension command starts with sendUserMessage, and this is the same for plain text. That needs a separate fix.

  • bun check passes (only check:ts was run; see Testing)
  • Tested locally
  • CHANGELOG updated with the required attribution (if user-facing; internal issue fixes use issue links, external contributions add the PR link and contributor credit after creation)

@roboomp roboomp added agent Agent runtime planning and orchestration feat prompting Prompt templates and prompt assembly review:p2 sdk SDK and extension integration surface triaged labels Oct 6, 2026

@roboomp roboomp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 — focused opt-in extension behavior; maintainer sign-off needed for the new sendUserMessage contract.
Should-fix: add external contributor/PR attribution to packages/coding-agent/CHANGELOG.md:11.
Verification blocked: focused bun test packages/coding-agent/test/agent-session-send-user-message-expand.test.ts fails at import because src/export/html/tool-views.generated.js is absent in this checkout; no assertions ran.
Thanks for the detailed repro and test coverage, @andrebrait.


### Added

- Extensions can pass `expandPromptTemplates: true` to `pi.sendUserMessage()` so a `/skill:<name>` command or prompt template they send expands like typed input, matching Pi; Pi extensions with skill-alias commands now load the skill instead of sending the literal command text ([#14608](https://github.com/can1357/oh-my-pi/pull/14608) by [@andrebrait](https://github.com/andrebrait))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should-fix: This user-facing entry lacks the external-contribution attribution required by the changelog convention. Append ([#14608](https://github.com/can1357/oh-my-pi/pull/14608) by [@andrebrait](https://github.com/andrebrait)) so release notes credit the contributor and link the PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already in the reviewed commit. In 469f77c98e, CHANGELOG.md:11 ends with ([#14608](https://github.com/can1357/oh-my-pi/pull/14608) by [@andrebrait](https://github.com/andrebrait)). About the blocked verification: tool-views.generated.js is a build-generated file. With it present, bun test packages/coding-agent/test/agent-session-send-user-message-expand.test.ts passes 9/9 locally.

andrebrait added a commit to andrebrait/oh-my-pi that referenced this pull request Oct 7, 2026
… sendUserMessage

Squashed from origin/fix/send-user-message-expand-templates (469f77c) onto upstream/main.
@andrebrait
andrebrait force-pushed the fix/send-user-message-expand-templates branch from 469f77c to 087a0b8 Compare October 7, 2026 19:53
andrebrait added a commit to andrebrait/oh-my-pi that referenced this pull request Oct 7, 2026
… sendUserMessage

Squashed from origin/fix/send-user-message-expand-templates (087a0b8) onto upstream/main.
andrebrait added a commit to andrebrait/oh-my-pi that referenced this pull request Oct 7, 2026
… sendUserMessage

Squashed from origin/fix/send-user-message-expand-templates (087a0b8) onto upstream/main.
@andrebrait
andrebrait force-pushed the fix/send-user-message-expand-templates branch from 087a0b8 to 397dc39 Compare October 7, 2026 21:54
andrebrait added a commit to andrebrait/oh-my-pi that referenced this pull request Oct 7, 2026
… sendUserMessage

Squashed from origin/fix/send-user-message-expand-templates (397dc39) onto upstream/main.
@andrebrait
andrebrait force-pushed the fix/send-user-message-expand-templates branch from 397dc39 to 74eb9b4 Compare October 8, 2026 07:17
andrebrait added a commit to andrebrait/oh-my-pi that referenced this pull request Oct 8, 2026
… sendUserMessage

Squashed from origin/fix/send-user-message-expand-templates (74eb9b4) onto upstream/main.
@andrebrait
andrebrait force-pushed the fix/send-user-message-expand-templates branch from 74eb9b4 to 292f462 Compare October 9, 2026 01:11
andrebrait added a commit to andrebrait/oh-my-pi that referenced this pull request Oct 9, 2026
… sendUserMessage

Squashed from origin/fix/send-user-message-expand-templates (292f462) onto upstream/main.
@andrebrait
andrebrait force-pushed the fix/send-user-message-expand-templates branch from 292f462 to 17ad75d Compare October 9, 2026 20:22
andrebrait added a commit to andrebrait/oh-my-pi that referenced this pull request Oct 9, 2026
… sendUserMessage

Squashed from origin/fix/send-user-message-expand-templates (17ad75d) onto upstream/main.
andrebrait added a commit to andrebrait/oh-my-pi that referenced this pull request Oct 9, 2026
… sendUserMessage

Squashed from origin/fix/send-user-message-expand-templates (17ad75d) onto upstream/main.
andrebrait added a commit to andrebrait/oh-my-pi that referenced this pull request Oct 9, 2026
… sendUserMessage

Squashed from origin/fix/send-user-message-expand-templates (17ad75d) onto upstream/main.
@andrebrait
andrebrait force-pushed the fix/send-user-message-expand-templates branch from 17ad75d to 2c77bcc Compare October 10, 2026 07:32
andrebrait added a commit to andrebrait/oh-my-pi that referenced this pull request Oct 10, 2026
… sendUserMessage

Squashed from origin/fix/send-user-message-expand-templates (2c77bcc) onto upstream/main.
@andrebrait
andrebrait force-pushed the fix/send-user-message-expand-templates branch from 2c77bcc to 135fda3 Compare October 11, 2026 09:46
andrebrait added a commit to andrebrait/oh-my-pi that referenced this pull request Oct 11, 2026
… sendUserMessage

Squashed from origin/fix/send-user-message-expand-templates (135fda3) onto upstream/main.
@andrebrait
andrebrait force-pushed the fix/send-user-message-expand-templates branch from 135fda3 to 2e7f16e Compare October 12, 2026 08:09
andrebrait added a commit to andrebrait/oh-my-pi that referenced this pull request Oct 12, 2026
… sendUserMessage

Squashed from origin/fix/send-user-message-expand-templates (2e7f16e) onto upstream/main.
andrebrait added a commit to andrebrait/oh-my-pi that referenced this pull request Oct 12, 2026
… sendUserMessage

Squashed from origin/fix/send-user-message-expand-templates (2e7f16e) onto upstream/main.
@andrebrait
andrebrait force-pushed the fix/send-user-message-expand-templates branch from 2e7f16e to 5a7f7a6 Compare October 13, 2026 06:59
andrebrait added a commit to andrebrait/oh-my-pi that referenced this pull request Oct 13, 2026
… sendUserMessage

Squashed from origin/fix/send-user-message-expand-templates (5a7f7a6) onto upstream/main.
Pi's sendUserMessage accepts expandPromptTemplates (default false) so an extension can dispatch a /skill:<name> command or a prompt template like typed input. omp kept the original hardcoded false and had no option, so Pi extensions with skill-alias commands (for example ponytail's /ponytail-review) sent the literal '/skill:...' text and the model never saw the skill.

Add the opt-in option. When set, a registered /skill: command is built into a user-attributed skill message and delivered on every path (idle, steer, follow-up, aside); other text gets prompt-template expansion, and only the prompt() path runs extension/custom/file slash commands, matching steer()/followUp().
@andrebrait
andrebrait force-pushed the fix/send-user-message-expand-templates branch from 5a7f7a6 to 16aa9d4 Compare October 13, 2026 16:16
andrebrait added a commit to andrebrait/oh-my-pi that referenced this pull request Oct 13, 2026
… sendUserMessage

Squashed from origin/fix/send-user-message-expand-templates (16aa9d4) onto upstream/main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Agent runtime planning and orchestration feat prompting Prompt templates and prompt assembly review:p2 sdk SDK and extension integration surface triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants