Repository navigation
Description
If command wasn't able to attach some file, it fails with an empty conversation, nothing is started or printed. For a long time through many tries I wasn't able to notice an error notification shown for a short moment.
Failed to execute command: POST
"http://127.0.0.1:61853/session/ses_7059cd4d0ffeVTj7A09Qnc6ISq/co
mmand": 400 Bad Request {"name": "UnknownError"
, "data": {"message": "Error: File not found:
/path/to/app//(.author.login"}}
-
I think the current behavior of silent failure with only a cryptic message shown is a really bad experience. I propose to improve the failure information and clearly state in the conversation that the command failed to start because of the error. And specify that the specific file mentioned in the command wasn't loaded.
-
I propose to add support for launching comments even when some mentioned file was not loaded. I think in many cases this would be a desirable behavior, but probably this should be optional.
-
And finally, the problem itself specific to my case was that OpenCode is trying to interpret parts of the command prompt that it shouldn’t actually interpret in any way. I mean the code blocks and inline code in Markdown.
Example snippet from my command (I'm symlinking the commands from Claude Code):
1. Run this to show a context to the user:
`gh pr list --state open --json number,title,headRefName,author,comments,reviews,additions,deletions,isDraft,updatedAt --jq '.[] | "\("#" + (.number | tostring) | .[0:4] + " " * (4 - length)) \(if .isDraft then "📝 " else "✨ " end)\(.title | .[0:80] + " " * (80 - (.[0:80] | length))) @\(.author.login | .[0:12] + " " * (12 - (.[0:12] | length))) \(.headRefName | .[0:30] + " " * (30 - (.[0:30] | length))) 💬\(.comments | length)/🧵\((.reviews | length | tostring) + " " * (2 - (.reviews | length | tostring | length))) +\((.additions | tostring) + " " * (4 - (.additions | tostring | length)))/-\((.deletions | tostring) + " " * (4 - (.deletions | tostring | length))) \(.updatedAt[0:10])"'`
Shows: `PR# ✨/📝 Title(80ch) @author branch(30ch) 💬comments/🧵reviews +adds/-dels date`From this specific case it was trying to interpret @\(.author.login as a file reference!
And the same problem is for the @author on the next line inside the inline code.
Please make opencode to not interpret content inside the backticks. For both triple backticks code blocks and inline code formatting.
Activity
github-actions commentedon Aug 30, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Aug 30, 2025
the backticks thing is going to get fixed v soon things for raising, as for expected behavior when a file doesnt exist, do you think it would be better to let command go through but then toast for a file that doesnt exist?
So if I do:
@non-existant
instead of seeing Failed Command, Id see the command actually go through but then an error toast saying it failed to read a particular file?
rekram1-node commentedon Aug 30, 2025
what do you think?
art-shen commentedon Aug 30, 2025
If the behavior is clear for the user (explicitly shown that the command wasn't able to load some files), I guess it's more practical and convenient for the command to still go through.
I can imagine some cases when there is no sense for a command to even try to work if it wasn't able to load the files. But if it's clear immediately that files weren’t loaded, I don't think it is a critical problem or something. User would be able to act on it and resolve it if it is important.
rekram1-node commentedon Sep 3, 2025
should be fixed in next release