Skip to content

fix: remove duplicate kind field in traceSpanSchema dropping memory/trigger spans — closes #39#57

Open
rishab11250 wants to merge 1 commit into
NEXARA-oss:mainfrom
rishab11250:fix/issue-39-duplicate-kind-traceSpanSchema
Open

fix: remove duplicate kind field in traceSpanSchema dropping memory/trigger spans — closes #39#57
rishab11250 wants to merge 1 commit into
NEXARA-oss:mainfrom
rishab11250:fix/issue-39-duplicate-kind-traceSpanSchema

Conversation

@rishab11250
Copy link
Copy Markdown

Pull Request Overview

Fixes issue #39 — the traceSpanSchema in packages/contracts/src/index.ts had two kind declarations. Zod applies schemas sequentially, so the second (narrower) definition at lines 76-84 was overwriting the first (comprehensive) one at line 74. The narrower definition omitted 'memory' and 'trigger', causing any span with those kinds to silently fail validation and be dropped from the tracing subsystem without any error.

Related Issues

Architecture and Implementation Details

  • Removed the duplicate narrower kind declaration (lines 76-84) from packages/contracts/src/index.ts that only included 7 kinds (workflow, agent, tool, llm, queue, retry, replay).
  • The comprehensive definition with all 9 kinds (workflow, agent, tool, llm, queue, memory, trigger, retry, replay) at line 74 now takes effect as intended.
  • No structural changes, database migrations, or new dependencies introduced.

Breaking Changes

  • Yes (Describe below)
  • No

Testing Methodology

  1. Built the contracts package with pnpm --filter @pulsestack/contracts build — TypeScript compilation succeeded with zero errors.
  2. Ran npx vitest run packages/contracts/src/ — all 2 tests passed.
  3. Manually verified that traceSpanSchema.parse({ kind: 'memory', ...rest }) and traceSpanSchema.parse({ kind: 'trigger', ...rest }) now succeed.

Performance & Observability Impact

No performance impact. Fixes a data-loss bug in the tracing subsystem — memory-agent spans and trigger spans are now correctly recorded instead of being silently dropped.

Contributor Checklist

  • I have read and adhered to the PulseStack Contributing Guidelines.
  • I have successfully executed the local test suite without errors.
  • I have updated the corresponding documentation to reflect these changes.
  • I have added adequate test coverage for my implementation.
  • I have verified that my code aligns with the repository's formatting and linting standards.

…rigger spans

Closes NEXARA-oss#39

Removes the narrower duplicate kind declaration (lines 76-84) that
omitted 'memory' and 'trigger' span types. The comprehensive definition
with all 9 kinds at line 74 now takes effect.
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.

[Bug]: Duplicate kind field in traceSpanSchema silently drops memory and trigger span types

1 participant