feat: change default port from 6969 to 3207 with fallback chain#273
Merged
Conversation
2c70887 to
d53156e
Compare
Replace the hardcoded default port 6969 with a fallback chain: 3207 (primary, upside-down calculator = LORE) -> 5673 (T9 phone keypad = LORE) -> OS-assigned random port. The fallback only activates when the port is taken by a non-lore process; explicit --port / LORE_LISTEN_PORT skips the chain entirely. Key changes: - Add DEFAULT_PORTS/DEFAULT_PORT constants and portExplicit flag to GatewayConfig - Add port file (~/.local/share/lore/gateway.port) so plugins can discover the gateway even on a random fallback port - Fix port 0 + multi-host binding (pin resolved port after first Bun.serve so all hosts share the same actual port) - Rewrite startGateway() with the fallback loop + port file mgmt - Export startGateway/probeGateway/readPortFile from gateway package - Refactor both OpenCode and Pi plugins to use resolveGatewayUrl() (probes port file + known defaults) and delegate to startGateway() instead of duplicating startup/EADDRINUSE logic - Update all docs, help text, and comments from 6969 to 3207
d53156e to
65eb16f
Compare
This was referenced May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
6969with a fallback chain: 3207 (primary) -> 5673 (fallback) -> random OS-assigned port~/.local/share/lore/gateway.port) so plugins find the gateway even on a random fallback portstartGateway()instead of duplicating startup logicPort Mnemonics
Details
Gateway core
config.ts: AddedDEFAULT_PORTS = [3207, 5673],DEFAULT_PORT, andportExplicitflag toGatewayConfigportfile.ts(new):writePortFile(),readPortFile(),removePortFile()for plugin discoveryserver.ts: Fixed port 0 + multi-host binding — pins resolved port after firstBun.serve()so all hosts share the same actual portstart.ts: RewrotestartGateway()with fallback loop. Explicit--port/LORE_LISTEN_PORTskips the chain.index.ts: ExportedstartGateway,probeGateway,readPortFile,DEFAULT_PORTS,DEFAULT_PORTPlugins
http://127.0.0.1:6969withresolveGatewayUrl()(probes port file + known defaults). RefactoredstartInProcess()to delegate tostartGateway(), eliminating duplicated EADDRINUSE handling.Docs
6969across help text, CLI comments, README, and landing pageVerification
bun run typecheck— all 4 packages passbun test— 1,304 tests pass, 0 fail (core: 772, gateway: 523, opencode: 9)bun run build— all packages build successfully6969in source/docs