// PEP-41: provider / model / effort of the agent and escalation (project and story). import { AGENT_EFFORT_RU, AGENT_EFFORTS, AGENT_PROVIDERS, agentSettingsLabel, type AgentSettings, type AgentSettingsPatch, type Escalation } from "@peppa/core"; import { setAgentSettingsAction } from "@/app/(app)/actions"; import { Hidden } from "@/components/cards"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Input, Label, NativeSelect } from "@/components/ui/input"; const PROVIDER_RU: Record = { claude: "Claude Code", codex: "Codex", opencode: "OpenCode" }; const inherit = (v: string | number | null | undefined, none = "по умолчанию") => (v == null ? none : `как выше: ${v}`); function ProviderSelect({ name, own, inherited, none }: { name: string; own?: string | null; inherited?: string | null; none?: string }) { return ( {AGENT_PROVIDERS.map((p) => ( ))} ); } function EffortSelect({ name, own, inherited }: { name: string; own?: string | null; inherited?: string | null }) { return ( {AGENT_EFFORTS.map((e) => ( ))} ); } /** «⋯ Настройки проекта → Модель агента». */ export function AgentModelPanel({ projectId, own, inherited, back }: { projectId: number; own: AgentSettingsPatch; inherited: AgentSettings; back: string }) { return (

Эскалация после неудач

Запасной провайдер

Модель — для --model (sonnet, opus, gpt-5-codex…), действует только на своего провайдера. Неудачи — красные проверки по разным коммитам и возвраты ревьюера; после порога стори до конца идёт на сильной модели, живой раннер перезапускается в том же разговоре. Запасной провайдер — если у основного нет рабочей подписки в пуле.

); } /** Story page: provider / model / effort for this story only, and the escalation mark. */ export function TaskAgentModel({ taskKey, own, inherited, escalation, back }: { taskKey: string; own: AgentSettingsPatch; inherited: AgentSettings; escalation: Escalation | null; back: string }) { return (

Сейчас: {agentSettingsLabel({ ...inherited, ...own })} {escalation && ( эскалация на {escalation.model} после {escalation.failures} неудач )}

); }