Repository navigation
fix(cli): make fresh installs portable and persistent - #8
Merged
Merged
Conversation
Port of upstream main e04ba88 (rohitg00#892) onto v0.9.29-patch, aligned with upstream: startIiiBin regenerates a runtime iii-config (absolute data paths under ~/.agentmemory/data, absolute worker exec line, engine cwd anchored at ~/.agentmemory), migrates legacy ./data stores on first run, and passes user overrides through verbatim. Viewer port becomes configurable (III_VIEWER_PORT); worker pidfiles honor AGENTMEMORY_RUNTIME_DIR; docker installs gain uid/gid/chown controls; agentmemory remove covers the runtime config; doctor and startup-failure reporting expanded. Adaptations for this line: - test/engine-config.test.ts: upstream adds the file for renderEngineConfig while this line already had an observability-off drift guard of the same name; both suites are kept side by side. - src/index.ts import conflict: kept this line's logger + parsePositiveIntervalMs imports alongside upstream's runtimeMetadataPath. - plugin/skills/agentmemory-config/REFERENCE.md regenerated via skills:gen (55 -> 60 vars; upstream's five new variables added, this line's variables retained). - III_PINNED_VERSION indirection (0.11.2) carried through untouched. - README endpoint count stays 132 (this line's REST surface). tsc error set identical to the post-#7 baseline; 1844 tests pass (+54 from upstream suites).
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.
Port of upstream main
e04ba88(rohitg00#892) ontov0.9.29-patch, aligned with upstream implementation text.What upstream did
The bundled
iii-config.yamluses cwd-relative paths and the engine was spawned without a cwd, so on global/npx installs./data/state_store.dband./data/stream_storelanded in the invocation directory, and theiii-execsupervision block never resolved — nothing respawned the worker, surfacing as "all data gone" reports against a live REST port.startIiiBin→prepareEngineLaunch: when the resolved config is the bundled one, regenerates~/.agentmemory/data/iii-config.runtime.yamleach boot with absolute data paths and an absolute worker exec line, anchors engine cwd at~/.agentmemory, and copies legacy./datastores from the invocation dir on first run. Repo checkouts keep cwd config; user overrides pass through verbatim.src/cli/engine-config.ts(renderEngineConfig),src/cli/engine-launch.ts(launch prep + exec-command rewriting + legacy migrations),src/cli/startup-stderr.ts,src/runtime-paths.ts(AGENTMEMORY_RUNTIME_DIR).III_VIEWER_PORT, default REST + 2) throughconfig.viewerPort.AGENTMEMORY_DOCKER_UID/GID/SKIP_CHOWN).agentmemory removecovers the generated runtime config; doctor + startup-failure reporting expanded.Adaptations for this line
test/engine-config.test.tsrenderEngineConfig; this line already had an observability-off drift guard of the same name. Both suites kept side by side.src/index.tsimportslogger+parsePositiveIntervalMsalongside upstream'sruntimeMetadataPath.REFERENCE.mdskills:gen(55 → 60 vars): upstream's five new variables added, this line's retained.III_PINNED_VERSIONindirection (0.11.2) carried through untouched — all launch paths route through it.iii-config.docker.yamlVerification
npm test: 1844 passed, 1 skipped (baseline 1790 + 54 upstream tests)npm run build: cleannpm run skills:gen+skills:check: passnpx tsc --noEmit: error set identical to the post-perf(index): store vectors in buckets and rebuild BM25 from content #7 baseline (31 normalized lines, zero new)~/.agentmemory/worker.pid; local systemd deployment (directnode dist/index.mjs) is unaffected by the CLI launcher changes