Sync upstream CLI portable installs - #22
Merged
Merged
Conversation
* fix(cli): anchor engine cwd and rewrite bundled config with absolute paths The bundled iii-config.yaml uses cwd-relative paths and the engine was spawned without a cwd, so on global and npx installs ./data/state_store.db and ./data/stream_store landed in whatever directory the user ran the CLI from, and the iii-exec supervision block (src/**/*.ts watch, node dist/index.mjs exec) never resolved, meaning the engine never supervised a worker and nothing respawned it after the in-process worker died. That surfaced as all data gone reports against a live REST port. startIiiBin now prepares the launch: when the resolved config is the bundled one it writes ~/.agentmemory/iii-config.runtime.yaml (regenerated each boot) with absolute data paths under ~/.agentmemory/data and an absolute node exec line for the installed worker entry, copies any legacy ./data stores from the invocation directory on first run, and spawns the engine with cwd anchored at ~/.agentmemory. Repo checkouts keep the cwd config and repo-root cwd, so dev behavior is unchanged. User overrides via env or ~/.agentmemory/iii-config.yaml are passed through verbatim. agentmemory remove gains a plan item for the generated runtime config. Covered by test/engine-launch.test.ts including a drift guard that rewrites the repo's real iii-config.yaml and asserts no relative paths remain. * fix: make fresh installs portable and persistent * docs: refresh generated config reference
Bring in rohitg00#892: portable CLI installs with absolute engine paths under ~/.agentmemory. Reapplied markEngineSupervised on the new worker start path and kept the fork README. Co-authored-by: Martin Jakubík <martindzejky@gmail.com>
Co-authored-by: Martin Jakubík <martindzejky@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f9326ec. Configure here.
| const demoTimeoutEnd = source.indexOf("await import(\"./index.js\")", demoTimeoutStart); | ||
| expect(source.slice(demoTimeoutStart, demoTimeoutEnd)).toContain( | ||
| "printCapturedStartupStderr()", | ||
| ); |
There was a problem hiding this comment.
Broken demo stderr test sentinel
Low Severity
The demo timeout assertion still ends at await import("./index.js"), but the demo path now calls startWorkerForEngineState() instead. indexOf returns -1, so the slice runs to near end-of-file and the check only passes by accident rather than locking the demo failure path.
Reviewed by Cursor Bugbot for commit f9326ec. Configure here.
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
rohitg00/agentmemory@maininto this fork (was 1 commit behind)~/.agentmemoryso global/npx installs keep data and respawn the workermarkEngineSupervised()on the newstartWorkerForEngineState()path so Railway still exits when iii-engine diesWhat upstream changed
iii-config.yamlto~/.agentmemory/iii-config.runtime.yamlwith absolute data paths and an absolute worker exec line~/.agentmemory; repo checkouts keep the old cwd-relative behavioriii-execis removed from the Docker config so the CLI starts the workerIII_VIEWER_PORT) instead ofrestPort + 2EMBEDDING_PROVIDER=local), not the keyless defaultConflicts
README.md: kept the Cursor fork READMEsrc/cli.ts: took upstream's worker start helper and kept our engine-crash supervisionplugin/skills/agentmemory-config/REFERENCE.md: kept fork env vars and regenerated the countTest plan
git rev-list --count HEAD..upstream/mainis 0npm run buildnpm run skills:checknpm test— 1843 passed, 1 skippedupstream/main(idle sweep, raw events, eventId, watermarks,/session/endnoop, bulk observe)