mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-12-04 12:41:50 +08:00
feat: configure incomplete script review path
This commit is contained in:
1 parent
97213e357b
commit
dc72b5b4a9
7 files changed
+79
-23
No files matched your search
@@ -203,6 +203,7 @@ const defaultJudge = (): JudgeConfig => ({
|
||||
fail_action: "allow",
|
||||
ask_timeout_seconds: 300,
|
||||
ask_timeout_action: "deny",
|
||||
incomplete_script_action: "ask",
|
||||
});
|
||||
|
||||
function JudgeCard() {
|
||||
@@ -396,6 +397,18 @@ function JudgeCard() {
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</Field>
|
||||
<Field label="脚本快照不完整时">
|
||||
<Select
|
||||
value={cfg.incomplete_script_action}
|
||||
onValueChange={(v) => patch({ incomplete_script_action: v as JudgeConfig["incomplete_script_action"] })}
|
||||
>
|
||||
<SelectTrigger><SelectValue /></SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="ask">转人工审查(默认)</SelectItem>
|
||||
<SelectItem value="model">继续交给模型审查</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</Field>
|
||||
</div>
|
||||
|
||||
<Separator />
|
||||
|
||||
@@ -209,7 +209,7 @@ function ScriptSnapshotSummary({ input }: { input: InterceptReviewInput }) {
|
||||
<div className="flex flex-wrap items-center justify-between gap-2">
|
||||
<h3 className="font-medium text-sm">审查脚本快照</h3>
|
||||
<Badge variant={input.script_capture_status === "incomplete" ? "destructive" : "secondary"}>
|
||||
{input.script_capture_status === "incomplete" ? "读取不完整 · 需人工确认" : "已附加"}
|
||||
{input.script_capture_status === "incomplete" ? "读取不完整" : "已附加"}
|
||||
</Badge>
|
||||
</div>
|
||||
{files.map((file) => (
|
||||
@@ -311,7 +311,7 @@ function ModelReviewContext({ input }: { input: InterceptReviewInput }) {
|
||||
))}
|
||||
{input.script_capture_status === "incomplete" ? (
|
||||
<Alert variant="destructive">
|
||||
<AlertDescription>无法完整读取当前执行脚本,平台要求人工确认。</AlertDescription>
|
||||
<AlertDescription>无法完整读取当前执行脚本;默认转人工审查,也可以在模型设置中继续交给审查模型。</AlertDescription>
|
||||
</Alert>
|
||||
) : null}
|
||||
</section>
|
||||
|
||||
@@ -2514,6 +2514,7 @@ function route(m: string, path: string, seg: string[], q: URLSearchParams, b: Re
|
||||
fail_action: "allow",
|
||||
ask_timeout_seconds: 300,
|
||||
ask_timeout_action: "deny",
|
||||
incomplete_script_action: "ask",
|
||||
};
|
||||
if (path === "/intercept/judge" && m === "PUT") return { ok: true };
|
||||
if (path === "/intercept/judge/usage" && m === "GET")
|
||||
|
||||
@@ -1365,6 +1365,7 @@ export interface JudgeConfig {
|
||||
fail_action: "allow" | "ask" | "deny"; // 模型出错/超时/不可解析时的回退
|
||||
ask_timeout_seconds: number; // 模型判 ask 转人工后的审批等待超时
|
||||
ask_timeout_action: "allow" | "deny"; // 审批超时后的默认动作
|
||||
incomplete_script_action: "ask" | "model"; // 脚本快照不完整时:人工审查或继续模型审查
|
||||
}
|
||||
|
||||
// JudgeUsage: 模型兜底审批(judge 通道)的累计 token 用量 + 近 N 天每日序列。
|
||||
|
||||
Reference in new issue
Block a user