:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { useState } from 'react'
import { CitedMarkdown } from '../components/CitedMarkdown'
import { ClippedPreview } from '../replay_scanners/components/ClippedPreview'
/** The model's reasoning in full, clipped only when it runs past about 20 lines, which few scans do. */
export function ObservationReasoning({
reasoning,
segments,
onSeek,
}: {
reasoning: string
segments: unknown
onSeek: (timestampMs: number) => void
}): JSX.Element {
const [expanded, setExpanded] = useState(false)
const markdown = <CitedMarkdown text={reasoning} segments={segments} onSeek={onSeek} />
if (expanded) {
return markdown
}
return (
<ClippedPreview
clip="long"
buttonLabel="Show full reasoning"
dataAttr="vision-observation-show-reasoning"
onOpenFull={() => setExpanded(true)}
>
{markdown}
</ClippedPreview>
)
}