INNER CODE UNIT · TypeScript

userInputToolResult

openai/codex-security · plugins/codex-security/mcp-app/server.ts:2292

function userInputToolResult(
  status: "accepted" | "declined" | "cancelled" | "unavailable",
  answers?: Record<string, string>,
) {
  const text =
    status === "accepted"
      ? `The user answered the Codex Security question: ${JSON.stringify(answers)}.`
      : status === "declined"
        ? "The user declined the Codex Security input request. Do not infer an answer."
        : status === "cancelled"
          ? "The Codex Security input request was cancelled. Do not infer an answer."
          : "Structured Codex Security input is unavailable in this host. Use the documented plain-chat fallback.";
  return {
    content: [{ type: "text" as const, text }],
    structuredContent: {
      status,
      ...(answers ? { answers } : {}),
    },

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…