Skip to content

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

Merged
sven1103 merged 1 commit into
mainfrom
fix/prompt-path-duplication-v2
Apr 16, 2026
Merged

fix: strip prompts/ prefix from config paths to avoid duplication#200
sven1103 merged 1 commit into
mainfrom
fix/prompt-path-duplication-v2

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)

Testing

  • All unit tests pass
  • All e2e tests pass

Previously, config paths like 'prompts/coder.md' resulted 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 force-pushed the fix/prompt-path-duplication-v2 branch from ffb910e to 16cacf4 Compare April 16, 2026 19:04
@sven1103 sven1103 merged commit 66b5188 into main Apr 16, 2026
8 checks passed
@sven1103 sven1103 deleted the fix/prompt-path-duplication-v2 branch April 16, 2026 19:06
@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