fix(client): address trajectory review findings
This commit is contained in:
@@ -1188,6 +1188,20 @@ function RecordPayload({
|
||||
: 'No result captured'
|
||||
if (!value) return <p className={css.noPayload}>{missing}</p>
|
||||
|
||||
const json = parseJsonContainer(value)
|
||||
const singleTextResult = direction === 'output'
|
||||
&& record.cell.outputBlocks?.length === 1
|
||||
&& record.cell.outputBlocks[0]?.type === 'text'
|
||||
if (singleTextResult && json !== undefined) {
|
||||
return (
|
||||
<JsonTree
|
||||
data={json}
|
||||
label="Result JSON"
|
||||
className={preview ? css.jsonPreview : css.jsonPayload}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
if (
|
||||
direction === 'output'
|
||||
&& record.cell.outputBlocks?.some(block =>
|
||||
@@ -1214,7 +1228,6 @@ function RecordPayload({
|
||||
</div>
|
||||
)
|
||||
}
|
||||
const json = parseJsonContainer(value)
|
||||
if (json !== undefined) {
|
||||
return (
|
||||
<JsonTree
|
||||
|
||||
@@ -5,7 +5,9 @@ import type { ConvViewProps } from '@deepseek-ai/dsh-client-ui-conversation/clie
|
||||
import type {
|
||||
AssistantMessageNode, ConversationContext, RequestView,
|
||||
} from '@deepseek-ai/dsh-client-runtime/client'
|
||||
import { deriveTrajectoryContextBranches } from './context-branches.ts'
|
||||
import {
|
||||
deriveTrajectoryContextBranches, trajectoryBranchContainsSeq,
|
||||
} from './context-branches.ts'
|
||||
import {
|
||||
TrajectoryTable,
|
||||
type TrajectoryRequestNumber,
|
||||
@@ -97,9 +99,13 @@ export function TrajectoryView({ useSession, loadAllHistory }: ConvViewProps & T
|
||||
)
|
||||
const currentBranch = branches.at(-1)
|
||||
if (currentBranch === undefined) throw new Error('trajectory branch projection must not be empty')
|
||||
const selectedNodes = inspection === undefined || inspection.eventNodes.length === 0
|
||||
? nodes
|
||||
: inspection.eventNodes
|
||||
const selectedNodes = currentBranch.nodes
|
||||
const selectedRequests = useMemo(
|
||||
() => requests.filter(request =>
|
||||
trajectoryBranchContainsSeq(currentBranch, request.startSeq),
|
||||
),
|
||||
[currentBranch, requests],
|
||||
)
|
||||
const globalRequestNumbers = useMemo<readonly TrajectoryRequestNumber[]>(() => {
|
||||
const assistantsByStep = new Map<string, AssistantMessageNode>()
|
||||
for (const context of contexts) {
|
||||
@@ -235,12 +241,12 @@ export function TrajectoryView({ useSession, loadAllHistory }: ConvViewProps & T
|
||||
nodes: selectedNodes,
|
||||
partial,
|
||||
runningCalls,
|
||||
requests,
|
||||
requests: selectedRequests,
|
||||
...(callSchemas === undefined ? {} : { callSchemas }),
|
||||
codeDispatches,
|
||||
}),
|
||||
[
|
||||
selectedNodes, partial, runningCalls, requests, callSchemas, codeDispatches,
|
||||
selectedNodes, partial, runningCalls, selectedRequests, callSchemas, codeDispatches,
|
||||
],
|
||||
)
|
||||
const collapsibleTurnIds = useMemo(
|
||||
|
||||
Reference in New Issue
Block a user