Skip to content

fix(chat): add prompt tools when running prompt slash commands#3012

Merged
olimorris merged 1 commit intoolimorris:mainfrom
petobens:slash-tools
Apr 10, 2026
Merged

fix(chat): add prompt tools when running prompt slash commands#3012
olimorris merged 1 commit intoolimorris:mainfrom
petobens:slash-tools

Conversation

@petobens
Copy link
Copy Markdown
Contributor

@petobens petobens commented Apr 9, 2026

Description

When a prompt library entry is invoked via a slash command, any tools declared
on that prompt were not being added to the active chat buffer first.

This PR fixes that by registering prompt-declared tools before the prompt
content is inserted.

Changes included:

  • add prompt tools in SlashCommands.run() for prompt-library entries
  • support both single tools and tool groups
  • add tests covering both cases
  • document the behavior in prompt-library.md

This makes slash-command usage consistent with prompt definitions that rely on
tools being available in the current chat.

AI Usage

GPT-5.4 was used mostly for tests, docs, and general boilerplate such as
docstrings.

Related Issue(s)

Screenshots

Peek 2026-04-09 20-45

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I confirm that this PR has been majority created by me, and not AI (unless stated in the "AI Usage" section above)
  • I've run make all to ensure docs are generated, tests pass and StyLua has formatted the code
  • (optional) I've added test coverage for this fix/feature
  • (optional) I've updated the README and/or relevant docs pages

Register tools declared in prompt library entries before inserting prompt
content, and document the behavior with test coverage.
@olimorris olimorris merged commit 9724e13 into olimorris:main Apr 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants