Skip to content

fix: ship iii-config.docker.yaml in the npm tarball (#136)#137

Merged
rohitg00 merged 1 commit intomainfrom
fix/missing-docker-config-0.8.7
Apr 14, 2026
Merged

fix: ship iii-config.docker.yaml in the npm tarball (#136)#137
rohitg00 merged 1 commit intomainfrom
fix/missing-docker-config-0.8.7

Conversation

@rohitg00
Copy link
Copy Markdown
Owner

@rohitg00 rohitg00 commented Apr 14, 2026

Closes #136.

What broke

@stefano-medapps ran npx @agentmemory/agentmemory on 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:

  • ./iii-config.docker.yaml:/app/config.yaml:ro
    ```

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",

  • "iii-config.docker.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

  • `npm run build` clean
  • `npm test` — 699 passing (was 698 + new regression test)
  • `npm pack --dry-run` confirms `iii-config.docker.yaml` is in the tarball
  • After release: run `npx -y @agentmemory/agentmemory@0.8.7` on a clean machine with Docker and confirm the engine actually starts (manual QA)

Summary by CodeRabbit

  • Bug Fixes

    • Fixed a crash when /app/config.yaml is a directory by ensuring the necessary Docker configuration file is included in the package distribution.
  • Tests

    • Added a regression test to verify all Docker bind-mounted files are properly included in the published package.

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].
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2496be43-764c-411d-ad41-f94cfb8d6b44

📥 Commits

Reviewing files that changed from the base of the PR and between bfd1255 and c2ea896.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (9)
  • CHANGELOG.md
  • package.json
  • packages/mcp/package.json
  • plugin/.claude-plugin/plugin.json
  • src/functions/export-import.ts
  • src/types.ts
  • src/version.ts
  • test/consistency.test.ts
  • test/export-import.test.ts

📝 Walkthrough

Walkthrough

Version 0.8.7 release that fixes a Docker container crash when /app/config.yaml resolves to a directory. The fix adds the missing iii-config.docker.yaml file to the published package contents, and introduces a regression test to prevent future bind-mount inconsistencies between docker-compose.yml and package.json.

Changes

Cohort / File(s) Summary
Version Bumps Across Manifests
package.json, packages/mcp/package.json, plugin/.claude-plugin/plugin.json, src/version.ts
Incremented version from 0.8.6 to 0.8.7 across all package manifests and the VERSION constant.
Package Contents & Documentation
package.json (files array), CHANGELOG.md
Added iii-config.docker.yaml to the published files list to resolve the Docker container crash; documented the fix in the changelog with details about the regression test infrastructure.
Version Support
src/types.ts, src/functions/export-import.ts
Extended ExportData.version union type and supportedVersions set in the mem::import function to recognize and accept exports in version 0.8.7 format.
Tests
test/consistency.test.ts, test/export-import.test.ts
Added new regression test that parses docker-compose.yml bind mounts and verifies corresponding source files are included in package.json's files array; updated export-import test expectations to match the new version.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • PR #126: Both PRs perform consistent release-version updates across the same code locations (package manifests, version constant, type definitions, export-import functions, and tests).
  • PR #134: Both PRs modify identical version-related code paths to add support for a new release version in types, constants, and import handling.
  • PR #117: Both PRs follow the same release-version-bump pattern with updates to manifests, constants, and test expectations.

Poem

🐰 A Docker config gone missing in flight,
Now bundled with care in the package so tight!
Version 0.8.7 hops into place,
With tests watching files keep up the pace! 📦✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main fix: adding iii-config.docker.yaml to the npm package via the files array.
Linked Issues check ✅ Passed The PR fully addresses issue #136: iii-config.docker.yaml is added to package.json files array, version bumped to 0.8.7, and regression test ensures docker-compose bind mounts are included in published files.
Out of Scope Changes check ✅ Passed All changes directly support fixing the missing Docker config file issue: version bumps, type updates for export/import support, and a regression test to prevent recurrence.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/missing-docker-config-0.8.7

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/app/config.yaml is a directory

1 participant