Repository navigation
feat: use Ovis names for settings, cookies, state and storage, keeping the old ones working - #1648
Conversation
…g the old ones working Second of the layered Ovis rebrand. HERDR_WEB_* settings become OVIS_* (HERDR_WEB_UI_REF becomes OVIS_REF); every entry point adopts an unset OVIS_* from its old name first. The token and device cookies become ovis_token and ovis_device; the old cookies still sign in, count as session-bearing for the origin check, and are cleared at sign-in, pairing and sign-out. The state dir moves from ~/.config/herdr-web-ui to ~/.config/ovis on first use, leaving a link at the old path. Browser storage keys move from herdr-web-ui:* to ovis:* before the app reads them. The offline cache, pasted-file dir (.ovis), Codex client identity, User-Agent and plugin invocation_source follow. Remote bundle and bridge paths stay for the release-path PR.
…er install over A file outside CARRY_OVER that names a HERDR_WEB_* setting, a herdr_web_* cookie or a herdr-web-ui: storage key fails scripts/conventions.test.ts with the Ovis name to use, so a branch written before the rename cannot bring the old names back once it is rebased.
|
Important Review skippedToo many files! This PR contains 290 files, which is 140 over the limit of 150. To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configuration
📒 Files selected for processing: 290
You can disable this status message by setting the
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. Comment |
… dir from a test Review fixes for the Ovis runtime names. A token changed in the plugin's env file under its old name won over the new name the parent's environment had copied, so the server kept the old token: each layer is now mapped by itself and then merged (mergeEnvLayers), and the side-effect mapping moved to adopt-legacy-env.ts for the entry points. defaultStateDir() only resolves where the state is and moves nothing, so a test or a script that imports update-state.ts no longer moves a real state dir (windows-plugin.test.ts did). The move runs once per process in the launcher, supervisor and server. The old dir is followed when it is a link, an empty new dir no longer hides it, and when both hold files the old one stays in use with a message. A storage-less WebView no longer stops the app from starting.
…shing When an empty ~/.config/ovis existed, two processes of one install starting at once could both try to remove it, and the loser died at startup. The loser now carries on when the dir is already gone, warns about both dirs holding files only when the old one still does, and a config dir it cannot read resolves to the new name instead of throwing.
Deploying ovis with
|
| Latest commit: |
f589388
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7077bf71.ovis.pages.dev |
| Branch Preview URL: | https://fix-flaky-windows-launcher-r.ovis.pages.dev |
|
CodeRabbit did not review this PR: it skipped it (289 files, over its 150-file limit, and no usage credits). Because the PR touches authentication (cookie names), it got a substitute review instead, by a code-review agent focused on auth, secrets, the state dir move, env precedence and browser storage. First pass (on cf68abd), request changes:
Second pass (on 93c93fd), approve, with one medium finding:
Confirmed fine:
|
#1651) ## Change How PRs get reviewed while CodeRabbit cannot keep up with the rebrand and the coming refactor: - **Skipped reviews.** A skipped review ("Review skipped", e.g. a PR of more than 150 files) counts as no review, like a rate-limited one. A PR that needs a review stays under 150 files. - **PRs that need a real review** (`--takeover`, observe permissions, queued input, authentication, HTTP/WS contracts, workflows) can be reviewed by a code-review agent when CodeRabbit skips them. Its findings and how each was resolved go in a PR comment before the merge, as on #1648. - **Move-only PRs** (files moved or split, imports updated, no behaviour change) do not wait for CodeRabbit. They merge on their checks once `git diff --color-moved` shows only moved code and import paths. - Every PR merged without a CodeRabbit review says so in a comment. - `docs/development.md` no longer says every PR asks for `@coderabbitai review` on its final head before merging; it points to AGENTS.md. Why: in the last 25 PRs, CodeRabbit skipped the two over 150 files (#1648 at 290, #1637's later pushes at 161) and was rate-limited on three (#1592, #1597, #1598). The refactor is many move-only PRs, where a review finds little and waiting on the hourly allowance costs hours. Docs only; no changelog fragment (nothing users notice).
…the rename (#1723) ## Problem Updating in the app from 0.4.13 to the next release breaks the handover to the new release's supervisor. An update never replaces the running launcher (`server/managed.ts`), so after the install the 0.4.13 launcher starts the new release's supervisor. That launcher names the checkout `HERDR_WEB_SOURCE_ROOT` and looks for the active release only under `~/.config/herdr-web-ui/updates/<hash>/`. The new supervisor first moves `~/.config/herdr-web-ui` to `~/.config/ovis` (#1648), then accepts a saved release only under the new path. The `current.json` the 0.4.13 supervisor wrote names `~/.config/herdr-web-ui/.../release-*`, so the new supervisor ignores it and starts the bridge from the source checkout, which is still 0.4.13. That bridge reads `HERDR_WEB_BOOT_ID`, not `OVIS_BOOT_ID`, so it fails the supervisor's startup health check. The new supervisor exits before it is ready, and the launcher falls back to the 0.4.13 supervisor, which shows "The updated supervisor failed to start". By then the state dir has already moved out from under the launcher. The same failure repeats on every later update. A new supervisor that did get to install would not help either: the new supervisor records the release under `~/.config/ovis/...`, the 0.4.13 launcher rejects that path and starts its own supervisor, and that one rejects it too. ## Change - `server/legacy-env.ts`: `legacyLauncherStateDir(env)` tells whether a launcher from before the rename started this supervisor (`HERDR_WEB_SOURCE_ROOT` set, `OVIS_LAUNCHER` unset). If one did, it returns that launcher's state dir (`HERDR_WEB_STATE_DIR`, else `$XDG_CONFIG_HOME/herdr-web-ui`). The helper sits in this file because it is already in `CARRY_OVER`, the conventions test's list of files allowed to use the old names. - `server/supervisor.ts`: under such a launcher, the supervisor does not move the state dir. It uses the old dir for app state and update state, and hands that dir to its bridge as `OVIS_STATE_DIR`, so the bridge does not move it either. The move waits for a launcher of this version, which runs once the app starts from an updated source checkout or plugin. - `server/supervisor.ts`, `server/legacy-env.ts` (`withLegacyNames`): under such a launcher, the supervisor also hands its bridge the old names of what it sets (`HERDR_WEB_MANAGED`, `HERDR_WEB_BOOT_ID`, `HERDR_WEB_STATE_DIR`, `HERDR_WEB_REVISION`). When a saved release fails to start, the supervisor falls back to the source checkout, and under an old launcher that checkout is 0.4.13, whose bridge reads only the old names. Without them it could not answer the health check. After a second update, the old launcher's own fallback is the previous release's supervisor, which does the same thing, so the app stayed down. Even a bridge that did come up would not be managed, so it could not update again. - `server/managed.ts`: the launcher sets `OVIS_LAUNCHER=1`, so the supervisors it starts keep moving the state dir as before. The candidate fix put the same logic in `supervisor.ts`, but that file is not in `CARRY_OVER`, so the "names from before Ovis" conventions test fails on it. Moving the logic into `legacy-env.ts` keeps the conventions test passing without editing it. ## Test `server/legacy-env.test.ts` gets three supervisor tests and a mapping test. Each supervisor test runs the real `runSupervisor` and the real `Updater` against a git fixture shaped like a 0.4.13 install that has just installed a release. The bridge's start is recorded and its health check is answered. - Started the way the 0.4.13 launcher starts it, the supervisor runs the installed release, and the state stays in `herdr-web-ui`. Before this fix, the bridge started from the source checkout: `Expected: …/config/herdr-web-ui/updates/<hash>/release-next`, `Received: …/checkout`. - Started by the 0.4.13 launcher with a saved release that fails, the supervisor falls back to the source checkout and hands that bridge `HERDR_WEB_BOOT_ID`, `HERDR_WEB_MANAGED`, `HERDR_WEB_STATE_DIR` and `HERDR_WEB_REVISION`. In the stand-in, the source checkout's bridge reads only the old names, as 0.4.13's does. On 492f1da this test fails: the bridge in `…/checkout` cannot answer the boot id it was given. - Started by a launcher of this version, the supervisor still moves the state dir to `ovis` and leaves a link at the old path. `bun run check fast` passes. Manual check with the real 0.4.13 launcher: a clone checked out at tag `v0.4.13` ran `bun server/managed.ts` against an installed release under a temp `XDG_CONFIG_HOME` and the isolated `ovis-test` herdr session. - With the release at current main, the release's supervisor logs "The new bridge failed its startup health check." The launcher then falls back to the 0.4.13 supervisor, and the state dir has already been moved and replaced by a link. - Two updates with a release that fails (scripted, `/tmp/ovis-qa-two-updates.ts`). The real 0.4.13 launcher installs two releases through `/api/updates`. The second release's bridge passes its install check but exits at its next start, under its own supervisor. - On 492f1da: release 2's supervisor falls back to the 0.4.13 source bridge, which fails the health check. The launcher then falls back to release 1's supervisor, which fails the same way, and the launcher exits 1. The app is down. - On this head: the source bridge answers, and the app is up on 0.4.13. `/api/updates` reports it as managed with no error, so the user can update again, and the launcher stays up. - With the release at this branch, `/api/health` served the release's revision from the release's own supervisor, with no fallback. `~/.config/herdr-web-ui` stayed a real directory, and `current.json` was kept.
main renamed the history entry and settings keys to ovis: (#1648); the branch scope's history test and browser check still wrote the old ones.
## What this does for the user Files pasted or attached in the browser are saved in `<pane cwd>/.ovis/` so the agent can read them without a permission prompt. Until now every upload showed up as an untracked change in the project's `git status`. The default `.ovis` folder now ignores itself. Right after the server creates the folder, it writes a `.gitignore` containing `*`. The file is created exclusively (`wx`, mode `0600`), so: - an ignore file already in that folder, or a symlink at that path (dangling or not), is never followed, read or replaced (only `EEXIST` is tolerated); - any other create error fails the upload with an error instead of returning a path; - a folder set through `OVIS_PASTE_DIR` (trimmed, `~` expanded, even one equal to the default path) is the user's own and gets no ignore file. Ignored files still open by their explicit path, and the path the prompt names is unchanged. Known trade-off, raised in review: Git-backed `@` file completion lists files with `git ls-files --exclude-standard`, so in a Git project a pasted file no longer appears there. Looking it up by path or bare name still works. Keeping pastes out of the project's Git view is the purpose of this change, so the PR keeps it. ## Why This was a local-only branch (`fix/default-paste-gitignore`) that was never pushed. It is rebased onto current main and ported to the `.ovis` / `OVIS_PASTE_DIR` names from #1648. On main the paste route still only does `mkdirSync`, so the bug still reproduces there. It does not overlap with #1795, which changes only Pi delivery and pending-message files and touches neither `server/paste.ts` nor its tests. ## How it was verified - `server/paste.test.ts` and `server/file-view.test.ts`: all 49 pass. They cover the self-ignoring default folder, the temp-dir fallback, an existing ignore file and file or dangling symlinks kept byte for byte, overrides (trimmed, `~`, equal to the default) getting no ignore file, and an unwritable folder reporting `EACCES`. - The `POST /api/pane/image` contract tests run on an isolated herdr session against a temporary Git project: - `git status` is empty after two concurrent uploads; - `git check-ignore` names each returned path, and the bytes read back through `/api/fs/file`; - concurrent uploads keep a custom ignore file and file or dangling symlinks; - overrides get no ignore file; - an unwritable folder answers 500 with no path. - `bun run check fast` - Reviews: `omo-native-code-reviewer` found no HIGH findings and recommended APPROVE (the MEDIUM finding is the completion trade-off above). Codex (`gpt-6-astra`) found nothing. No HTTP/WS contract, auth or workflow change. --------- Co-authored-by: mp <mp@local>
Change
Second layer of the Ovis rebrand (after #1579 and #1641): the runtime identifiers move to Ovis names, and every old name keeps working for installs from before.
HERDR_WEB_*becomeOVIS_*(HERDR_WEB_UI_REFbecomesOVIS_REF). Every entry point (server/index.ts,managed.ts,supervisor.ts,remote-entry.ts,scripts/plugin.ts) first importsserver/legacy-env.ts, which fills an unsetOVIS_*from its old name; set under both names, theOVIS_*one wins. The plugin applies the same to its env files.install.sh/install.ps1read the old names too. The token is removed from the PTY sidecar's environment under both names, and a remote PC is started with the herdr path under both names (bundles published before read the old one).herdr_web_token/herdr_web_devicebecomeovis_token/ovis_device. The old cookies still sign in, still count as session-bearing for the cross-site check (machine-security.ts), and are cleared at sign-in, pairing and sign-out.~/.config/herdr-web-uimoves to~/.config/ovison first use (server/update-state.ts), leaving a link at the old path for a launcher, plugin or older release; if the move fails, the old dir stays in use. The plugin and installer find either.herdr-web-ui:*keys move toovis:*before anything reads them:src/lib/legacyStorage.tsis the first import ofmain.tsxand of the theme boot script (src/theme-bootstrap.ts, which paints the first frame beforemain.tsxruns). The old key is removed in the same step so a cleared draft or queue cannot come back.<pane cwd>/.ovis; offline cacheovis-v4-ram/ovis-files-v1(the worker already retires caches of other names); Codex client identity, usage User-Agent, keychain job label and plugininvocation_sourcesay ovis; the Mac app passesOVIS_NO_OPEN.scripts/conventions.test.ts"names from before Ovis" fails on aHERDR_WEB_*setting,herdr_web_*cookie,herdr-web-ui:key or.herdr-web-uipaste dir outside the files that carry an old install over (CARRY_OVER), with the Ovis name to use. It already caught the theme boot script and nine files added to main since this branch started.ovis-testlabels too.Deliberately unchanged
The remote PC bundle and bridge paths (
~/.local/share/herdr-web-ui/remote-vN,~/.config/herdr-web-ui/bridges): bundles already published (remote-v31) write there. The telemetry Worker andshared/telemetry.ts(hash-pinned to the deployed Worker). The plugin id and repository URL (next PR, after the repository rename). External herdr names (HERDR_SOCKET,HERDR_TEST_*,HERDR_PLUGIN_*).Validation
server/legacy-env.test.ts,server/update-state.test.ts(move + link, untouched once the new dir exists, nothing created on a fresh install,OVIS_STATE_DIRwins),src/lib/legacyStorage.test.ts, old-cookie cases inserver/auth.test.ts, the conventions guard (checked to fail on a probe file with an old key, env name and paste dir).bun run check faston this branch (on main 56b48ad): workflow syntax, generated files, typecheck, build and unit tests pass.HERDR_WEB_TOKENand a state dir at the oldXDG_CONFIG_HOME/herdr-web-ui:herdr_web_tokenand old keysherdr-web-ui:settings={theme: "dark", language: "ko"},herdr-web-ui:sidebar-width= 333, app entry module held back so only the theme boot script has run:data-theme=dark, keys alreadyovis:settings, ovis:sidebar-width. After the app loads: theme dark,lang=ko-KR, sidebar width 333, signed in by the old cookie (no lock screen).This PR touches authentication (cookie names), so it waits for a real CodeRabbit review.
Changelog:
changelog.d/ovis-runtime-names.md.