Skip to content

fix: strip prompts/ prefix from config paths to avoid duplication#196

Merged
sven1103 merged 1 commit intomainfrom
fix/prompt-path-duplication
Apr 16, 2026
Merged

fix: strip prompts/ prefix from config paths to avoid duplication#196
sven1103 merged 1 commit intomainfrom
fix/prompt-path-duplication

Conversation

@sven1103-agent
Copy link
Copy Markdown
Collaborator

Summary

  • Fixes path duplication bug where config path prompts/coder.md resulted in destination .opencode/prompts/prompts/coder.md
  • Normalizes paths by stripping leading prompts/ prefix before determining destination
  • Adds validation to fail with clear error if normalized path would be empty (e.g., config says just "prompts")

Behavior

Config Source Destination
"prompts/coder.md" bundle/prompts/coder.md .opencode/prompts/coder.md
"coder.md" bundle/coder.md .opencode/prompts/coder.md
"prompts/sub/coder.md" bundle/prompts/sub/coder.md .opencode/prompts/sub/coder.md
"prompts" - ERROR (fails with clear message)

Previously, config paths like "prompts/coder.md" would result in
destination .opencode/prompts/prompts/coder.md (duplicated prompts/).

Now the CLI normalizes paths by stripping the leading "prompts/" prefix
before determining the destination, ensuring the output matches the
config structure.

Also adds validation to fail with a clear error if the normalized
path would be empty (e.g., config just says "prompts").
@sven1103 sven1103 merged commit 527ccd6 into main Apr 16, 2026
8 checks passed
@sven1103 sven1103 deleted the fix/prompt-path-duplication branch April 16, 2026 17:34
@sven1103 sven1103 added the kind:fix Release notes: bug fix label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:fix Release notes: bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants