[AgentOps][Code Quality] Better organization for enum [1/n]#442
Merged
XinweiHe merged 6 commits intopivot/agentopsfrom Feb 9, 2026
Merged
[AgentOps][Code Quality] Better organization for enum [1/n]#442XinweiHe merged 6 commits intopivot/agentopsfrom
XinweiHe merged 6 commits intopivot/agentopsfrom
Conversation
Greptile OverviewGreptile SummaryThis PR centralizes enum definitions across the backend, frontend, and Python SDK to improve code organization and type safety. The refactoring replaces hardcoded string literals with proper enum constants for Key Changes:
Critical Issue: Confidence Score: 1/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant SDK as Python SDK<br/>(traceroot-py)
participant Backend as Backend Worker<br/>(transformer.py)
participant Enums as Backend Enums<br/>(shared/enums.py)
participant DB as PostgreSQL<br/>(Prisma)
participant CorePkg as Core Package<br/>(constants.ts)
participant UI as Frontend UI<br/>(React Components)
Note over SDK: Decorator uses lowercase<br/>SpanKind ("llm", "agent", etc)
SDK->>Backend: Send OTEL span with<br/>traceroot.span.type attribute
Backend->>Enums: Import SpanKind, SpanStatus enums
Backend->>Backend: Transform lowercase to uppercase<br/>using enum constants
Backend->>Backend: Set status using SpanStatus.OK/ERROR
Note over DB: MemberRole enum defined<br/>in Prisma schema
DB->>CorePkg: Generate MemberRole enum<br/>via Prisma Client
CorePkg->>CorePkg: Re-export as Role<br/>Define SpanKind, SpanStatus,<br/>TraceStatus constants
CorePkg->>UI: Import Role, SpanKind,<br/>SpanStatus, TraceStatus
UI->>UI: Use enum constants for<br/>comparisons and displays
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
as titled.
Type of Change
Details
Screenshots / Recordings (if applicable)
Checklist