You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d0cac98
Browse filesBrowse the repository at this point in the historyBrowse files
Automated review of #1306 raised six findings. Each was verified against the code before
acting; five were valid and are fixed here, one is declined with a reason.
- **npx caches, download caches and project-local installs were attributed to a package
manager.** `PKG_SEGMENT_RE` matches any `node_modules/@altimateai/altimate-code*`
segment, not only global roots, so `npx`, a devDependency install, or a bun/npm cache
resolved to `npm`/`bun`. `upgrade()` reads that as "run `install -g`", and for patch
releases it runs automatically at startup — creating a global install the user never
had. The deleted probe loop returned "unknown" for these, so this was a regression.
Cache layouts are now excluded during detection, and `preflight()` additionally confirms
the running binary actually lives under the manager's global root, failing open when
that root cannot be determined.
- **yarn classic on Windows was misclassified as npm.** Its global directory is
`%LOCALAPPDATA%\Yarn\config\global`, which neither the `.yarn` nor the `yarn/global`
spelling matched — so an upgrade would have run `npm install -g` over a yarn install,
producing exactly the orphaned second binary this change exists to prevent.
- **Preflight-blocked upgrades emitted no telemetry and no log entry**, so the flagship
permission case read as "no attempt" on dashboards — strictly worse than the previous
behaviour, which at least ran the command and recorded an error. Blocked attempts are
now logged and tracked with their classification.
- **The curl preflight checked the wrong directory.** It used the running binary's own
directory, but the install script always writes to `$HOME/.altimate/bin`, so a legacy
`~/.opencode/bin` install could pass preflight while a different directory was upgraded.
- **The Chocolatey elevation message contradicted the classified cause** — it was returned
unconditionally, so a network failure was reported as an elevation problem alongside a
conflicting "Likely cause" hint. It is now used only for permission failures.
- **The npm remediation told Windows users to run `sudo`**, which does not exist there;
those users are now pointed at an elevated shell.
- The error message now names `opencode.log` rather than the log directory, which also
holds trace jsonl and heap dumps.
Declined: switching `fs.accessSync` to `FileSystem.FileSystem`. It is the documented
preference, but threading that service through requires widening the layer's dependency
type and every downstream composition (`defaultLayer`, `node`) — well outside the scope of
this fix, and raw `fs` already has precedent in sibling modules (cli/welcome.ts).
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
0 commit comments