Skip to content

Cursor provider may pass malformed agent records through normalization #45

Description

@httpsVishu

hey, i was exploring tests/cursor-provider.test.ts and noticed that the cursor provider handles invalid top-level payload shapes safely, e.g when payload is null, missing agents or has no valid agents array, that part looks good

but one edge case seems uncovered, when payload.agents exists as an array but individual agent objects inside it are malformed or partially invalid

e.g, this kind of payload would still pass the top-level “agents array exists” check

payload: {
  agents: [
    {
      id: "agent-1",
      name: "Agent One",
      status: 123,
      updatedAt: "not-a-number",
      source: "cursor-transcripts",
    },
  ],
}

since cursor().normalize() currently delegates directly to normalizeFromPayload(readResult), i was wondering whether malformed agent entries are validated there before becoming part of the canonical snapshot

main concern is that in current deployment, agentprobe is passively reading external transcript/log artifacts, those files can be incomplete, changing while being read or produced by slightly different cursor versions, if one malformed agent item enters the normalized snapshot, consumers may receive invalid lifecycle events, broken status transitions or runtime errors downstream

would it make sense to validate each agent entry during normalization and drop or warn on malformed records instead of trusting the whole agents array once it exists?

i would love to work on this issue if it is relevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions