agent-nuvira 2.7.3 → 3.0.1
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/agents/agents/writer-tool-calling.d.ts +14 -0
- package/dist/agents/agents/writer-tool-calling.d.ts.map +1 -1
- package/dist/agents/agents/writer-tool-calling.js +20 -0
- package/dist/agents/agents/writer-tool-calling.js.map +1 -1
- package/dist/agents/agents/writer.d.ts.map +1 -1
- package/dist/agents/agents/writer.js +15 -4
- package/dist/agents/agents/writer.js.map +1 -1
- package/dist/agents/edit-module.d.ts +7 -0
- package/dist/agents/edit-module.d.ts.map +1 -1
- package/dist/agents/edit-module.js +21 -6
- package/dist/agents/edit-module.js.map +1 -1
- package/dist/agents/orchestrator.d.ts +40 -0
- package/dist/agents/orchestrator.d.ts.map +1 -1
- package/dist/agents/orchestrator.js +116 -27
- package/dist/agents/orchestrator.js.map +1 -1
- package/dist/agents/tool-calling-agent.d.ts +19 -0
- package/dist/agents/tool-calling-agent.d.ts.map +1 -1
- package/dist/agents/tool-calling-agent.js +42 -2
- package/dist/agents/tool-calling-agent.js.map +1 -1
- package/dist/cli/chat.d.ts +55 -1
- package/dist/cli/chat.d.ts.map +1 -1
- package/dist/cli/chat.js +278 -72
- package/dist/cli/chat.js.map +1 -1
- package/dist/cli/cli-program.d.ts +6 -0
- package/dist/cli/cli-program.d.ts.map +1 -0
- package/dist/cli/cli-program.js +242 -0
- package/dist/cli/cli-program.js.map +1 -0
- package/dist/cli/edit.d.ts.map +1 -1
- package/dist/cli/edit.js +18 -3
- package/dist/cli/edit.js.map +1 -1
- package/dist/cli/execute.d.ts.map +1 -1
- package/dist/cli/execute.js +29 -5
- package/dist/cli/execute.js.map +1 -1
- package/dist/cli/failover-runner.d.ts +13 -0
- package/dist/cli/failover-runner.d.ts.map +1 -1
- package/dist/cli/failover-runner.js +11 -0
- package/dist/cli/failover-runner.js.map +1 -1
- package/dist/cli/gateway.d.ts +16 -0
- package/dist/cli/gateway.d.ts.map +1 -1
- package/dist/cli/gateway.js +108 -2
- package/dist/cli/gateway.js.map +1 -1
- package/dist/cli/loop-executor.d.ts.map +1 -1
- package/dist/cli/loop-executor.js +245 -12
- package/dist/cli/loop-executor.js.map +1 -1
- package/dist/cli/plan.d.ts.map +1 -1
- package/dist/cli/plan.js +20 -6
- package/dist/cli/plan.js.map +1 -1
- package/dist/cli/process-control.d.ts +10 -0
- package/dist/cli/process-control.d.ts.map +1 -1
- package/dist/cli/process-control.js +73 -7
- package/dist/cli/process-control.js.map +1 -1
- package/dist/cli/router.d.ts +16 -5
- package/dist/cli/router.d.ts.map +1 -1
- package/dist/cli/router.js +31 -206
- package/dist/cli/router.js.map +1 -1
- package/dist/config/paths.d.ts +23 -0
- package/dist/config/paths.d.ts.map +1 -1
- package/dist/config/paths.js +30 -0
- package/dist/config/paths.js.map +1 -1
- package/dist/config/provider-env.d.ts +37 -0
- package/dist/config/provider-env.d.ts.map +1 -0
- package/dist/config/provider-env.js +86 -0
- package/dist/config/provider-env.js.map +1 -0
- package/dist/context/history.d.ts.map +1 -1
- package/dist/context/history.js +24 -8
- package/dist/context/history.js.map +1 -1
- package/dist/context/session-recall.d.ts +30 -0
- package/dist/context/session-recall.d.ts.map +1 -1
- package/dist/context/session-recall.js +61 -0
- package/dist/context/session-recall.js.map +1 -1
- package/dist/file.js +0 -1
- package/dist/file.js.map +1 -1
- package/dist/gateway/adapters.d.ts +10 -0
- package/dist/gateway/adapters.d.ts.map +1 -1
- package/dist/gateway/adapters.js +4 -1
- package/dist/gateway/adapters.js.map +1 -1
- package/dist/gateway/dedup.d.ts +105 -0
- package/dist/gateway/dedup.d.ts.map +1 -0
- package/dist/gateway/dedup.js +160 -0
- package/dist/gateway/dedup.js.map +1 -0
- package/dist/gateway/heartbeat.d.ts +99 -0
- package/dist/gateway/heartbeat.d.ts.map +1 -0
- package/dist/gateway/heartbeat.js +122 -0
- package/dist/gateway/heartbeat.js.map +1 -0
- package/dist/gateway/inbox.d.ts +14 -1
- package/dist/gateway/inbox.d.ts.map +1 -1
- package/dist/gateway/inbox.js.map +1 -1
- package/dist/gateway/platform-config.d.ts +5 -0
- package/dist/gateway/platform-config.d.ts.map +1 -1
- package/dist/gateway/platform-config.js +8 -13
- package/dist/gateway/platform-config.js.map +1 -1
- package/dist/gateway/registry.d.ts +47 -0
- package/dist/gateway/registry.d.ts.map +1 -1
- package/dist/gateway/registry.js +227 -21
- package/dist/gateway/registry.js.map +1 -1
- package/dist/gateway/whatsapp/baileys-bridge.d.ts +11 -1
- package/dist/gateway/whatsapp/baileys-bridge.d.ts.map +1 -1
- package/dist/gateway/whatsapp/baileys-bridge.js +64 -1
- package/dist/gateway/whatsapp/baileys-bridge.js.map +1 -1
- package/dist/gateway/whatsapp/bridge.d.ts +4 -2
- package/dist/gateway/whatsapp/bridge.d.ts.map +1 -1
- package/dist/gateway/whatsapp/bridge.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/inference/factory.d.ts +16 -0
- package/dist/inference/factory.d.ts.map +1 -1
- package/dist/inference/factory.js +42 -0
- package/dist/inference/factory.js.map +1 -1
- package/dist/inference/gemini-adapter.d.ts.map +1 -1
- package/dist/inference/gemini-adapter.js +3 -0
- package/dist/inference/gemini-adapter.js.map +1 -1
- package/dist/inference/interface.d.ts +12 -0
- package/dist/inference/interface.d.ts.map +1 -1
- package/dist/inference/local-adapter.d.ts +2 -0
- package/dist/inference/local-adapter.d.ts.map +1 -1
- package/dist/inference/local-adapter.js +36 -5
- package/dist/inference/local-adapter.js.map +1 -1
- package/dist/inference/native-tools.d.ts +8 -0
- package/dist/inference/native-tools.d.ts.map +1 -1
- package/dist/inference/native-tools.js +14 -3
- package/dist/inference/native-tools.js.map +1 -1
- package/dist/inference/tool-call-utils.d.ts +92 -7
- package/dist/inference/tool-call-utils.d.ts.map +1 -1
- package/dist/inference/tool-call-utils.js +203 -13
- package/dist/inference/tool-call-utils.js.map +1 -1
- package/dist/learning/auto-router.d.ts.map +1 -1
- package/dist/learning/auto-router.js +90 -5
- package/dist/learning/auto-router.js.map +1 -1
- package/dist/learning/context-budget.d.ts +133 -0
- package/dist/learning/context-budget.d.ts.map +1 -0
- package/dist/learning/context-budget.js +196 -0
- package/dist/learning/context-budget.js.map +1 -0
- package/dist/learning/cost-tracker.d.ts.map +1 -1
- package/dist/learning/cost-tracker.js +20 -8
- package/dist/learning/cost-tracker.js.map +1 -1
- package/dist/learning/eval-framework.d.ts.map +1 -1
- package/dist/learning/eval-framework.js +6 -2
- package/dist/learning/eval-framework.js.map +1 -1
- package/dist/learning/failure-bookkeeping.d.ts +19 -0
- package/dist/learning/failure-bookkeeping.d.ts.map +1 -1
- package/dist/learning/failure-bookkeeping.js +67 -2
- package/dist/learning/failure-bookkeeping.js.map +1 -1
- package/dist/learning/feedback.d.ts.map +1 -1
- package/dist/learning/feedback.js +19 -8
- package/dist/learning/feedback.js.map +1 -1
- package/dist/learning/model-harness.d.ts +76 -0
- package/dist/learning/model-harness.d.ts.map +1 -0
- package/dist/learning/model-harness.js +119 -0
- package/dist/learning/model-harness.js.map +1 -0
- package/dist/learning/model-selection.d.ts +15 -0
- package/dist/learning/model-selection.d.ts.map +1 -1
- package/dist/learning/model-selection.js +27 -1
- package/dist/learning/model-selection.js.map +1 -1
- package/dist/learning/provider-fallback.d.ts +12 -0
- package/dist/learning/provider-fallback.d.ts.map +1 -1
- package/dist/learning/provider-fallback.js +74 -0
- package/dist/learning/provider-fallback.js.map +1 -1
- package/dist/learning/provider-revival.d.ts +106 -0
- package/dist/learning/provider-revival.d.ts.map +1 -0
- package/dist/learning/provider-revival.js +154 -0
- package/dist/learning/provider-revival.js.map +1 -0
- package/dist/learning/resilient-call.d.ts.map +1 -1
- package/dist/learning/resilient-call.js +48 -3
- package/dist/learning/resilient-call.js.map +1 -1
- package/dist/nlu/conversation-gate.d.ts +37 -0
- package/dist/nlu/conversation-gate.d.ts.map +1 -1
- package/dist/nlu/conversation-gate.js +49 -0
- package/dist/nlu/conversation-gate.js.map +1 -1
- package/dist/nlu/schema.d.ts +2 -2
- package/dist/observability/dag-bridge.d.ts +69 -0
- package/dist/observability/dag-bridge.d.ts.map +1 -0
- package/dist/observability/dag-bridge.js +56 -0
- package/dist/observability/dag-bridge.js.map +1 -0
- package/dist/observability/event-bus.d.ts +5 -10
- package/dist/observability/event-bus.d.ts.map +1 -1
- package/dist/observability/event-bus.js +10 -42
- package/dist/observability/event-bus.js.map +1 -1
- package/dist/skills/execution-audit.d.ts.map +1 -1
- package/dist/skills/execution-audit.js +17 -5
- package/dist/skills/execution-audit.js.map +1 -1
- package/dist/skills/sandbox-executor.d.ts +12 -1
- package/dist/skills/sandbox-executor.d.ts.map +1 -1
- package/dist/skills/sandbox-executor.js +28 -6
- package/dist/skills/sandbox-executor.js.map +1 -1
- package/dist/skills/secret-capture.d.ts +45 -1
- package/dist/skills/secret-capture.d.ts.map +1 -1
- package/dist/skills/secret-capture.js +82 -19
- package/dist/skills/secret-capture.js.map +1 -1
- package/dist/skills/skill-env-inventory.d.ts +79 -0
- package/dist/skills/skill-env-inventory.d.ts.map +1 -0
- package/dist/skills/skill-env-inventory.js +167 -0
- package/dist/skills/skill-env-inventory.js.map +1 -0
- package/dist/skills/skill-executor.d.ts +2 -0
- package/dist/skills/skill-executor.d.ts.map +1 -1
- package/dist/skills/skill-executor.js +19 -24
- package/dist/skills/skill-executor.js.map +1 -1
- package/dist/tools/ask-user.d.ts +14 -1
- package/dist/tools/ask-user.d.ts.map +1 -1
- package/dist/tools/ask-user.js +25 -1
- package/dist/tools/ask-user.js.map +1 -1
- package/dist/tools/followup-utils.d.ts +64 -0
- package/dist/tools/followup-utils.d.ts.map +1 -0
- package/dist/tools/followup-utils.js +158 -0
- package/dist/tools/followup-utils.js.map +1 -0
- package/dist/tools/loop-skill-hint.d.ts.map +1 -1
- package/dist/tools/loop-skill-hint.js +22 -1
- package/dist/tools/loop-skill-hint.js.map +1 -1
- package/dist/tools/memory-tools.d.ts +35 -0
- package/dist/tools/memory-tools.d.ts.map +1 -1
- package/dist/tools/memory-tools.js +76 -0
- package/dist/tools/memory-tools.js.map +1 -1
- package/dist/tools/pipeline-tool.d.ts.map +1 -1
- package/dist/tools/pipeline-tool.js +8 -3
- package/dist/tools/pipeline-tool.js.map +1 -1
- package/dist/tools/registry.d.ts +25 -12
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +31 -6
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/skill-tool.d.ts.map +1 -1
- package/dist/tools/skill-tool.js +52 -5
- package/dist/tools/skill-tool.js.map +1 -1
- package/dist/tools/tool-loop.d.ts +63 -1
- package/dist/tools/tool-loop.d.ts.map +1 -1
- package/dist/tools/tool-loop.js +305 -66
- package/dist/tools/tool-loop.js.map +1 -1
- package/dist/tools/toolsets.d.ts +19 -3
- package/dist/tools/toolsets.d.ts.map +1 -1
- package/dist/tools/toolsets.js +21 -5
- package/dist/tools/toolsets.js.map +1 -1
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/env.js +9 -13
- package/dist/utils/env.js.map +1 -1
- package/dist/web-dashboard/chat-console.d.ts +13 -1
- package/dist/web-dashboard/chat-console.d.ts.map +1 -1
- package/dist/web-dashboard/chat-console.js +16 -2
- package/dist/web-dashboard/chat-console.js.map +1 -1
- package/dist/web-dashboard/hub-data.d.ts +2 -0
- package/dist/web-dashboard/hub-data.d.ts.map +1 -1
- package/dist/web-dashboard/hub-data.js +4 -0
- package/dist/web-dashboard/hub-data.js.map +1 -1
- package/dist/web-dashboard/server.d.ts +6 -0
- package/dist/web-dashboard/server.d.ts.map +1 -1
- package/dist/web-dashboard/server.js +192 -3
- package/dist/web-dashboard/server.js.map +1 -1
- package/dist/web-dashboard/src/types.d.ts +31 -1
- package/dist/web-dashboard/src/types.d.ts.map +1 -1
- package/package.json +11 -1
- package/src/web-dashboard/public/assets/index-56yPnN_m.js +207 -0
- package/src/web-dashboard/public/assets/index-56yPnN_m.js.map +1 -0
- package/src/web-dashboard/public/assets/{index-C507EUWf.css → index-Cyd6tIew.css} +1 -1
- package/src/web-dashboard/public/index.html +2 -2
- package/dist/example.d.ts +0 -1
- package/dist/example.d.ts.map +0 -1
- package/dist/example.js +0 -3
- package/dist/example.js.map +0 -1
- package/dist/fresh.d.ts +0 -2
- package/dist/fresh.d.ts.map +0 -1
- package/dist/fresh.js +0 -2
- package/dist/fresh.js.map +0 -1
- package/dist/mcp/mcp-dashboard-oauth.d.ts +0 -94
- package/dist/mcp/mcp-dashboard-oauth.d.ts.map +0 -1
- package/dist/mcp/mcp-dashboard-oauth.js +0 -140
- package/dist/mcp/mcp-dashboard-oauth.js.map +0 -1
- package/dist/memory/background-sync.d.ts +0 -107
- package/dist/memory/background-sync.d.ts.map +0 -1
- package/dist/memory/background-sync.js +0 -242
- package/dist/memory/background-sync.js.map +0 -1
- package/dist/memory/cross-session.d.ts +0 -68
- package/dist/memory/cross-session.d.ts.map +0 -1
- package/dist/memory/cross-session.js +0 -153
- package/dist/memory/cross-session.js.map +0 -1
- package/dist/memory/drift-detector.d.ts +0 -76
- package/dist/memory/drift-detector.d.ts.map +0 -1
- package/dist/memory/drift-detector.js +0 -216
- package/dist/memory/drift-detector.js.map +0 -1
- package/dist/memory/enhanced-manager.d.ts +0 -105
- package/dist/memory/enhanced-manager.d.ts.map +0 -1
- package/dist/memory/enhanced-manager.js +0 -280
- package/dist/memory/enhanced-manager.js.map +0 -1
- package/dist/memory/session-extraction.d.ts +0 -93
- package/dist/memory/session-extraction.d.ts.map +0 -1
- package/dist/memory/session-extraction.js +0 -290
- package/dist/memory/session-extraction.js.map +0 -1
- package/dist/memory/sqlite-store.d.ts +0 -208
- package/dist/memory/sqlite-store.d.ts.map +0 -1
- package/dist/memory/sqlite-store.js +0 -556
- package/dist/memory/sqlite-store.js.map +0 -1
- package/dist/skills/daytona-executor.d.ts +0 -78
- package/dist/skills/daytona-executor.d.ts.map +0 -1
- package/dist/skills/daytona-executor.js +0 -256
- package/dist/skills/daytona-executor.js.map +0 -1
- package/dist/skills/modal-executor.d.ts +0 -81
- package/dist/skills/modal-executor.d.ts.map +0 -1
- package/dist/skills/modal-executor.js +0 -285
- package/dist/skills/modal-executor.js.map +0 -1
- package/dist/sync/inventory.d.ts +0 -1
- package/dist/sync/inventory.d.ts.map +0 -1
- package/dist/sync/inventory.js +0 -3
- package/dist/sync/inventory.js.map +0 -1
- package/dist/sync/validate.d.ts +0 -1
- package/dist/sync/validate.d.ts.map +0 -1
- package/dist/sync/validate.js +0 -3
- package/dist/sync/validate.js.map +0 -1
- package/dist/test.d.ts +0 -2
- package/dist/test.d.ts.map +0 -1
- package/dist/test.js +0 -3
- package/dist/test.js.map +0 -1
- package/dist/tools/browser-tool.d.ts +0 -206
- package/dist/tools/browser-tool.d.ts.map +0 -1
- package/dist/tools/browser-tool.js +0 -726
- package/dist/tools/browser-tool.js.map +0 -1
- package/dist/tools/delegate-tool.d.ts +0 -109
- package/dist/tools/delegate-tool.d.ts.map +0 -1
- package/dist/tools/delegate-tool.js +0 -185
- package/dist/tools/delegate-tool.js.map +0 -1
- package/dist/tools/delegation-state.d.ts +0 -87
- package/dist/tools/delegation-state.d.ts.map +0 -1
- package/dist/tools/delegation-state.js +0 -278
- package/dist/tools/delegation-state.js.map +0 -1
- package/dist/tools/desktop-ui.d.ts +0 -148
- package/dist/tools/desktop-ui.d.ts.map +0 -1
- package/dist/tools/desktop-ui.js +0 -486
- package/dist/tools/desktop-ui.js.map +0 -1
- package/dist/tools/image-video-tool.d.ts +0 -88
- package/dist/tools/image-video-tool.d.ts.map +0 -1
- package/dist/tools/image-video-tool.js +0 -276
- package/dist/tools/image-video-tool.js.map +0 -1
- package/dist/tools/kanban-cron-tools.d.ts +0 -92
- package/dist/tools/kanban-cron-tools.d.ts.map +0 -1
- package/dist/tools/kanban-cron-tools.js +0 -197
- package/dist/tools/kanban-cron-tools.js.map +0 -1
- package/dist/tools/messaging-tool.d.ts +0 -127
- package/dist/tools/messaging-tool.d.ts.map +0 -1
- package/dist/tools/messaging-tool.js +0 -314
- package/dist/tools/messaging-tool.js.map +0 -1
- package/dist/tools/modality/generic-caller.d.ts +0 -43
- package/dist/tools/modality/generic-caller.d.ts.map +0 -1
- package/dist/tools/modality/generic-caller.js +0 -254
- package/dist/tools/modality/generic-caller.js.map +0 -1
- package/dist/tools/modality/modality-catalog.d.ts +0 -134
- package/dist/tools/modality/modality-catalog.d.ts.map +0 -1
- package/dist/tools/modality/modality-catalog.js +0 -445
- package/dist/tools/modality/modality-catalog.js.map +0 -1
- package/dist/tools/modality/tool-router.d.ts +0 -81
- package/dist/tools/modality/tool-router.d.ts.map +0 -1
- package/dist/tools/modality/tool-router.js +0 -84
- package/dist/tools/modality/tool-router.js.map +0 -1
- package/dist/tools/security-tools.d.ts +0 -107
- package/dist/tools/security-tools.d.ts.map +0 -1
- package/dist/tools/security-tools.js +0 -264
- package/dist/tools/security-tools.js.map +0 -1
- package/dist/tools/ssh-tool.d.ts +0 -130
- package/dist/tools/ssh-tool.d.ts.map +0 -1
- package/dist/tools/ssh-tool.js +0 -328
- package/dist/tools/ssh-tool.js.map +0 -1
- package/dist/tools/tts-tool.d.ts +0 -91
- package/dist/tools/tts-tool.d.ts.map +0 -1
- package/dist/tools/tts-tool.js +0 -406
- package/dist/tools/tts-tool.js.map +0 -1
- package/dist/utils/shell-detection.d.ts +0 -124
- package/dist/utils/shell-detection.d.ts.map +0 -1
- package/dist/utils/shell-detection.js +0 -305
- package/dist/utils/shell-detection.js.map +0 -1
- package/dist/utils/windows-paths.d.ts +0 -185
- package/dist/utils/windows-paths.d.ts.map +0 -1
- package/dist/utils/windows-paths.js +0 -472
- package/dist/utils/windows-paths.js.map +0 -1
- package/src/web-dashboard/public/assets/index-C4frng1Q.js +0 -207
- package/src/web-dashboard/public/assets/index-C4frng1Q.js.map +0 -1
|
@@ -34,13 +34,34 @@
|
|
|
34
34
|
* never throws, so the failover walk (which only fires on provider ERRORS)
|
|
35
35
|
* accepted it and the confusion was delivered verbatim to the sender.
|
|
36
36
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
37
|
+
* TWO families are detected (both observed live; the second was previously
|
|
38
|
+
* slipping through in both WhatsApp and the dashboard):
|
|
39
|
+
*
|
|
40
|
+
* A. CONTRACT META-TALK — the model narrates the contract: apologetic tone
|
|
41
|
+
* plus contract nouns (tool names, "example call", "given schema",
|
|
42
|
+
* "dictionary of tasks, actions, and their parameters").
|
|
43
|
+
* B. CONTRACT-AS-REQUEST — the subtler and far more common failure: the
|
|
44
|
+
* model reads the *suggest_followups* INSTRUCTION as the user's request
|
|
45
|
+
* and answers by OFFERING to suggest things and asking the user to supply
|
|
46
|
+
* the content. Real examples this now catches:
|
|
47
|
+
* "Sure, I can help you with suggestions and followups. Please provide
|
|
48
|
+
* me with more details so I can assist you better."
|
|
49
|
+
* "Sure, I can help you with suggesting followups. Please provide some
|
|
50
|
+
* details or a specific query you'd like me to suggest."
|
|
51
|
+
* "I'm ready to help! Could you please provide more details about the
|
|
52
|
+
* tasks or actions you'd like to perform or discuss?"
|
|
53
|
+
* "Sure, I can help you with your suggestions. What do you need help with?"
|
|
54
|
+
* You cannot catch these by matching the literal tool name: the model
|
|
55
|
+
* PARAPHRASES it ("suggestions and followups", "suggesting followups"), which
|
|
56
|
+
* is why the old name-only test let them through.
|
|
57
|
+
*
|
|
58
|
+
* Both branches stay conservative so a legitimate answer is never flagged:
|
|
59
|
+
* branch A needs contract nouns AND a confused tone; branch B needs the
|
|
60
|
+
* suggest/followup vocabulary AND an offer-to-help or please-provide frame AND
|
|
61
|
+
* an explicit request for input (a "?" or an imperative ask). A real answer
|
|
62
|
+
* that merely mentions a tool ("Sure — I can call suggest_followups once the
|
|
63
|
+
* song is written.") satisfies neither: it has no confused tone, and its
|
|
64
|
+
* "I can call …" is not an offer to help.
|
|
44
65
|
*
|
|
45
66
|
* @param content the model's visible reply text
|
|
46
67
|
* @param tools tool names to look for (defaults to suggest_followups —
|
|
@@ -48,14 +69,183 @@
|
|
|
48
69
|
*/
|
|
49
70
|
export function looksLikeConfusedScaffoldingReply(content, tools = ['suggest_followups']) {
|
|
50
71
|
const t = (content || '').trim();
|
|
51
|
-
if (!t
|
|
72
|
+
if (!t)
|
|
73
|
+
return false;
|
|
74
|
+
// ── Branch A: contract meta-talk (nouns + apologetic/confused tone) ──
|
|
75
|
+
if (t.length <= 600) {
|
|
76
|
+
const mentionsContract = tools.some((name) => t.includes(name))
|
|
77
|
+
|| /\b(?:tool|tools)\s+call\b|\b(?:provided|given)\s+(?:example|call|schema|argument|arguments|tool|information)\b|\bexample\s+call\b|\bdictionary\s+of\s+tasks\b|\bstructured\s+(?:API|api)\s+response\b|\b(?:tasks|actions)[,.]\s+and\s+(?:their\s+)?parameters\b|\b(?:tasks|actions|operations)\b(?:\s*(?:,|and|or)\s*(?:tasks|actions|operations)\b)+/i.test(t);
|
|
78
|
+
if (mentionsContract) {
|
|
79
|
+
const metaTone = /\b(?:i'?m\s+)?(?:really\s+)?sorry|\bi\s+(?:cannot|can't)\b|\bcould\s+(?:you|u)\s+please\b|\bprovide\s+(?:more\s+)?(?:context|details|information|clarification)\b|\b(incomplete|invalid|malformed|unclear|not\s+fully\s+defined|directly\s+interpret)\b/i;
|
|
80
|
+
if (metaTone.test(t))
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// ── Branch B: the contract read as the user's request (deflection) ──
|
|
85
|
+
// Short by construction — a real deliverable is longer than a deflection.
|
|
86
|
+
if (t.length > 400)
|
|
52
87
|
return false;
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
88
|
+
const suggestVocab = /\bsuggest_follow_?ups?\b|\bsuggest\w*\b|\bfollow[\s-]?ups?\b/i.test(t);
|
|
89
|
+
if (!suggestVocab)
|
|
90
|
+
return false;
|
|
91
|
+
const offerToHelp = /\bi\s+(?:can|could|will|would|'ll)\s+(?:help|assist)\b|\bi['’]?m\s+ready\s+to\s+help|\b(?:happy|glad)\s+to\s+help\b|\bi['’]d\s+be\s+happy\b|\bplease\s+(?:provide|share|give|tell|specify)\b|\blet\s+me\s+know\b|\bcould\s+you\s+please\b/i.test(t);
|
|
92
|
+
if (!offerToHelp)
|
|
93
|
+
return false;
|
|
94
|
+
const asksForInput = /\?|\bplease\s+(?:provide|share|give|tell|specify)\b/i.test(t);
|
|
95
|
+
return asksForInput;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* True when the provider rejected the request because the MODEL cannot do
|
|
99
|
+
* native tool/function calling at all.
|
|
100
|
+
*
|
|
101
|
+
* Live (Groq, via the fixed router):
|
|
102
|
+
* 400 {"error":{"message":"`tool calling` is not supported with this model",
|
|
103
|
+
* "type":"invalid_request_error","param":"tool calling"}}
|
|
104
|
+
*
|
|
105
|
+
* This is NOT a transient failure and NOT a bad model choice by itself — many
|
|
106
|
+
* perfectly good models (and every server-tool agentic model) simply do not
|
|
107
|
+
* accept a `tools` array. Before this check the loop treated it as a hard
|
|
108
|
+
* generation failure, so the whole turn died even though the loop ALREADY
|
|
109
|
+
* ships a transport that needs no provider tool support (the JSON fallback:
|
|
110
|
+
* `buildJsonFallbackPrompt` + `extractFallbackToolCalls`). Callers use this to
|
|
111
|
+
* fall through to that transport instead of losing the turn.
|
|
112
|
+
*/
|
|
113
|
+
export function isToolCallingUnsupported(err) {
|
|
114
|
+
const m = (err instanceof Error ? err.message : String(err ?? '')).toLowerCase();
|
|
115
|
+
if (!m)
|
|
56
116
|
return false;
|
|
57
|
-
|
|
58
|
-
|
|
117
|
+
// "not supported" / "unsupported" NEAR a tool/function capability word.
|
|
118
|
+
// Proximity matters: the phrase and its subject must be in the same clause,
|
|
119
|
+
// so "the tool result was too large" and a bare "401" never match.
|
|
120
|
+
const NO_CAP = '(?:not\\s+supported|unsupported|not\\s+enabled|does\\s+not\\s+support|doesn\'?t\\s+support)';
|
|
121
|
+
if (new RegExp(`\\btools?\\b[^.]{0,40}${NO_CAP}`).test(m))
|
|
122
|
+
return true; // "tools are not supported"
|
|
123
|
+
if (new RegExp(`${NO_CAP}[^.]{0,40}\\btools?\\b`).test(m))
|
|
124
|
+
return true; // "does not support tool calling"
|
|
125
|
+
if (new RegExp(`\\bfunctions?\\b[^.]{0,40}${NO_CAP}`).test(m))
|
|
126
|
+
return true; // "function calling unsupported"
|
|
127
|
+
if (new RegExp(`${NO_CAP}[^.]{0,40}\\bfunctions?\\b`).test(m))
|
|
128
|
+
return true;
|
|
129
|
+
// NOTE: a `tool_use_failed` 400 is deliberately NOT included. That error means
|
|
130
|
+
// the model DOES support tool calling but emitted a malformed call — salvage
|
|
131
|
+
// (S3) handles the recoverable case, and the rest must FAIL OVER rather than
|
|
132
|
+
// be silently answered in prose through another transport.
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* One canonical, human-readable line for a failed generation. Every surface
|
|
137
|
+
* (CLI chat, dashboard console, gateway) shows this instead of the provider's
|
|
138
|
+
* wire error.
|
|
139
|
+
*/
|
|
140
|
+
export const GENERATION_FAILURE_MESSAGE = "I couldn't complete that request just now — the language model was unavailable. Please try again in a moment.";
|
|
141
|
+
/**
|
|
142
|
+
* Map a provider/runtime error to a SHORT, user-facing sentence.
|
|
143
|
+
*
|
|
144
|
+
* Why this exists: the tool loop used to interpolate the raw provider message
|
|
145
|
+
* into the delivered answer — `I couldn't complete that request (${message})` —
|
|
146
|
+
* so a messaging-app sender and the dashboard got a wall of provider JSON
|
|
147
|
+
* ("Gemini streaming tool-calling API error (429): {\"error\":{\"code\":429, …
|
|
148
|
+
* quotaValue … retryDelay …}") instead of a sentence. The raw text still goes
|
|
149
|
+
* to the logger and the reasoning trace; only the USER sees this.
|
|
150
|
+
*
|
|
151
|
+
* Categories mirror `classifyFallbackError` (learning/provider-fallback.ts),
|
|
152
|
+
* kept local on purpose: this module is imported by the chat hot path and by
|
|
153
|
+
* unit tests, so it must not drag the provider-factory/model-registry graph in.
|
|
154
|
+
*/
|
|
155
|
+
export function toUserFacingGenerationError(err) {
|
|
156
|
+
const raw = err instanceof Error ? err.message : String(err ?? '');
|
|
157
|
+
const m = raw.toLowerCase();
|
|
158
|
+
// Our OWN loop-level errors are classified FIRST, on a literal match of the
|
|
159
|
+
// strings this codebase throws. They must not be shadowed by a keyword that
|
|
160
|
+
// happens to appear in the wrapped payload (the contract-confusion message
|
|
161
|
+
// embeds the model's raw reply, which may itself contain "429"/"not found").
|
|
162
|
+
//
|
|
163
|
+
// Why these branches exist at all: before them, a turn that ended in tool-
|
|
164
|
+
// contract confusion or a malformed step fell through to
|
|
165
|
+
// GENERATION_FAILURE_MESSAGE — telling the user "the language model was
|
|
166
|
+
// unavailable" about a model that had answered, just not usefully. That
|
|
167
|
+
// misdiagnosis is what made a live dashboard failure undiagnosable.
|
|
168
|
+
const CONTRACT_CONFUSION = /tool-contract confusion/;
|
|
169
|
+
const MALFORMED_STEP = /malformed step response/;
|
|
170
|
+
const QUOTA = /\b429\b|rate.?limit|too many requests|quota|resource.?exhausted|resource_exhausted|insufficient_quota|token_count/;
|
|
171
|
+
const AUTH = /\b401\b|\b403\b|unauthorized|forbidden|api key|invalid key|permission/;
|
|
172
|
+
const SERVER = /\b5\d\d\b|server error|internal server|overloaded/;
|
|
173
|
+
const NETWORK = /fetch failed|econnrefused|econnreset|enotfound|eai_again|socket hang up|network/;
|
|
174
|
+
const TIMEOUT = /timeout|timed out/;
|
|
175
|
+
// A bare abort (no "timeout" in the message) is NOT an unavailable model —
|
|
176
|
+
// Node's DOMException("This operation was aborted") carries no class keyword
|
|
177
|
+
// at all, which is how an aborted request used to surface as the canned
|
|
178
|
+
// "language model was unavailable" line.
|
|
179
|
+
const ABORT = /\babort(?:ed|ing)?\b/;
|
|
180
|
+
const CONTEXT = /context_length_exceeded|context length|maximum context|reduce the length of the messages|too many tokens|exceeds? the context window/;
|
|
181
|
+
const NOT_FOUND = /\b404\b|not found|does not exist|no longer available|model_not_found|unsupported model/;
|
|
182
|
+
if (CONTRACT_CONFUSION.test(m)) {
|
|
183
|
+
return "The model got tangled up in its own tool instructions and never answered your request. Try again, or switch models with `nuvira models`.";
|
|
184
|
+
}
|
|
185
|
+
if (MALFORMED_STEP.test(m)) {
|
|
186
|
+
return 'The model returned an incomplete response. Please try again.';
|
|
187
|
+
}
|
|
188
|
+
if (QUOTA.test(m)) {
|
|
189
|
+
return "I hit the model provider's rate limit (or ran out of quota) — please try again in a moment.";
|
|
190
|
+
}
|
|
191
|
+
if (AUTH.test(m)) {
|
|
192
|
+
return "The model provider rejected the API key, so I couldn't generate an answer. Check your provider credentials with `nuvira models`.";
|
|
193
|
+
}
|
|
194
|
+
if (NOT_FOUND.test(m)) {
|
|
195
|
+
return "The selected model isn't available from that provider right now. Try another model, or run `nuvira models refresh` to rediscover them.";
|
|
196
|
+
}
|
|
197
|
+
if (TIMEOUT.test(m))
|
|
198
|
+
return 'The model provider timed out. Please try again.';
|
|
199
|
+
if (CONTEXT.test(m)) {
|
|
200
|
+
return "That request outgrew the context window of the model it was routed to. Try again (the router lands on a larger-context model), or shorten the conversation.";
|
|
201
|
+
}
|
|
202
|
+
if (ABORT.test(m))
|
|
203
|
+
return 'The request to the model provider was aborted before it answered. Please try again.';
|
|
204
|
+
if (NETWORK.test(m))
|
|
205
|
+
return "I couldn't reach the model provider (network error). Please try again.";
|
|
206
|
+
if (SERVER.test(m))
|
|
207
|
+
return 'The model provider returned a server error. Please try again in a moment.';
|
|
208
|
+
return GENERATION_FAILURE_MESSAGE;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Strip the model's TOOL-CALL ARTIFACTS out of a user-facing answer.
|
|
212
|
+
*
|
|
213
|
+
* A model that cannot (or forgets to) emit a real `suggest_followups` tool call
|
|
214
|
+
* often writes the call as TEXT instead — either as a trailing bare object or
|
|
215
|
+
* inside a fenced ```json block. The user then reads the contract's plumbing in
|
|
216
|
+
* the answer:
|
|
217
|
+
*
|
|
218
|
+
* ok
|
|
219
|
+
* {"tool":"suggest_followups","arguments":{"followups":[…]}}
|
|
220
|
+
*
|
|
221
|
+
* **Next steps you might consider:**
|
|
222
|
+
* ```json
|
|
223
|
+
* ``` ← the body was parsed out, the empty fence stayed
|
|
224
|
+
*
|
|
225
|
+
* Both were observed live from the CLI's one-shot path, which printed
|
|
226
|
+
* `answer.content` raw while the dashboard console and the gateway applied the
|
|
227
|
+
* strip — a parity gap, not a rendering choice. This is the ONE copy of the
|
|
228
|
+
* strip (the helper module's whole reason for existing), so every surface that
|
|
229
|
+
* shows an answer can share it.
|
|
230
|
+
*
|
|
231
|
+
* Deliberately conservative: it only removes artifacts that ARE the followups
|
|
232
|
+
* contract. A fenced block with real content, and a code block the user asked
|
|
233
|
+
* for, are untouched.
|
|
234
|
+
*/
|
|
235
|
+
export function stripToolCallArtifacts(content) {
|
|
236
|
+
if (!content)
|
|
237
|
+
return '';
|
|
238
|
+
return (content
|
|
239
|
+
// An EMPTY fenced block — the fallback transport parsed the call out of
|
|
240
|
+
// the body and left the fence behind.
|
|
241
|
+
.replace(/\n?```[a-z]*\s*\n?\s*```\s*/gi, '\n')
|
|
242
|
+
// A fenced block WHOSE BODY is the call.
|
|
243
|
+
.replace(/```[a-z]*\s*\{[\s\S]*?"tool"\s*:\s*"suggest_followups"[\s\S]*?```/gi, '')
|
|
244
|
+
// The bare trailing call object (the model wrote the tool JSON verbatim).
|
|
245
|
+
.replace(/\n?\*?\s*\{\s*"tool"\s*:\s*"suggest_followups"[\s\S]*$/, '')
|
|
246
|
+
// The Anthropic-style tag form (<function=suggest_followups …>).
|
|
247
|
+
.replace(/\n?\*?\s*<function=suggest_followups[\s\S]*?<\/function>/g, '')
|
|
248
|
+
.trim());
|
|
59
249
|
}
|
|
60
250
|
/**
|
|
61
251
|
* S3 — salvage the model's generated content from a tool-calling 400.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-call-utils.js","sourceRoot":"","sources":["../../src/inference/tool-call-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH
|
|
1
|
+
{"version":3,"file":"tool-call-utils.js","sourceRoot":"","sources":["../../src/inference/tool-call-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,UAAU,iCAAiC,CAC/C,OAAe,EACf,QAAkB,CAAC,mBAAmB,CAAC;IAEvC,MAAM,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACjC,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAErB,wEAAwE;IACxE,IAAI,CAAC,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;QACpB,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;eAC1D,wVAAwV,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACtW,IAAI,gBAAgB,EAAE,CAAC;YACrB,MAAM,QAAQ,GAAG,0PAA0P,CAAC;YAC5Q,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;gBAAE,OAAO,IAAI,CAAC;QACpC,CAAC;IACH,CAAC;IAED,uEAAuE;IACvE,0EAA0E;IAC1E,IAAI,CAAC,CAAC,MAAM,GAAG,GAAG;QAAE,OAAO,KAAK,CAAC;IACjC,MAAM,YAAY,GAAG,+DAA+D,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7F,IAAI,CAAC,YAAY;QAAE,OAAO,KAAK,CAAC;IAChC,MAAM,WAAW,GACf,4OAA4O,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvP,IAAI,CAAC,WAAW;QAAE,OAAO,KAAK,CAAC;IAC/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R,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-router.d.ts","sourceRoot":"","sources":["../../src/learning/auto-router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAAqB,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACvH,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG/D,OAAO,EAAwC,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"auto-router.d.ts","sourceRoot":"","sources":["../../src/learning/auto-router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAAqB,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACvH,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG/D,OAAO,EAAwC,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAe9F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAM1D,wEAAwE;AACxE,eAAO,MAAM,UAAU,SAAS,CAAC;AAEjC;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C,6EAA6E;AAC7E,eAAO,MAAM,aAAa,SAAS,CAAC;AAEpC,mCAAmC;AACnC,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,CAAC;AAE1F,0EAA0E;AAC1E,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW,GAAG,cAAc,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;A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E,MAAM,EAChB,aAAa,CAAC,EAAE,aAAa,GAC5B;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE;IAgB9C;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAUvB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAYxB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IASxB;;;;;;;;;OASG;IACH,OAAO,CAAC,qBAAqB;IAqB7B;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,iBAAiB;IA8CzB;;;;;;;;;;;;;;;OAeG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,aAAa,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM;IA8DlH;;;;OAIG;IACH,oBAAoB,CAClB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,EAC9C,aAAa,CAAC,EAAE,aAAa,GAC5B,MAAM;IAOT;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IA2C9B;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAwBpC,kDAAkD;IAClD,OAAO,CAAC,WAAW;IAmBnB,qDAAqD;IACrD,OAAO,CAAC,gBAAgB;CA8BzB;AAMD;;GAEG;AACH,wBAAgB,aAAa,IAAI,eAAe,CAK/C;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC"}
|
|
@@ -46,10 +46,15 @@ import { getMlRouter, DEFAULT_ML_K, DEFAULT_ML_MIN_SAMPLES, DEFAULT_ML_STRENGTH
|
|
|
46
46
|
import { buildModelCandidates } from './model-first-router.js';
|
|
47
47
|
import { pickBestModel, topModelCandidates } from './model-scoring.js';
|
|
48
48
|
import { getModelRegistry } from './model-registry.js';
|
|
49
|
+
// R4: the agentic capability floor needs the same "too small to hold a tool
|
|
50
|
+
// loop" judgement the harness uses. model-harness.ts imports nothing, so this
|
|
51
|
+
// adds no cycle risk to the router.
|
|
52
|
+
import { isTinyModel } from './model-harness.js';
|
|
49
53
|
import { estimateTokens } from './cost-tracker.js';
|
|
50
54
|
import { preferredModelsFor, PROVIDER_CONTEXT_WINDOWS } from './model-selection.js';
|
|
51
55
|
import { isNonChatModel } from '../inference/model-catalog.js';
|
|
52
56
|
import { CATALOG_PROVIDER_IDS, getCatalogProvider, getDefaultModel, isCatalogKeyless } from '../inference/provider-catalog.js';
|
|
57
|
+
import { ProviderFactory } from '../inference/factory.js';
|
|
53
58
|
import { logger } from '../utils/logger.js';
|
|
54
59
|
// ─── Constants ──────────────────────────────────────────────────────────────
|
|
55
60
|
/** The special model value that triggers automatic per-task routing. */
|
|
@@ -663,6 +668,16 @@ export class AutoModelRouter {
|
|
|
663
668
|
}
|
|
664
669
|
const registered = registry.getUsableProviders();
|
|
665
670
|
const base = [...new Set([...CATALOG_PROVIDER_IDS, ...configuredIds])].filter((p) => {
|
|
671
|
+
// A provider with no adapter can never be resolved: `resolveProvider`
|
|
672
|
+
// refuses to substitute another provider for it (see router.ts), so a
|
|
673
|
+
// candidate like this is guaranteed to fail — and leaving it in is how a
|
|
674
|
+
// credentialed-but-unconstructible id (`bedrock` is in the catalog but
|
|
675
|
+
// has no adapter) reached the failover walk, silently resolved to a
|
|
676
|
+
// DIFFERENT provider, and mislabeled that provider's models as its own.
|
|
677
|
+
if (!ProviderFactory.isConstructible(p)) {
|
|
678
|
+
excluded.push({ provider: p, reason: 'no adapter in this build' });
|
|
679
|
+
return false;
|
|
680
|
+
}
|
|
666
681
|
if (blocked.has(p) || degraded.has(p)) {
|
|
667
682
|
// Cite the registry's own counts so the explanation proves the data
|
|
668
683
|
// is working ("openrouter excluded — 0 verified, 6 unavailable"). The
|
|
@@ -1185,6 +1200,52 @@ export class AutoModelRouter {
|
|
|
1185
1200
|
}
|
|
1186
1201
|
}
|
|
1187
1202
|
}
|
|
1203
|
+
// ── Agentic capability floor (R4) ──────────────────────────────────────
|
|
1204
|
+
// Effective capability is `model × (1 − harness tax)`: a multi-step agentic
|
|
1205
|
+
// task needs the served model to hold a tool loop across turns. A model too
|
|
1206
|
+
// small for that is not "a bit worse" here, it is a doomed run — it burns
|
|
1207
|
+
// steps, emits malformed tool calls, and then gets BOOKED as a model failure,
|
|
1208
|
+
// teaching the bandit a lesson about the model when the mismatch was ours
|
|
1209
|
+
// (auto handed an agentic task to a model that cannot do one). This is the
|
|
1210
|
+
// routing-side half of R1: the harness fits the model, and the router stops
|
|
1211
|
+
// feeding the harness a model it cannot fit.
|
|
1212
|
+
//
|
|
1213
|
+
// ORDERING (why this runs AFTER the hard constraints): the constraint slot
|
|
1214
|
+
// above owns explicit user/admin policy (maxCostUsd/minSpeed/minReasoning/
|
|
1215
|
+
// governance) and its benign "eliminated everyone" fallback restores the RAW
|
|
1216
|
+
// ranking. Running this floor first made that fallback restore the floor's
|
|
1217
|
+
// survivors instead, so an impossible minReasoning ask could still be served
|
|
1218
|
+
// a provider the user had just ruled out. Policy decides who is eligible;
|
|
1219
|
+
// this heuristic only narrows the eligible set afterwards.
|
|
1220
|
+
//
|
|
1221
|
+
// Deliberately conservative, exactly like the free/local gate above:
|
|
1222
|
+
// - only the SERVED model is judged (a provider hosting both a tiny and a
|
|
1223
|
+
// strong model keeps its strong entry);
|
|
1224
|
+
// - an UNKNOWN served model is kept (never eliminate on ignorance — the
|
|
1225
|
+
// JSON-contract transport still gives it a way to act);
|
|
1226
|
+
// - if the floor would eliminate everyone, the ranking is left alone rather
|
|
1227
|
+
// than returning no route at all. Auto must never dead-end.
|
|
1228
|
+
const agenticTask = complexity === 'complex' ||
|
|
1229
|
+
complexity === 'critical' ||
|
|
1230
|
+
taskProfile.requiresVerification === true;
|
|
1231
|
+
if (agenticTask) {
|
|
1232
|
+
const capable = scored.filter((s) => {
|
|
1233
|
+
let servedModel;
|
|
1234
|
+
try {
|
|
1235
|
+
servedModel = this.resolveModel(s.provider, agentType, configManager, taskDescription);
|
|
1236
|
+
}
|
|
1237
|
+
catch {
|
|
1238
|
+
servedModel = undefined;
|
|
1239
|
+
}
|
|
1240
|
+
return servedModel === undefined || !isTinyModel(servedModel);
|
|
1241
|
+
});
|
|
1242
|
+
if (capable.length > 0) {
|
|
1243
|
+
scored = capable;
|
|
1244
|
+
}
|
|
1245
|
+
else if (options.verbose) {
|
|
1246
|
+
logger.warn(' ⚠️ agentic capability floor would eliminate every provider — keeping the full ranking');
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1188
1249
|
// Rank: circuit-breaker-cooldown providers sink first, then quota-parked
|
|
1189
1250
|
// ones, then healthy ones; ties broken by score. A quota-parked provider
|
|
1190
1251
|
// is only selected when every candidate is parked (matching cooldown).
|
|
@@ -1483,7 +1544,26 @@ export class AutoModelRouter {
|
|
|
1483
1544
|
});
|
|
1484
1545
|
}
|
|
1485
1546
|
}
|
|
1486
|
-
|
|
1547
|
+
// ── Present the FINAL decision consistently ──────────────────────────────
|
|
1548
|
+
// Model-first routing (and per-model learning) can select a provider/model
|
|
1549
|
+
// that differs from the deterministic `selected`. Before this, the rationale
|
|
1550
|
+
// line named the PRE-override provider, `decision.score` was that loser's
|
|
1551
|
+
// score, and the ✅ marker could sit on a row ranked below #1 — so
|
|
1552
|
+
// `models explain`'s rationale, Decision line and ranked table disagreed
|
|
1553
|
+
// (`Decision: gemini/gemini-3.1-flash-lite` beside a `groq/…` rationale).
|
|
1554
|
+
// Promote the FINAL provider's entry to the head of the ranked list and
|
|
1555
|
+
// present ITS score everywhere the decision is shown. `selected` itself is
|
|
1556
|
+
// left untouched — the promotion gate's A/B record must keep the true
|
|
1557
|
+
// deterministic/bandit pick.
|
|
1558
|
+
let winner = scored.find((s) => s.provider === provider);
|
|
1559
|
+
if (!winner) {
|
|
1560
|
+
// A model-first pick can name a provider with no scored entry only in
|
|
1561
|
+
// pathological cases; synthesize one so presentation never breaks.
|
|
1562
|
+
winner = { ...selected, provider, score: selected.score, reason: `${provider}: model-first pick` };
|
|
1563
|
+
}
|
|
1564
|
+
scored = [winner, ...scored.filter((s) => s.provider !== provider)];
|
|
1565
|
+
const decisionScore = winner.score;
|
|
1566
|
+
const explanation = this.buildExplanation(agentType, complexity, taskType, provider, decisionScore, mode, model, weights, taskProfile) + (routedBy === 'bandit' ? ' | bandit-learned' : '') +
|
|
1487
1567
|
(banditEscalation ? ' | escalated: winner unlearned' : '') +
|
|
1488
1568
|
// ISSUE-002 explanation transparency: cite the registry data that
|
|
1489
1569
|
// excluded providers from the candidate pool, so auto routing proves
|
|
@@ -1528,7 +1608,7 @@ export class AutoModelRouter {
|
|
|
1528
1608
|
taskType,
|
|
1529
1609
|
provider,
|
|
1530
1610
|
model,
|
|
1531
|
-
score:
|
|
1611
|
+
score: decisionScore,
|
|
1532
1612
|
weights,
|
|
1533
1613
|
ranked: scored,
|
|
1534
1614
|
fallbackChain,
|
|
@@ -2048,7 +2128,12 @@ export class AutoModelRouter {
|
|
|
2048
2128
|
return parts.length ? `${provider}: ${parts.join(', ')}` : `${provider}: adequate for ${complexity} complexity`;
|
|
2049
2129
|
}
|
|
2050
2130
|
/** Build the human-readable decision explanation. */
|
|
2051
|
-
buildExplanation(agentType, complexity, taskType,
|
|
2131
|
+
buildExplanation(agentType, complexity, taskType,
|
|
2132
|
+
/** The FINAL provider id (post model-first override), so the rationale can
|
|
2133
|
+
* never name a different provider than the Decision line. */
|
|
2134
|
+
provider,
|
|
2135
|
+
/** The FINAL decision score (the promoted winner entry's score). */
|
|
2136
|
+
score, mode, model, weights, taskProfile) {
|
|
2052
2137
|
const complexityLabels = {
|
|
2053
2138
|
trivial: '🟢 trivial',
|
|
2054
2139
|
simple: '🔵 simple',
|
|
@@ -2060,8 +2145,8 @@ export class AutoModelRouter {
|
|
|
2060
2145
|
.reduce((a, b) => (weights[b] > weights[a] ? b : a), 'reasoning');
|
|
2061
2146
|
const modeStr = mode !== 'balanced' ? ` | ${mode}` : '';
|
|
2062
2147
|
const profileSuffix = taskProfile.requiresVerification ? ' | verification' : '';
|
|
2063
|
-
return `${agentType} (${complexityLabels[complexity]}, ${taskType}) → ${
|
|
2064
|
-
`score ${
|
|
2148
|
+
return `${agentType} (${complexityLabels[complexity]}, ${taskType}) → ${provider}/${model} ` +
|
|
2149
|
+
`score ${score.toFixed(2)} | dominant: ${DIMENSION_LABELS[dominant]}${modeStr}${profileSuffix}`;
|
|
2065
2150
|
}
|
|
2066
2151
|
}
|
|
2067
2152
|
// ─── Singleton ──────────────────────────────────────────────────────────────
|