// An open question of the session, as a card above the input: an external // agent asking "may I run this?" (docs/external-agents.md). One button per // option; the turn waits until one is clicked or the time runs out (then // the server picks the safest option). The builder keeps its own panel. // A question that does not wait (an agent's ask_user in a chat with you, // Codex's own question) has its own card below: the turn is over, a click // sends the choice as your next message, and writing anything else in // the chat answers it too. import { useState } from 'react'; import { MessageCircleQuestion, ShieldQuestion } from 'lucide-react'; import { api, type SessionQuestion } from '../lib/api'; import { answersOnClick, buildAnswer, questionParts } from '../lib/question'; import { AssistantMarkdown } from './AssistantMarkdown'; /** What the person decides on, in full: the text to approve, the drafts * to pick from. On the card itself, because the agent's reply around it * may not be in view (2026-11-06: posts approved whose text was never * shown). Scrolls on its own when long. */ /** In a small chat window (520x460 by default) a card with details * pushed its options and the input below the window's edge: it shrinks * to the room left and scrolls as a whole instead. The transcript above * is flex 1 and gives way first. */ const FIT_WINDOW: React.CSSProperties = { flexShrink: 1, minHeight: 120, overflowY: 'auto', overscrollBehavior: 'contain' }; function QuestionDetails({ text }: { text: string }) { return (