Skip to content

FileStore surfaces unparseable stored records as an empty agent list #32

Description

@Mearman

FileStore.listAgents (src/core/store.ts) wraps the directory read and schema-parse loop in a try/catch that returns [], so a stored record that fails AgentIdentitySchema.parse looks like "no agents" instead of an error. Since the entity schemas gained a required version field (#29), any record written by an older build now hits this path: reading a legacy data directory silently yields an empty mesh.

The store has no internal consumers (MeshStore superseded it) but is exported from the public API via src/core/index.ts, so external users are exposed.

Preferred fix per the fail-loudly convention: propagate the parse error (a corrupt or incompatible record is a real failure, and a silent empty list hides it). If migration is genuinely wanted instead — defaulting a missing version to 1 at the FileStore read boundary — that is a deliberate compatibility decision to make explicitly, not a default.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions