MCPcopy Create free account
hub / github.com/astercloud/aster / rejectTool

Function rejectTool

ui/src/composables/useAgentLoop.ts:421–443  ·  view source on GitHub ↗
(requestId: string, reason?: string)

Source from the content-addressed store, hash-verified

419 * 拒绝工具执行
420 */
421 const rejectTool = (requestId: string, reason?: string): AgentExecutionResult => {
422 const approval = pendingApproval.value;
423 if (!approval || approval.id !== requestId) {
424 throw new Error("No pending approval or ID mismatch");
425 }
426
427 approvalStore.reject(requestId, reason);
428 pendingApproval.value = null;
429 isPaused.value = false;
430 isRunning.value = false;
431
432 emitThink({
433 stage: `工具被拒绝: ${approval.toolName}`,
434 reasoning: reason || "用户拒绝了敏感操作",
435 decision: "终止执行",
436 });
437
438 return {
439 status: "finished",
440 output: currentOutput.value + `\n\n[工具 ${approval.toolName} 被拒绝: ${reason || "用户拒绝"}]`,
441 history: history.value,
442 };
443 };
444
445 /**
446 * 取消执行

Callers

nothing calls this directly

Calls 1

emitThinkFunction · 0.85

Tested by

no test coverage detected