Awesome Reviewers

Default to “do the minimum possible work per hot-path update.”

Apply these checks: 1) Early-exit before side effects

2) Keep props/callbacks stable during streaming

3) Don’t recreate observers/effects due to irrelevant dependencies

4) Throttle at the right stage + memoize expensive transforms

5) Detect changes against consistent baselines

Example (stable handler + throttled transform):

const handleRightPanelOpen = useCallback((request: TurnOutputOpenRequest) => {
  if (request.kind === 'subagent') {
    onRightPanelOpen?.({ /* ... */ });
  }
}, [onRightPanelOpen]);

const throttledContent = useThrottledValue(content ?? '', isStreaming);
const renderedContent = useMemo(() => {
  if (throttledContent && source && sourceMarkdown?.transformMarkdown) {
    return sourceMarkdown.transformMarkdown(throttledContent, { source });
  }
  return throttledContent;
}, [throttledContent, source, sourceMarkdown?.transformMarkdown]);

Use this standard to review PRs that touch streaming, parsing, rendering, observers, and settings-change detection.