Skip to content

fix: resolve @file references in slash commands with subagents - #4221

Merged
rekram1-node merged 1 commit into
anomalyco:devfrom
ribelo:refactor-prompt-parts
Nov 12, 2025
Merged

rekram1-node merged 1 commit into
anomalyco:devfrom
ribelo:refactor-prompt-parts

Conversation

@ribelo

@ribelo ribelo commented Nov 11, 2025

Copy link
Copy Markdown
Contributor

Fixes an issue where @file references in custom slash commands were not resolved
when the command specified agent: <subagent>.

Problem

When a slash command used both @file references and agent: foo, the file references
were passed literally to the subagent instead of being resolved to actual file
contents. This worked correctly for normal commands but failed for subagent
dispatch.

Solution

Extracted resolvePromptParts() function and reused it in the task tool pipeline
(packages/opencode/src/tool/task.ts:68) to ensure @file references are resolved
before subagent execution, matching the behavior of normal command handling.

@rekram1-node
rekram1-node merged commit 491a2ad into anomalyco:dev Nov 12, 2025
@rekram1-node

Copy link
Copy Markdown
Collaborator

nice thanks!

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