Repository navigation
Conversation
There was a problem hiding this comment.
Greptile has paused reviews on this repository — it used its 1000 free open-source review credits for this billing period. Reviews resume automatically on October 29. To continue before then, an organization admin can keep reviews running past the free credits — those bill as normal usage.
|
Hello! Thanks for looking into my issue so quickly 😄
|
|
Hi @cijaaimee, Great point! I've just updated the PR to support independent per-side role titling for mixed I/O cases exactly as you described. Specifically:
Added comprehensive unit tests covering the independent side detection and mixed I/O scenarios (50/50 passing). |
AI review gate — Waiting for AI review
What to do:
Configuration: the repository's History (latest 5 heads, newest first)
|
What does this PR do?
Fixes #19198
Context & Problem
In #18787,
IOPreviewPretty.tsxintroduced:This was intended to display
Input/Outputheaders for tool/span I/O containing arbitrary JSON or raw strings instead of defaulting toUser/Assistant.However, when multi-agent workflows or chat interactions are logged as
SPAN,AGENT, orTOOLobservations, this logic caused all messages—includingassistantandsystemmessages—to be titledInputbecausetitleBySidewas unconditionallytruefor any non-GENERATIONobservation.Solution
chatMessageUtils.ts):isExplicitChatMessage(value)to check whether raw data contains chat message structures (array of message objects withrole/tool_calls, or objects withmessagesarray).isChatConversation({ input, output, messages, inputMessageCount })to identify if an observation represents a chat dialogue (multi-turn messages, explicit assistant/system/tool roles in input, or chat message payloads).IOPreviewPretty.tsx:titleBySideis nowobservationType !== undefined && observationType !== 'GENERATION' && !isChat.Input/Outputas intended by fix(web): label non-chat input and output as Input and Output #18787.User,Assistant,System,Tool).ChatMessageList.tsx:assistantorsystemroles are never labeledInput.Type of change
Mandatory Tasks
Tests & Verification
web/src/features/traces/fns/chatMessageUtils.clienttest.tscovering:roletool_callsmessagesarraystitleBySidestill applies to arbitrary tool I/O)bun test web/src/features/traces/fns/chatMessageUtils.clienttest.ts: 41/41 passing (22ms).(Available for further frontend/observability contributions and contractor work: [email protected])