fix: ship iii-config.docker.yaml in the npm tarball (#136)#137
Conversation
docker-compose.yml mounts `./iii-config.docker.yaml:/app/config.yaml:ro` but the `files` array in package.json only shipped `iii-config.yaml`. Docker resolves missing bind sources by silently creating them as empty directories, so `npx @agentmemory/agentmemory` mounted an empty dir at /app/config.yaml and iii-engine crashed with: Error: Failed to read config file '/app/config.yaml': Is a directory (os error 21) Fix: add iii-config.docker.yaml to package.json `files`. Also adds a regression test in test/consistency.test.ts that parses every `./<path>:<container>` bind mount in docker-compose.yml and asserts the source file is shipped via the `files` array, so this class of bug can't reach a release again. Bumps main package + shim to 0.8.7 and adds CHANGELOG [0.8.7].
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
📝 WalkthroughWalkthroughVersion 0.8.7 release that fixes a Docker container crash when Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Closes #136.
What broke
@stefano-medapps ran
npx @agentmemory/agentmemoryon a fresh install and got:```
Error: Failed to read config file '/app/config.yaml': Is a directory (os error 21)
```
And noticed their extracted package had `iii-config.docker.yaml` as a directory, not a file. I reproduced by inspecting the published 0.8.6 tarball:
```
$ tar tf agentmemory-agentmemory-0.8.6.tgz | grep -v "^package/dist|^package/plugin"
package/LICENSE
package/package.json
package/AGENTS.md
package/README.md
package/iii-config.yaml
package/docker-compose.yml
```
No top-level `iii-config.docker.yaml`. But `docker-compose.yml` at the same level mounts it:
```yaml
volumes:
```
Docker resolves missing host-path bind sources by silently creating them as empty directories. So when the CLI runs `docker compose up`, Docker creates `iii-config.docker.yaml/` (empty dir) next to the compose file and mounts that empty dir into the container at `/app/config.yaml`. iii-engine opens it as a file, gets EISDIR, crashes.
Root cause
`package.json` `files` array only shipped `iii-config.yaml`. The Docker variant was missed when the build pipeline was set up — build copies it to `dist/` but `dist/` isn't what the compose file resolves against.
Fix
One line in `package.json`:
```diff
"files": [
"dist/",
"plugin/",
"iii-config.yaml",
"docker-compose.yml",
...
]
```
`npm pack --dry-run` now shows `iii-config.docker.yaml` at the package root (1.3kB).
Regression guard
Added a test in `test/consistency.test.ts` that parses every `./:` bind mount in `docker-compose.yml` and asserts the source file is shipped via the `files` array. If someone adds a new bind mount without a corresponding `files` entry, CI fails with a specific error message pointing at #136. Catches this class of bug before it reaches a release.
Test plan
Summary by CodeRabbit
Bug Fixes
/app/config.yamlis a directory by ensuring the necessary Docker configuration file is included in the package distribution.Tests