@xopcai/xopc 0.0.244 → 0.0.245
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-CAah-_8h.js → activity-store-BlxqErph.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BhXGsupm.js → agent-avatar-dicebear-DRQnogaU.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-Blzn2H6t.js → agent-defaults-settings-panel-CpOxGbMD.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-Cmp-z8Y_.js → agents-flnXZLaT.js} +1 -1
- package/dist/gateway/static/root/assets/{api-B2tKxbcz.js → api-BbXzyQMj.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CezjAP1K.js → app-management-settings-panel-CZl6n2xi.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-C-CfS05x.js → appearance-settings-Bglp-pn6.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-7Y13_bqZ.js → apps-page-CmsWarVB.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-BmSx7wzY.js → archive-plugin-DD2SweEH.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-DI4CoIga.js → attachment-load-G0HenUmG.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-D04Xceck.js → automations-page-B78bFjH2.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-wEO1OWk0.js → automations-workspace-BMQGmn50.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-BJQe8TRu.js → binary-plugins-BbSQmXqn.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BSzGjJC6.js → block-editor-DutTIH81.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-DjAZ_LF2.js → browser-settings-page-CALiFKm4.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-CRnkgZHI.js → browser-workflow-inputs-BAAc151l.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-CwbxA3B7.js → browser-workflows-page-DE5HPrHZ.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-jt9bqUMK.js → capabilities-settings-panel-Dts7XtP3.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-Cz_TWY3a.js → channels-settings-CWEd3wzh.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-status-swr-DuY4MGxe.js → channels-status-swr-CCBCtLDg.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-D3gj2D3U.js → chat-terminal-dock-Bp1fXQm1.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-Shs5vbzx.js → connectors-page-CQ6wVNLm.js} +1 -1
- package/dist/gateway/static/root/assets/{cron-expression-DgWHw0jX.js → cron-expression-B8HA5IRb.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-CKg-RPbs.js → date-picker-DD8b7oad.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-CVYkw-NN.js → dependency-picker-BC9zwIyH.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Bf46oXTY.js → desktop-pet-DsrsPZTW.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BJO_klc7.js → desktop-pet-settings-D7gp_HNA.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-T2PmFFOW.js → extension-debug-page-BoKbOX7x.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-2wAE2RCe.js → extension-page-BegL4FW8.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-Y9ZiCJ21.js → extension-settings-page-CjPqq57s.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-DaYY1Gkn.js → gateway-config-api-DaG57o4X.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BC3pgb_P.js → gateway-config-swr-826dipyU.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-eO3IzW_J.js → gateway-settings-DkJGpgm6.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-uMcSfLru.js → gateway-startup-retry-DyvcAIMm.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-BAgrkyHc.js → heartbeat-settings-BLZ48kSU.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-GTjKH7LK.js → home-page-Dtw7Ipt1.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-D1qlQA-A.js → image-generation-api-D7cyfks6.js} +1 -1
- package/dist/gateway/static/root/assets/{index-DUz0O54y.js → index-DG5CfYat.js} +10 -10
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CWGqL6o5.js → keyboard-shortcuts-settings-D2Has7-N.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-DKJ-rks0.js → local-app-workbench-page-BWidWY93.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-Bfidv29d.js → local-apps-page-Bkekjoxf.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CMZljTJx.js → locale-store-CBoCuIMx.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DwAHrPbF.js → logs-page-C5zSSgvA.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-BG7j1I9f.js → management-settings-B8c62vRS.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-AnmmpLs6.js → markdown-split-3kxTTGO7.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-PPCLt7fu.js → markdown-view-BXsHghJd.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CGS-05cE.js → media-plugins-BW8J1nCG.js} +1 -1
- package/dist/gateway/static/root/assets/messages-BbdwoxVo.js +3 -0
- package/dist/gateway/static/root/assets/{mobile-pairing-wizard-DoKK5GfV.js → mobile-pairing-wizard-nwQ8iUcd.js} +1 -1
- package/dist/gateway/static/root/assets/models-hub-cache-88f4fzYS.js +1 -0
- package/dist/gateway/static/root/assets/{notes-page-Lr8rsFAR.js → notes-page-DdybD0QM.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-workbench-ISWnKLxO.js → notes-workbench-IYfpy2Jx.js} +2 -2
- package/dist/gateway/static/root/assets/{oauth-api-4VeMbkTJ.js → oauth-api-BjSUDIgq.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BU0HiZtv.js → product-open-page-CAJeUXeU.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-BZqr4yam.js → project-detail-page-4wjw-b7h.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-Dau8733A.js → projects-page-CCMj9PeL.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-CWOtPFrE.js → registry-api-BhGKnvLP.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-DdChlvGP.js → remote-access-hub-DsBJqWIk.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CmZTNv1W.js → runtime-tools-settings-panel-B4IDcqx0.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-XlVPyiVQ.js → schema-form-DiGUUjO6.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-C3kADsd4.js → sessions-page-BwGj0t-2.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BJCfUghk.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-DblUeM3V.js → settings-page-CVQUsAhd.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-bDfRfSnq.js → setup-status-panel-CQACRh1i.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-DBMWFMN-.js → share-preview-page-DTP1dtuS.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-Bu6lIStj.js → shares-settings-D_YPh6Rw.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-B43xlJlX.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-CSOseeQe.js → skills-page-Czpn7Y28.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-CniRGhkJ.js → skills-page.utils-d39rm3hb.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-D0GqNpKy.js → system-settings-panel-CXXySCSp.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-BRCq-nR7.js → task-detail-page-DHiOqQMx.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-uxUwr10D.js → theme-store-hybK3oC9.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-BtjS2nrM.js → tunnel-api-BiBGK7O2.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-TwuAycG8.js → use-autosave-DjpzpeIm.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-CbqPu8xZ.js → user-context-page-1XBRV5gX.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-CzwG5plu.js → voice-api-key-field-CUIPNmOc.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-MqyI6cgq.js → voice-config-api-CBbiF1T3.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DS15FzQA.js → work-discovery-overlay-DVNxhb1x.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-C_boCemi.js → workflow-run-setup-panel-HxxFQFY7.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-CaI2ruyy.js → workflows-page-BCgL7PRm.js} +1 -1
- package/dist/gateway/static/root/index.html +11 -11
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/turn-outcome.js +3 -1
- package/dist/src/agent/agent-instance-gateway.d.ts +3 -1
- package/dist/src/agent/agent-manager.d.ts +2 -4
- package/dist/src/agent/agent-manager.js +28 -32
- package/dist/src/agent/background-review/coordinator.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +2 -2
- package/dist/src/agent/child-agent-factory.d.ts +10 -7
- package/dist/src/agent/child-agent-factory.js +112 -158
- package/dist/src/agent/coding/index.d.ts +1 -1
- package/dist/src/agent/coding/index.js +2 -2
- package/dist/src/agent/coding/repository-instructions.d.ts +12 -0
- package/dist/src/agent/coding/repository-instructions.js +76 -0
- package/dist/src/agent/coding/run-verification.d.ts +34 -0
- package/dist/src/agent/coding/run-verification.js +134 -0
- package/dist/src/agent/coding/verification-command.d.ts +3 -0
- package/dist/src/agent/coding/verification-command.js +50 -0
- package/dist/src/agent/coding/workspace-revision.d.ts +2 -0
- package/dist/src/agent/coding/workspace-revision.js +77 -0
- package/dist/src/agent/commands/command-isolation.d.ts +21 -0
- package/dist/src/agent/commands/command-isolation.js +71 -0
- package/dist/src/agent/commands/command-registry.d.ts +56 -0
- package/dist/src/agent/commands/command-registry.js +259 -0
- package/dist/src/agent/embedded/index.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +3 -2
- package/dist/src/agent/embedded/run-turn.js +88 -25
- package/dist/src/agent/embedded/session-tool-result-guard.js +2 -2
- package/dist/src/agent/embedded/subscribe-session.d.ts +2 -1
- package/dist/src/agent/embedded/subscribe-session.js +2 -1
- package/dist/src/agent/embedded/types.d.ts +3 -1
- package/dist/src/agent/embedded/xopc-tools-bridge.js +4 -1
- package/dist/src/agent/image/index.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/index.js +3 -3
- package/dist/src/agent/ipc/inbox.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/memory/user-context-coordinator.js +1 -1
- package/dist/src/agent/middleware/index.d.ts +0 -5
- package/dist/src/agent/middleware/index.js +1 -2
- package/dist/src/agent/orchestration/agent-event-handler.d.ts +0 -5
- package/dist/src/agent/orchestration/agent-event-handler.js +1 -96
- package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
- package/dist/src/agent/orchestration/agent-turn-policy.js +5 -5
- package/dist/src/agent/orchestration/index.d.ts +1 -1
- package/dist/src/agent/orchestration/index.js +2 -2
- package/dist/src/agent/orchestration/loop-guard.d.ts +4 -31
- package/dist/src/agent/orchestration/loop-guard.js +14 -99
- package/dist/src/agent/prompt/sections/tooling.js +2 -4
- package/dist/src/agent/sandbox/types.d.ts +2 -2
- package/dist/src/agent/sandbox/types.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +1 -1
- package/dist/src/agent/service.d.ts +0 -2
- package/dist/src/agent/service.js +8 -25
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.d.ts +7 -0
- package/dist/src/agent/tasks/task-judge-service.js +27 -5
- package/dist/src/agent/tools/delegate-tool.d.ts +2 -1
- package/dist/src/agent/tools/delegate-tool.js +102 -124
- package/dist/src/agent/tools/exec-command.d.ts +8 -1
- package/dist/src/agent/tools/exec-command.js +77 -169
- package/dist/src/agent/tools/executor.js +9 -2
- package/dist/src/agent/tools/factory.js +50 -5
- package/dist/src/agent/tools/find.d.ts +10 -13
- package/dist/src/agent/tools/find.js +33 -80
- package/dist/src/agent/tools/grep.d.ts +14 -18
- package/dist/src/agent/tools/grep.js +56 -144
- package/dist/src/agent/tools/index.d.ts +0 -1
- package/dist/src/agent/tools/index.js +2 -3
- package/dist/src/agent/tools/language-diagnostics.d.ts +11 -0
- package/dist/src/agent/tools/language-diagnostics.js +62 -0
- package/dist/src/agent/tools/managed-job-tool.d.ts +2 -1
- package/dist/src/agent/tools/managed-job-tool.js +58 -118
- package/dist/src/agent/tools/read.js +24 -7
- package/dist/src/agent/tools/repository-search.d.ts +5 -0
- package/dist/src/agent/tools/repository-search.js +56 -0
- package/dist/src/agent/tools/review-workspace.d.ts +2 -0
- package/dist/src/agent/tools/review-workspace.js +103 -0
- package/dist/src/agent/tools/write.js +4 -4
- package/dist/src/agent/transcript/index.js +2 -2
- package/dist/src/agent/transcript/transcript-hygiene.js +2 -2
- package/dist/src/agent/workflow/subagent-runner.d.ts +0 -2
- package/dist/src/agent/workflow/subagent-runner.js +12 -31
- package/dist/src/agent-config/schema.d.ts +42 -0
- package/dist/src/agent-config/schema.js +5 -0
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/cli/commands/agent.js +2 -2
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/models.js +2 -2
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/profile.js +1 -1
- package/dist/src/cli/commands/tunnel.js +1 -1
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/cli/extension-cli-register.js +1 -1
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +28 -0
- package/dist/src/execution-environments/local-worktree-manager.d.ts +3 -1
- package/dist/src/execution-environments/local-worktree-manager.js +8 -3
- package/dist/src/execution-environments/session-environment-service.js +5 -3
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +7 -0
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/sessions.js +1 -1
- package/dist/src/gateway/media-access.js +1 -1
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/service/config-coordinator.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +4 -1
- package/dist/src/gateway/service.js +7 -7
- package/dist/src/gateway/session-reset-service.js +1 -1
- package/dist/src/gateway/workspace-ripgrep.d.ts +0 -6
- package/dist/src/gateway/workspace-ripgrep.js +2 -40
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/infra/ripgrep.d.ts +13 -0
- package/dist/src/infra/ripgrep.js +46 -0
- package/dist/src/infra/update-runner.js +1 -1
- package/dist/src/proactive/execution/agent-executor.js +1 -1
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/session/store.js +1 -1
- package/dist/src/session/turn-outcome-projector.js +26 -6
- package/dist/src/share/hosted-session-share.js +1 -1
- package/dist/src/tasks/task-run-coordinator.d.ts +2 -2
- package/dist/src/tasks/task-run-coordinator.js +14 -12
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/messages-CTSgFlE4.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-cache-ZrbGRiGY.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CSYy6SUa.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BNMc4l04.js +0 -1
- package/dist/src/agent/coding/turn-diff-tracker.d.ts +0 -67
- package/dist/src/agent/coding/turn-diff-tracker.js +0 -231
- package/dist/src/agent/middleware/self-verify.d.ts +0 -136
- package/dist/src/agent/middleware/self-verify.js +0 -380
- package/dist/src/agent/tools/execute-code-tool.d.ts +0 -11
- package/dist/src/agent/tools/execute-code-tool.js +0 -208
|
@@ -1,105 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { init_logger } from "../../utils/logger.js";
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
3
2
|
//#region src/agent/orchestration/loop-guard.ts
|
|
4
|
-
init_logger();
|
|
5
|
-
const log = createLogger("LoopGuard");
|
|
6
|
-
const DEFAULT_CONFIG = {
|
|
7
|
-
softThreshold: 2,
|
|
8
|
-
hideThreshold: 3
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Stable fingerprint for tool call comparison.
|
|
12
|
-
* Recursively sorts object keys; truncates long string values.
|
|
13
|
-
*/
|
|
14
|
-
function stableJson(value) {
|
|
15
|
-
return JSON.stringify(value, (_key, item) => {
|
|
16
|
-
if (typeof item === "object" && item !== null && !Array.isArray(item)) return Object.fromEntries(Object.entries(item).sort(([a], [b]) => a.localeCompare(b)));
|
|
17
|
-
if (typeof item === "string" && item.length > 200) return `${item.slice(0, 80)}…[${item.length}]`;
|
|
18
|
-
return item;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
3
|
function fingerprint(call) {
|
|
22
|
-
const
|
|
23
|
-
return
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Analyze recent tool calls and produce loop guard result.
|
|
27
|
-
*
|
|
28
|
-
* Pure function — no side effects, no shared state.
|
|
29
|
-
*/
|
|
30
|
-
function detectToolLoops(recentCalls, config = {}) {
|
|
31
|
-
const { softThreshold, hideThreshold } = {
|
|
32
|
-
...DEFAULT_CONFIG,
|
|
33
|
-
...config
|
|
34
|
-
};
|
|
35
|
-
if (recentCalls.length === 0) return {
|
|
36
|
-
injection: null,
|
|
37
|
-
hiddenTools: /* @__PURE__ */ new Set()
|
|
38
|
-
};
|
|
39
|
-
const consecutiveGroups = findConsecutiveRepeats(recentCalls);
|
|
40
|
-
const frequencyMap = countFrequency(recentCalls);
|
|
41
|
-
const warnings = [];
|
|
42
|
-
const hiddenTools = /* @__PURE__ */ new Set();
|
|
43
|
-
for (const group of consecutiveGroups) if (group.count >= hideThreshold) {
|
|
44
|
-
hiddenTools.add(group.toolName);
|
|
45
|
-
warnings.push(`Tool '${group.toolName}' has been called ${group.count} times consecutively with identical arguments and is now unavailable. Use a completely different approach.`);
|
|
46
|
-
log.warn({
|
|
47
|
-
tool: group.toolName,
|
|
48
|
-
consecutiveCount: group.count
|
|
49
|
-
}, "Loop guard: hiding tool from LLM");
|
|
50
|
-
} else if (group.count >= softThreshold) {
|
|
51
|
-
warnings.push(`You have called '${group.toolName}' ${group.count} times with the same arguments. This is not producing new information. Do NOT call it again with the same arguments — try a different approach.`);
|
|
52
|
-
log.debug({
|
|
53
|
-
tool: group.toolName,
|
|
54
|
-
consecutiveCount: group.count
|
|
55
|
-
}, "Loop guard: soft warning injected");
|
|
56
|
-
}
|
|
57
|
-
for (const [fp, count] of frequencyMap) {
|
|
58
|
-
const toolName = fp.split("::")[0];
|
|
59
|
-
if (count >= hideThreshold + 1 && !hiddenTools.has(toolName)) {
|
|
60
|
-
if (!consecutiveGroups.some((g) => g.toolName === toolName && g.count >= softThreshold)) warnings.push(`Tool '${toolName}' has been called ${count} times this turn with the same arguments (interleaved). Stop repeating this pattern.`);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
injection: warnings.length > 0 ? `⚠️ LOOP DETECTION:\n${warnings.join("\n")}\n\nYou MUST take a different approach. Do not repeat the same tool calls.` : null,
|
|
65
|
-
hiddenTools
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Find consecutive runs of identical (tool+params) calls from the end of history.
|
|
70
|
-
* Returns all groups with count >= 2 (most recent first).
|
|
71
|
-
*/
|
|
72
|
-
function findConsecutiveRepeats(calls) {
|
|
73
|
-
const groups = [];
|
|
74
|
-
let index = calls.length - 1;
|
|
75
|
-
while (index >= 0) {
|
|
76
|
-
const current = calls[index];
|
|
77
|
-
const fp = fingerprint(current);
|
|
78
|
-
let count = 1;
|
|
79
|
-
while (index - count >= 0) {
|
|
80
|
-
const prev = calls[index - count];
|
|
81
|
-
if (fingerprint(prev) !== fp) break;
|
|
82
|
-
count++;
|
|
83
|
-
}
|
|
84
|
-
if (count >= 2) groups.push({
|
|
85
|
-
toolName: current.name,
|
|
86
|
-
fingerprint: fp,
|
|
87
|
-
count
|
|
88
|
-
});
|
|
89
|
-
index -= count;
|
|
90
|
-
}
|
|
91
|
-
return groups;
|
|
4
|
+
const value = JSON.stringify(call, (_key, item) => item && typeof item === "object" && !Array.isArray(item) ? Object.fromEntries(Object.entries(item).sort(([a], [b]) => a.localeCompare(b))) : item);
|
|
5
|
+
return createHash("sha256").update(value).digest("hex");
|
|
92
6
|
}
|
|
93
|
-
/**
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return
|
|
7
|
+
/** Warn on a stalled tail, without removing tools needed to recover or verify a repair. */
|
|
8
|
+
function detectToolLoops(recentCalls) {
|
|
9
|
+
const calls = recentCalls.slice(-12);
|
|
10
|
+
const last = calls.at(-1);
|
|
11
|
+
if (!last) return { injection: null };
|
|
12
|
+
const hashes = calls.map(fingerprint);
|
|
13
|
+
let count = 0;
|
|
14
|
+
for (let index = hashes.length - 1; index >= 0 && hashes[index] === hashes.at(-1); index--) count++;
|
|
15
|
+
const alternating = hashes.length >= 6 && hashes.slice(-6, -3).every((hash, index) => hash === hashes.at(-3 + index));
|
|
16
|
+
if (count < 2 && !alternating) return { injection: null };
|
|
17
|
+
return { injection: `Repeated tool calls are producing no new evidence (${last.name}, ${count >= 2 ? `${count} identical calls` : "repeated cycle"}). Change the query or fix the cause before retrying. For a running job use managed_job wait. Tools remain available for a different argument or a changed workspace.` };
|
|
103
18
|
}
|
|
104
19
|
//#endregion
|
|
105
20
|
export { detectToolLoops };
|
|
@@ -34,8 +34,7 @@ const CORE_TOOL_ORDER = [
|
|
|
34
34
|
"text_to_speech",
|
|
35
35
|
"image",
|
|
36
36
|
"image_generate",
|
|
37
|
-
"create_share"
|
|
38
|
-
"execute_code"
|
|
37
|
+
"create_share"
|
|
39
38
|
];
|
|
40
39
|
const CORE_TOOL_SUMMARIES = {
|
|
41
40
|
read_file: "Read targeted file contents before editing",
|
|
@@ -72,8 +71,7 @@ const CORE_TOOL_SUMMARIES = {
|
|
|
72
71
|
text_to_speech: "Send a standalone voice message",
|
|
73
72
|
image: "Analyze an image with the configured vision model",
|
|
74
73
|
image_generate: "Generate images with the configured image model",
|
|
75
|
-
create_share: "Create a shareable link for workspace files"
|
|
76
|
-
execute_code: "Run code in a sandbox with a restricted tool subset"
|
|
74
|
+
create_share: "Create a shareable link for workspace files"
|
|
77
75
|
};
|
|
78
76
|
function buildToolingSection(params) {
|
|
79
77
|
const rawToolNames = (params.toolNames ?? []).map((tool) => tool.trim()).filter(Boolean);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Preflight command/path policy. OS isolation is provided by the command runtime.
|
|
3
3
|
*/
|
|
4
4
|
/** Controls how strictly the sandbox enforces isolation. */
|
|
5
|
-
export type SandboxMode = 'off' | 'basic'
|
|
5
|
+
export type SandboxMode = 'off' | 'basic';
|
|
6
6
|
/** Result of path validation against the sandbox policy. */
|
|
7
7
|
export type PathValidationResult = {
|
|
8
8
|
allowed: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { buildTaskExecutionDirective } from "../../tasks/task-context-assembler.js";
|
|
2
1
|
import { resolveImageHandlingStrategy } from "../image/vision-detection.js";
|
|
3
2
|
import { hydrateUserTurnForLlm } from "../inbound/attachment-pipeline.js";
|
|
3
|
+
import { buildTaskExecutionDirective } from "../../tasks/task-context-assembler.js";
|
|
4
4
|
import { prependAgentContext } from "../../user-context/planner.js";
|
|
5
5
|
import { extractAgentUserPlainText } from "../memory/user-message-text.js";
|
|
6
6
|
import { shouldSkipResetOverlapCommand } from "../../session/reset-triggers.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
2
|
+
import { abortEmbeddedRun } from "../embedded/runs.js";
|
|
2
3
|
import { clearPendingTranscriptUserMessage, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
|
|
3
4
|
import { formatAgentRunErrorForClient } from "../client-error-format.js";
|
|
4
5
|
import { resolveConfiguredActivityDetailDefault, resolveEffectiveReasoningLevel } from "../../session/thinking-resolve.js";
|
|
@@ -6,7 +7,6 @@ import { initSessionTurn } from "../../session/init-session-turn.js";
|
|
|
6
7
|
import "../../session/index.js";
|
|
7
8
|
import { mergeSttConfigFromAppConfig } from "../../voice/stt/config.js";
|
|
8
9
|
import "../../voice/stt/index.js";
|
|
9
|
-
import { abortEmbeddedRun } from "../embedded/runs.js";
|
|
10
10
|
import { isVoiceLikeAttachment, mergeVoiceTranscriptsIntoUserText } from "../../channels/attachments/voice-stt-webchat.js";
|
|
11
11
|
import { applyReasoningVisibility } from "../streaming/reasoning-visibility.js";
|
|
12
12
|
import { isSessionSourceBinding, summarizeSourceContext } from "../source-context/types.js";
|
|
@@ -38,8 +38,6 @@ export declare class AgentService {
|
|
|
38
38
|
private toolUsageAnalyzer;
|
|
39
39
|
private toolChainTracker;
|
|
40
40
|
private errorPatternMatcher;
|
|
41
|
-
private selfVerifyMiddleware;
|
|
42
|
-
private turnDiffTracker;
|
|
43
41
|
private contextMiddleware;
|
|
44
42
|
private messageRouter;
|
|
45
43
|
private commandHandler;
|
|
@@ -3,10 +3,10 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import { getUserProfile } from "../storage/sqlite/user-context-repository.js";
|
|
4
4
|
import { parseNoteAttachmentTarget } from "../notes/attachment-ref.js";
|
|
5
5
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
6
|
-
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
7
6
|
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
8
|
-
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
9
7
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
8
|
+
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
9
|
+
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
10
10
|
import { extractTextContent } from "./context/workspace.js";
|
|
11
11
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
12
12
|
import { getProjectForSession } from "../projects/workspace.js";
|
|
@@ -15,10 +15,11 @@ import { removeSkillsLockEntry } from "./skills/hub-lock.js";
|
|
|
15
15
|
import { installSkillFromZip } from "./skills/managed-store.js";
|
|
16
16
|
import { pullSkillFromSource } from "./skills/hub-pull.js";
|
|
17
17
|
import { resolveAgentTurnTimeoutMs } from "./orchestration/run-agent-turn-with-timeout.js";
|
|
18
|
-
import { resolveResponseLanguageForSession } from "./prompt/response-language.js";
|
|
19
|
-
import { normalizeSkillInstallTarget } from "./skills/install-target.js";
|
|
20
18
|
import { onSessionTranscriptUpdate } from "../session/transcript-events.js";
|
|
21
19
|
import { persistInboundAttachments } from "../channels/attachments/inbound-persist.js";
|
|
20
|
+
import { runXopcEmbeddedTurn } from "./embedded/run-turn.js";
|
|
21
|
+
import { resolveResponseLanguageForSession } from "./prompt/response-language.js";
|
|
22
|
+
import { normalizeSkillInstallTarget } from "./skills/install-target.js";
|
|
22
23
|
import { AgentManager } from "./agent-manager.js";
|
|
23
24
|
import { maybeRefineSessionTitleWithLlm, maybeSetProvisionalSessionTitle } from "../session/session-title.js";
|
|
24
25
|
import { resolveCompactionPolicy } from "./memory/compaction-policy.js";
|
|
@@ -38,13 +39,10 @@ import { SystemReminder } from "./prompt/system-reminder.js";
|
|
|
38
39
|
import { ToolUsageAnalyzer } from "./tools/usage-analyzer.js";
|
|
39
40
|
import { ToolChainTracker } from "./tools/chain-tracker.js";
|
|
40
41
|
import { ErrorPatternMatcher } from "./tools/error-pattern-matcher.js";
|
|
41
|
-
import { SelfVerifyMiddleware } from "./middleware/self-verify.js";
|
|
42
42
|
import { ContextMiddleware } from "./middleware/context.js";
|
|
43
43
|
import "./middleware/index.js";
|
|
44
|
-
import { TurnDiffTracker } from "./coding/turn-diff-tracker.js";
|
|
45
44
|
import { LifecycleManager } from "./lifecycle/manager.js";
|
|
46
45
|
import "./lifecycle/index.js";
|
|
47
|
-
import { runXopcEmbeddedTurn } from "./embedded/run-turn.js";
|
|
48
46
|
import { runWithEmbeddedExecutionSession } from "./embedded/execution-context.js";
|
|
49
47
|
import { MessageRouter } from "./messaging/message-router.js";
|
|
50
48
|
import { CommandHandler } from "./messaging/command-handler.js";
|
|
@@ -106,8 +104,6 @@ var AgentService = class {
|
|
|
106
104
|
toolUsageAnalyzer;
|
|
107
105
|
toolChainTracker;
|
|
108
106
|
errorPatternMatcher;
|
|
109
|
-
selfVerifyMiddleware;
|
|
110
|
-
turnDiffTracker;
|
|
111
107
|
contextMiddleware;
|
|
112
108
|
messageRouter;
|
|
113
109
|
commandHandler;
|
|
@@ -242,19 +238,16 @@ var AgentService = class {
|
|
|
242
238
|
onSkillsUpdated: config.onSkillsUpdated,
|
|
243
239
|
installSkillFromSource: (opts) => this.installSkillFromSource(opts),
|
|
244
240
|
installSkillFromMarketplace: (opts) => this.installSkillFromMarketplace(opts),
|
|
245
|
-
isWorkspaceTrusted: config.isWorkspaceTrusted
|
|
246
|
-
getSelfVerifyPromptContext: (sessionKey, agentId) => [this.selfVerifyMiddleware.getPendingVerificationContext(sessionKey, agentId), this.turnDiffTracker.buildFinalGuardContext(sessionKey)].filter(Boolean).join("\n\n")
|
|
241
|
+
isWorkspaceTrusted: config.isWorkspaceTrusted
|
|
247
242
|
});
|
|
248
243
|
this.agentEventHandler = new AgentEventHandler({
|
|
249
244
|
errorTracker: this.errorTracker,
|
|
250
245
|
requestLimiter: this.requestLimiter,
|
|
251
246
|
lifecycleManager: this.lifecycleManager,
|
|
252
247
|
toolChainTracker: this.toolChainTracker,
|
|
253
|
-
selfVerifyMiddleware: this.selfVerifyMiddleware,
|
|
254
248
|
systemReminder: this.systemReminder,
|
|
255
249
|
toolUsageAnalyzer: this.toolUsageAnalyzer,
|
|
256
|
-
errorPatternMatcher: this.errorPatternMatcher
|
|
257
|
-
turnDiffTracker: this.turnDiffTracker
|
|
250
|
+
errorPatternMatcher: this.errorPatternMatcher
|
|
258
251
|
});
|
|
259
252
|
this.agentEventHandler.registerListener("message_end", (event, context) => {
|
|
260
253
|
const message = event.message;
|
|
@@ -438,13 +431,6 @@ var AgentService = class {
|
|
|
438
431
|
maxTotalFailures: 5,
|
|
439
432
|
resetOnTurnEnd: true
|
|
440
433
|
});
|
|
441
|
-
this.selfVerifyMiddleware = new SelfVerifyMiddleware({
|
|
442
|
-
maxEditsPerFile: 5,
|
|
443
|
-
enablePreCompletionCheck: true,
|
|
444
|
-
minTurnsForVerification: 4,
|
|
445
|
-
resetOnVerification: true
|
|
446
|
-
});
|
|
447
|
-
this.turnDiffTracker = new TurnDiffTracker();
|
|
448
434
|
this.requestLimiter = new RequestLimiter({
|
|
449
435
|
maxRequestsPerTurn: 50,
|
|
450
436
|
warnThreshold: .8,
|
|
@@ -836,10 +822,7 @@ var AgentService = class {
|
|
|
836
822
|
handleSessionEvent(sessionKey, event) {
|
|
837
823
|
const currentContext = this.sessionContextManager.getContext();
|
|
838
824
|
if (!currentContext) return;
|
|
839
|
-
if (currentContext.sessionKey !== sessionKey)
|
|
840
|
-
this.agentEventHandler.handle(event, currentContext);
|
|
841
|
-
return;
|
|
842
|
-
}
|
|
825
|
+
if (currentContext.sessionKey !== sessionKey) return;
|
|
843
826
|
if (event.type === "message_update") {
|
|
844
827
|
const msgEvent = event;
|
|
845
828
|
if (msgEvent.message?.role === "assistant") {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { init_workspace_defaults, resolveDefaultAgentWorkspaceDir } from "../../config/workspace-defaults.js";
|
|
4
|
-
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
4
|
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
5
|
+
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
6
6
|
import { getExecutionEnvironmentForSession } from "../../execution-environments/subject.js";
|
|
7
7
|
import { effectiveWorkspacePathForSession, projectWorkspacePath } from "../../session/session-workspace.js";
|
|
8
8
|
import { getProjectForSession } from "../../projects/workspace.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_paths, resolveSkillsLockPath } from "../../config/paths.js";
|
|
2
1
|
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
|
+
import { init_paths, resolveSkillsLockPath } from "../../config/paths.js";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
//#region src/agent/skills/hub-lock.ts
|
|
5
5
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { TaskJudgment } from '@xopcai/gateway-contract';
|
|
2
2
|
import { type Config } from '../../config/schema.js';
|
|
3
3
|
import type { SessionStore } from '../../session/store.js';
|
|
4
|
+
import type { TranscriptStoredRow } from '../../session/session-context-for-llm.js';
|
|
4
5
|
import type { ModelManager } from '../models/index.js';
|
|
5
6
|
export interface TaskTurnCompletion {
|
|
6
7
|
sessionKey: string;
|
|
@@ -19,6 +20,12 @@ export interface TaskJudgeDecision {
|
|
|
19
20
|
judgment: TaskJudgment;
|
|
20
21
|
}
|
|
21
22
|
export declare function parseTaskJudgeDecision(raw: string, criteriaCount: number): TaskJudgeDecision;
|
|
23
|
+
export declare function codingCompletionEvidence(rows: readonly TranscriptStoredRow[]): {
|
|
24
|
+
allowed: boolean;
|
|
25
|
+
workspace?: string;
|
|
26
|
+
revision?: string;
|
|
27
|
+
evidence?: unknown;
|
|
28
|
+
};
|
|
22
29
|
export declare class TaskJudgeService {
|
|
23
30
|
#private;
|
|
24
31
|
private readonly options;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
|
|
3
4
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
4
|
-
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
5
|
import { getApiKey, init_providers, resolveModel } from "../../providers/index.js";
|
|
6
|
+
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
7
|
+
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
6
8
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
7
9
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
8
10
|
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
9
|
-
import {
|
|
11
|
+
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
10
12
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
11
|
-
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
|
|
12
13
|
//#region src/agent/tasks/task-judge-service.ts
|
|
13
14
|
init_schema();
|
|
14
15
|
init_providers();
|
|
@@ -51,6 +52,21 @@ function parseTaskJudgeDecision(raw, criteriaCount) {
|
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
54
|
}
|
|
55
|
+
function codingCompletionEvidence(rows) {
|
|
56
|
+
const entries = rows;
|
|
57
|
+
const start = entries.findLastIndex((row) => row.type === "custom" && row.customType === "coding_run_started");
|
|
58
|
+
const final = entries.findLastIndex((row) => row.type === "custom" && row.customType === "coding_verification");
|
|
59
|
+
const checkpoint = entries[Math.max(start, final)]?.data;
|
|
60
|
+
if (!checkpoint?.required) return { allowed: true };
|
|
61
|
+
if (start > final) return { allowed: false };
|
|
62
|
+
const evidence = Array.isArray(checkpoint.evidence) ? checkpoint.evidence : [];
|
|
63
|
+
return {
|
|
64
|
+
allowed: checkpoint.changed !== true || evidence.some((item) => item.kind === "check" && item.status === "passed") && evidence.some((item) => item.kind === "diff-review" && item.status === "passed") && evidence.every((item) => item.status === "passed"),
|
|
65
|
+
evidence,
|
|
66
|
+
workspace: typeof checkpoint.workspace === "string" ? checkpoint.workspace : void 0,
|
|
67
|
+
revision: typeof checkpoint.revision === "string" ? checkpoint.revision : void 0
|
|
68
|
+
};
|
|
69
|
+
}
|
|
54
70
|
function resolveJudgeModel(config, sessionKey, runtimeModel) {
|
|
55
71
|
if (config) {
|
|
56
72
|
const profile = resolveEffectiveAgentProfileForSession(config, sessionKey);
|
|
@@ -94,12 +110,14 @@ var TaskJudgeService = class {
|
|
|
94
110
|
return;
|
|
95
111
|
}
|
|
96
112
|
const history = compactHistory(await this.options.sessionStore.loadMessages(payload.sessionKey));
|
|
113
|
+
const proof = codingCompletionEvidence(await this.options.sessionStore.loadTranscriptRows(payload.sessionKey));
|
|
97
114
|
const criteria = task.contract.acceptanceCriteria;
|
|
98
115
|
const request = {
|
|
99
116
|
role: "user",
|
|
100
117
|
content: [
|
|
101
118
|
"You are an independent task verifier. Be strict and evidence-driven.",
|
|
102
|
-
"Mark a criterion complete only when
|
|
119
|
+
"Mark a criterion complete only when observed tool results or user-provided facts prove it. An assistant completion claim is not verification evidence.",
|
|
120
|
+
`Runtime coding evidence: ${JSON.stringify(proof)}`,
|
|
103
121
|
"needsUser is true only when a specific decision, permission, credential, or missing fact must come from the user.",
|
|
104
122
|
"Make one clear recommendation. Explain the decisive reasons, rejected alternatives, uncertainty, and calibrated confidence.",
|
|
105
123
|
"Return only JSON: {\"completedCriteria\":[0],\"needsUser\":false,\"nextAction\":\"...\",\"recommendation\":\"...\",\"reasons\":[\"...\"],\"rejectedAlternatives\":[{\"option\":\"...\",\"reason\":\"...\"}],\"uncertainty\":\"...\",\"confidence\":0.8}.",
|
|
@@ -120,6 +138,10 @@ var TaskJudgeService = class {
|
|
|
120
138
|
const modelError = getAssistantMessageErrorReason(response);
|
|
121
139
|
if (modelError) throw new Error(modelError);
|
|
122
140
|
const decision = parseTaskJudgeDecision(extractAssistantText(response.content), criteria.length);
|
|
141
|
+
if (!proof.allowed || proof.workspace && (!proof.revision || await readWorkspaceRevision(proof.workspace) !== proof.revision)) {
|
|
142
|
+
decision.completedCriteria = [];
|
|
143
|
+
decision.judgment.reasons.unshift("Current workspace verification is missing, failed or stale.");
|
|
144
|
+
}
|
|
123
145
|
const now = Date.now();
|
|
124
146
|
const evidence = decision.completedCriteria.map((index) => ({
|
|
125
147
|
kind: "state",
|
|
@@ -181,4 +203,4 @@ var TaskJudgeService = class {
|
|
|
181
203
|
}
|
|
182
204
|
};
|
|
183
205
|
//#endregion
|
|
184
|
-
export { TaskJudgeService, parseTaskJudgeDecision };
|
|
206
|
+
export { TaskJudgeService, codingCompletionEvidence, parseTaskJudgeDecision };
|
|
@@ -15,7 +15,6 @@ export interface DelegateToolDeps {
|
|
|
15
15
|
to?: string;
|
|
16
16
|
threadId?: string | number;
|
|
17
17
|
} | null;
|
|
18
|
-
hookRunner?: import('../../extensions/index.js').ExtensionHookRunner;
|
|
19
18
|
toolExecutorConfig?: Partial<import('./executor.js').ToolExecutorConfig>;
|
|
20
19
|
/**
|
|
21
20
|
* Construct the child agent's tool set. Injected by `AgentToolsFactory` so
|
|
@@ -24,4 +23,6 @@ export interface DelegateToolDeps {
|
|
|
24
23
|
*/
|
|
25
24
|
buildChildTools: (opts: BuildChildToolsOptions) => AgentTool<any, any>[];
|
|
26
25
|
}
|
|
26
|
+
export declare const INSPECTION_TOOLS: Set<string>;
|
|
27
|
+
export declare function delegateToolNames(mode: 'inspect' | 'review' | 'implement', requested?: string[]): string[];
|
|
27
28
|
export declare function createDelegateTool(deps: DelegateToolDeps): AgentTool;
|