精简动作审查输入并支持审批来源定位 (#125)
* fix: 精简审查背景并区分人工消息与调度输入 * fix: 模型审查仅提交当前调用与选定背景 * feat: 审批来源定位原会话并移除 Worker 审查背景
This commit is contained in:
1 parent
0d6fa880b8
commit
04d25eb133
30 files changed
+1143
-465
No files matched your search
@@ -1061,6 +1061,8 @@ export const api = {
|
||||
interceptGetOne: (id: number) => get<InterceptPending>(`/intercept/pending/${id}`),
|
||||
interceptDecide: (id: number, decision: "allowed" | "denied") =>
|
||||
post<{ ok: boolean }>(`/intercept/pending/${id}/decide`, { decision }),
|
||||
interceptExecution: (id: number, conversationId?: number) =>
|
||||
get<import("@/lib/types").InterceptExecution>(`/intercept/history/${id}/execution${conversationId ? `?conversation=${conversationId}` : ""}`),
|
||||
interceptDetail: (id: number) => get<InterceptDetail>(`/intercept/history/${id}`),
|
||||
interceptHistory: () => get<{ items: InterceptApprovalRow[] }>("/intercept/history").then((r) => arr(r.items)),
|
||||
interceptHistoryPage: (page = 1, size = 20) =>
|
||||
|
||||
+19
-2
@@ -1283,6 +1283,13 @@ export interface LLMTask {
|
||||
// The exact JSON sent to the review model, retained for all model verdicts.
|
||||
export interface InterceptReviewInput {
|
||||
version: number;
|
||||
background?: {
|
||||
// worker_summary is retained only for immutable v2/v3 snapshots.
|
||||
source: "user_message" | "worker_summary";
|
||||
text: string;
|
||||
truncated?: boolean;
|
||||
};
|
||||
// Version 1 snapshots are immutable and remain readable in historical audits.
|
||||
task?: {
|
||||
task_id: number;
|
||||
description: string;
|
||||
@@ -1294,7 +1301,8 @@ export interface InterceptReviewInput {
|
||||
worker_intent?: string;
|
||||
turn_input?: string;
|
||||
background_truncated?: boolean;
|
||||
history: {
|
||||
// Legacy v1/v2 snapshots only; v3 never sends execution history.
|
||||
history?: {
|
||||
tool_use_id: string;
|
||||
tool: string;
|
||||
arguments_preview: string;
|
||||
@@ -1303,7 +1311,7 @@ export interface InterceptReviewInput {
|
||||
truncated?: boolean;
|
||||
}[];
|
||||
history_truncated?: boolean;
|
||||
correlation: "exact" | "ambiguous" | "unavailable";
|
||||
correlation?: "exact" | "ambiguous" | "unavailable";
|
||||
tool_name: string;
|
||||
arguments: Record<string, unknown>;
|
||||
}
|
||||
@@ -1431,3 +1439,12 @@ export interface UpdateProgress {
|
||||
version?: string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
// Original execution selected from an approval, never submitted to the reviewer.
|
||||
export interface InterceptExecution {
|
||||
conversation_id: number | null;
|
||||
task_id: string | null;
|
||||
session: string;
|
||||
seq: number;
|
||||
items: Activity[];
|
||||
}
|
||||
Reference in new issue
Block a user