-
Notifications
You must be signed in to change notification settings - Fork 3
Bugfix/agent new #1284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix/agent new #1284
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1085,8 +1085,6 @@ const LogsTab: React.FC<LogsTabProps> = ({ promptName, promptId, projectId }) => | |||||
|
|
||||||
| // Handle incoming live trace data | ||||||
| const handleLiveTrace = useCallback((trace: TraceSpan) => { | ||||||
| console.log('[LiveTrace] Received trace:', trace); | ||||||
|
|
||||||
| // Validate required fields | ||||||
| if (!trace || !trace.span_id) { | ||||||
| console.warn('[LiveTrace] Invalid trace data - missing span_id:', trace); | ||||||
|
|
@@ -1111,17 +1109,13 @@ const LogsTab: React.FC<LogsTabProps> = ({ promptName, promptId, projectId }) => | |||||
| .filter(t => t.timestamp > cutoffTime) | ||||||
| .slice(-MAX_CHART_TRACES); | ||||||
|
|
||||||
| console.log('[LiveTrace] Chart traces count:', liveChartTracesRef.current.length); | ||||||
|
|
||||||
| // In traces view, only show root spans (those with empty parent_span_id) | ||||||
| if (viewMode === 'traces' && trace.parent_span_id && trace.parent_span_id !== '') { | ||||||
| console.log('[LiveTrace] Skipping non-root span:', trace.span_id); | ||||||
| return; | ||||||
| } | ||||||
|
|
||||||
| // Deduplicate by span_id | ||||||
| if (liveSpanIdsRef.current.has(trace.span_id)) { | ||||||
| console.log('[LiveTrace] Duplicate span, skipping:', trace.span_id); | ||||||
| return; | ||||||
| } | ||||||
| liveSpanIdsRef.current.add(trace.span_id); | ||||||
|
|
@@ -1148,14 +1142,11 @@ const LogsTab: React.FC<LogsTabProps> = ({ promptName, promptId, projectId }) => | |||||
| errorType, | ||||||
| }; | ||||||
|
|
||||||
| console.log('[LiveTrace] Created LogEntry:', newEntry); | ||||||
| setLogsData(prev => [...prev, newEntry]); | ||||||
| setLogsData(prev => [...prev, newEntry].slice(-200)); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The number
Suggested change
|
||||||
| }, [viewMode, timeRange]); | ||||||
|
|
||||||
| // Handle batch of live traces (for tree building in traces view) | ||||||
| const handleLiveTraceBatch = useCallback((traces: TraceSpan[]) => { | ||||||
| console.log('[LiveTrace] Received batch:', traces.length, 'spans'); | ||||||
|
|
||||||
| if (!traces || traces.length === 0) return; | ||||||
|
|
||||||
| // Add all traces to chart data using arrival time | ||||||
|
|
@@ -1178,13 +1169,9 @@ const LogsTab: React.FC<LogsTabProps> = ({ promptName, promptId, projectId }) => | |||||
| .filter(t => t.timestamp > cutoffTime) | ||||||
| .slice(-MAX_CHART_TRACES); | ||||||
|
|
||||||
| console.log('[LiveTrace] Batch - chart traces count:', liveChartTracesRef.current.length); | ||||||
|
|
||||||
| if (viewMode === 'traces') { | ||||||
| // In traces view, build proper tree structure from batch | ||||||
| const newTrees = buildTreeFromLiveSpans(traces); | ||||||
| console.log('[LiveTrace] Built', newTrees.length, 'trees from batch'); | ||||||
|
|
||||||
| if (newTrees.length === 0) return; | ||||||
|
|
||||||
| // Track trace IDs for deduplication | ||||||
|
|
@@ -1229,14 +1216,13 @@ const LogsTab: React.FC<LogsTabProps> = ({ promptName, promptId, projectId }) => | |||||
| errorType, | ||||||
| }; | ||||||
|
|
||||||
| setLogsData(prev => [...prev, newEntry]); | ||||||
| setLogsData(prev => [...prev, newEntry].slice(-200)); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is another instance of using the magic number
Suggested change
|
||||||
| }); | ||||||
| } | ||||||
| }, [viewMode, timeRange]); | ||||||
|
|
||||||
| // Socket hook for live streaming | ||||||
| // Note: promptId (UUID) is used for socket subscription, promptName is used for API calls | ||||||
| console.log('[LogsTab] Socket params:', { projectId, promptId, promptName, isLive }); | ||||||
| const { isSubscribed, connectionStatus, error: socketError } = useObservabilitySocket({ | ||||||
| projectId: projectId || '', | ||||||
| promptId: promptId || '', | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1469,21 +1469,21 @@ textArea { | |
| } | ||
|
|
||
| .label { | ||
| top: -10px; | ||
| top: 0px; | ||
| display: block; | ||
| font-weight: 300; | ||
| position: absolute; | ||
| left: .75rem; | ||
| transition: 0.2s ease all; | ||
| color: white; | ||
| background: var(--color-background); | ||
| padding: 0 4px; | ||
| padding: 0 0.025rem; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| font-size: .75rem; | ||
| z-index: 1111; | ||
| } | ||
|
|
||
| .ant-input { | ||
| padding: 0.75rem 1rem; | ||
| padding: 1.3rem 1rem; | ||
| background: transparent !important; | ||
| font-size: 0.75rem; | ||
| } | ||
|
|
@@ -1501,7 +1501,10 @@ textArea { | |
| .ant-input-outlined { | ||
| background: transparent !important; | ||
| // background: black !important; | ||
| border: 0.5px solid #757575 !important; | ||
| border-width: 0.5px !important; | ||
| border-style: solid !important; | ||
| border-color: #757575 !important; | ||
| // border: 0.5px solid #757575 !important; | ||
| color: white; | ||
| border-radius: 6px !important; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
classNamestring contains several redundant utility classes. For example,!shadow-noneis specified twice. Also,!border-noneand!border-[0]are used together, while!border-noneis sufficient. Similarly,!placeholder-[#808080]and!placeholder:text-[#808080]are duplicates. Simplifying this will improve code readability and maintainability.