Skip to content

Conversation

@bartman
Copy link

@bartman bartman commented Nov 25, 2025

fix #83

  • calling out to lsof now allows matches on opencode and bun in comm field
  • after first pass, make sure the command line actually contains opencode string

@bartman bartman mentioned this pull request Nov 25, 2025
3 tasks
@NickvanDyke
Copy link
Owner

Thanks! I don't think /proc supports MacOS unfortunately - is there any way to do this without?

@bartman
Copy link
Author

bartman commented Nov 26, 2025

Thanks! I don't think /proc supports MacOS unfortunately - is there any way to do this without?

Now I understand why you were using lsof to get the cwd... I used /proc/ to avoid the exec step... but that's a regression.

I'll rework it to use lsof.

@bartman
Copy link
Author

bartman commented Nov 26, 2025

@NickvanDyke can you check on OSX if this returns the full command line?

(substitute PID with your opencode PID)

❯ ps -p $PID -ww -o args=
opencode run /nix/store/ymw5140h3x670lwb6l1ifhr3pgi222dx-opencode-1.0.105/lib/opencode/dist/index.js

@bartman
Copy link
Author

bartman commented Nov 26, 2025

I've rewritten the code to use lsof and ps executables, instead of poking at /proc.
Hopefully that works for you as well.

Do you think I should add ps to the list of checks in lua/opencode/health.lua ?
Or is that standard on OSX ?

@NickvanDyke
Copy link
Owner

NickvanDyke commented Nov 26, 2025

Thank you!

ps is available standard on MacOS. iirc based on a comment above the lsof usage though, its output changed a bit by platform. Hence I experimented with lsof flags until it completely replaced ps. However I'm not sure lsof can accomplish what you did with ps here: checking command args too 🤔

I'm trying to stay away from coding during the holidays haha but I'll give this a try after 🙂 Let me know if the issue persists for you on newer versions of opencode too. Or I wonder if it's worth asking them to keep the command name stable, since it's essentially part of the interface.

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.

bug: cannot find opencode process

2 participants