Summary
When Zod validation fails on agentcore.json, error messages include the absolute filesystem path to the config file. This leaks internal directory structure to the user.
Reproducer
agentcore add memory --name "bad name!" --expiry 30 --json
Actual behavior
{"success":false,"error":"/Users/username/path/to/project/agentcore/agentcore.json:\n - memories[1].name: Must begin with a letter..."}
Expected behavior
{"success":false,"error":"agentcore.json:\n - memories[1].name: Must begin with a letter..."}
Or just the error message without the file path.
Notes
Affects all add and remove commands that go through ConfigIO.writeProjectSpec → validateAndWrite. The path comes from ConfigValidationError in config-io.ts.
Summary
When Zod validation fails on
agentcore.json, error messages include the absolute filesystem path to the config file. This leaks internal directory structure to the user.Reproducer
agentcore add memory --name "bad name!" --expiry 30 --jsonActual behavior
{"success":false,"error":"/Users/username/path/to/project/agentcore/agentcore.json:\n - memories[1].name: Must begin with a letter..."}Expected behavior
{"success":false,"error":"agentcore.json:\n - memories[1].name: Must begin with a letter..."}Or just the error message without the file path.
Notes
Affects all
addandremovecommands that go throughConfigIO.writeProjectSpec→validateAndWrite. The path comes fromConfigValidationErrorinconfig-io.ts.