Skip to content

refactor: replace Express instance bridge with Electron single-instance lock#167

Open
nat-openclaw wants to merge 1 commit into
mainfrom
nat-openclaw/issue-163-issue-163-1780876281291-9xvbro
Open

refactor: replace Express instance bridge with Electron single-instance lock#167
nat-openclaw wants to merge 1 commit into
mainfrom
nat-openclaw/issue-163-issue-163-1780876281291-9xvbro

Conversation

@nat-openclaw

Copy link
Copy Markdown
Collaborator

Summary

  • Replaces the HTTP /internal/* instance bridge on port 7654 with Electron's requestSingleInstanceLock() and second-instance event
  • Simplifies addon-server.ts to run AddonServer directly without Express
  • Removes express and @types/express dependencies from the application package

Closes #163

Test plan

  • bun run typecheck in application/
  • Launch OGI twice — second instance should focus the first (no duplicate window)
  • Steam shortcut / --game-id= on second launch forwards game launch to running instance
  • --pre / --post / --no-launch hook launches work on second instance
  • Wrapper command after -- still works on second instance
  • Addon WebSocket connectivity on port 7654 still works

Made with Cursor

…ce lock

Use app.requestSingleInstanceLock and the second-instance event for
focus and launch handoff instead of HTTP /internal routes on port 7654.
Simplify addon-server to run AddonServer directly without Express.
@vercel

vercel Bot commented Jun 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
open-game-installer-web Ready Ready Preview, Comment Jun 7, 2026 11:54pm

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8d9fe58a-850e-4d09-bb99-a8af3fc17c0c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nat-openclaw/issue-163-issue-163-1780876281291-9xvbro

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Nat3z Nat3z left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really clean, but will this allow for, if an instance is open already and steam requests launch, have it still launch the game via the existing instance @nat-openclaw /ask

@nat-openclaw

nat-openclaw commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

I hit an infra error before I could finish:

git fetch --all --prune failed with 1
fatal: bad object 796afcf634b63e66e45f8fc0d51a4bb9c5994407
error: https://github.com/Nat3z/OpenGameInstaller.git did not send all necessary objects

React to this comment with 🚀 to retry.

@Nat3z

Nat3z commented Jun 10, 2026

Copy link
Copy Markdown
Owner

@nat-openclaw try again /ask

@nat-openclaw

nat-openclaw commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

Asked and answered — no code changes were made for /ask.

@nat-openclaw

Copy link
Copy Markdown
Collaborator Author

Yep — Steam launching a second process should still work.

With this refactor, the second launch is handled by Electron’s second-instance event instead of the old /internal/* HTTP bridge. If that second instance includes --game-id=..., the first instance routes it through handleRemoteLaunchRequest(), so it still runs the launch flow in the already-open app (including pre/post hooks and wrapper handling). If there’s no game id, it just brings the existing window to the front.

So: no duplicate app, still launches the game. Tiny bit less HTTP, same “do the right thing” energy.

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.

Remove unnecessary Express server in addon-server.ts - implement single-instance locking

2 participants