feat: lore start defaults to hosted mode, opt out with --local#334
Merged
Conversation
`lore start` (headless server) now enables hosted mode by default, disabling all FS operations on client-controlled paths. This is the safe default for remote/shared deployments. Opt out with `lore start --local` or `LORE_HOSTED_MODE=0` for local use cases where FS ops are needed. `lore run` and `lore import` are unaffected — they always run in local mode since the agent/history is on the same machine.
- C1: Fix type cast in main.ts to include `local` field - M1: Make `config` param required in `initIfNeeded()` (all call sites already pass it — removes latent footgun) - M3: Add early `isHostedMode()` check in `tryImportKnowledge()` - M5: Log note when reusing existing gateway about hosted mode state - M6: Add 11 tests for hosted mode config defaulting logic (loadConfig env var handling + startGateway three-tier precedence)
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
lore startnow enables hosted mode by default — all FS operations on client-controlled paths are disabled--local/-lCLI flag to opt out (keeps FS ops active for local use)LORE_HOSTED_MODE=0env var also opts outlore runandlore importare unaffected — always local modeRationale
lore start(headless server, no agent launched) is the natural entry point for hosted/shared deployments. Making hosted mode the default means:lore startlocally for personal use can opt out with--localBinding IP is not a reliable signal for hosted vs local — users may bind to Tailscale IPs, use Argo tunnels, etc. while still being "local". The explicit
--localflag is clearer.Precedence
--localCLI flag (highest)LORE_HOSTED_MODEenv var (explicit0or1)lore start→ hosted ON,lore run/lore import→ hosted OFF