opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Can't seem to get the debugger running

Open cityvibes45 opened this issue 1 month ago • 6 comments

Question

I am following the contribution guide and trying to set up the debugger, however I am running bun run --inspect=ws://localhost:6499/ dev spawn and opencode is launching in that terminal, but I can't attach to it, because it's not running on the port (lsof -i :6499 -S is blank)

Can someone help me properly get the debugger working? I'm using Webstorm on linux, thanks.

cityvibes45 avatar Dec 12 '25 16:12 cityvibes45

you should be able to specify which port it spawns on.

Tbh I haven't used the debugger before that was added by a contributor who uses it otherwise I'd try to help more here

rekram1-node avatar Dec 12 '25 19:12 rekram1-node

Yeah that's what specifying the '6499' is supposed to do, I don't know where it's defaulting to, or if its even enabling debugging at all. I want to contribute/fork this project, but I don't know how I can really develop for it if debugging is going to be a pain.

cityvibes45 avatar Dec 12 '25 19:12 cityvibes45

Did you try the --port flag?

rekram1-node avatar Dec 12 '25 20:12 rekram1-node

I've tried it with bun run dev -- --port=6499 and I've managed to get opencode running on the port, however I still don't have a clue how to access the debugger, its seems its just the --inspect flag is the problem, no debug.bun.sh popup or anything just straight to opencode in the terminal.

cityvibes45 avatar Dec 12 '25 20:12 cityvibes45

If I get a chance Ill try to properly setup a debugger, I normally just log to file

rekram1-node avatar Dec 12 '25 20:12 rekram1-node

OK thanks, I'll work with that way for now

cityvibes45 avatar Dec 12 '25 20:12 cityvibes45