neoagent 2.1.18-beta.39 → 2.1.18-beta.40
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/package.json
CHANGED
|
@@ -37,6 +37,6 @@ _flutter.buildConfig = {"engineRevision":"425cfb54d01a9472b3e81d9e76fd63a4a44cfb
|
|
|
37
37
|
|
|
38
38
|
_flutter.loader.load({
|
|
39
39
|
serviceWorkerSettings: {
|
|
40
|
-
serviceWorkerVersion: "
|
|
40
|
+
serviceWorkerVersion: "893563102" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
|
|
41
41
|
}
|
|
42
42
|
});
|
|
@@ -502,6 +502,15 @@ function summarizeToolExecutions(toolExecutions = [], maxItems = 10) {
|
|
|
502
502
|
}).join('\n');
|
|
503
503
|
}
|
|
504
504
|
|
|
505
|
+
function summarizeAvailableTools(tools = [], { exclude = [] } = {}) {
|
|
506
|
+
const excluded = new Set((Array.isArray(exclude) ? exclude : [exclude]).filter(Boolean));
|
|
507
|
+
return tools
|
|
508
|
+
.map((tool) => String(tool?.name || '').trim())
|
|
509
|
+
.filter((name) => name && !excluded.has(name))
|
|
510
|
+
.slice(0, 24)
|
|
511
|
+
.join(', ');
|
|
512
|
+
}
|
|
513
|
+
|
|
505
514
|
class AgentEngine {
|
|
506
515
|
constructor(io, services = {}) {
|
|
507
516
|
this.io = io;
|
|
@@ -708,6 +717,7 @@ class AgentEngine {
|
|
|
708
717
|
providerName,
|
|
709
718
|
model,
|
|
710
719
|
messages,
|
|
720
|
+
tools,
|
|
711
721
|
analysis,
|
|
712
722
|
plan,
|
|
713
723
|
toolExecutions,
|
|
@@ -740,12 +750,14 @@ class AgentEngine {
|
|
|
740
750
|
'- Use "blocked" only when a specific external dependency outside this run is required.',
|
|
741
751
|
'- A progress update is not complete.',
|
|
742
752
|
'- A single failed tool attempt is not blocked if another safe retry, verification step, or alternative path remains.',
|
|
753
|
+
'- A tool-specific API error, timeout, rate limit, or missing result inside this run is usually "continue", not "blocked", if any other available tool could still make progress.',
|
|
743
754
|
triggerSource === 'messaging'
|
|
744
755
|
? '- For messaging, do not stop on a partial status message. Continue unless the task is actually complete or externally blocked.'
|
|
745
756
|
: '- Do not stop just because you wrote a status update. Continue unless the task is actually complete or externally blocked.',
|
|
746
757
|
analysis?.goal ? `Goal: ${analysis.goal}` : '',
|
|
747
758
|
successCriteria.length > 0 ? `Success criteria:\n${successCriteria.map((item, index) => `${index + 1}. ${item}`).join('\n')}` : '',
|
|
748
759
|
`Current iteration: ${iteration} of ${maxIterations}.`,
|
|
760
|
+
`Available tools in this run: ${summarizeAvailableTools(tools) || 'none'}`,
|
|
749
761
|
`Recent tool evidence:\n${summarizeToolExecutions(toolExecutions, 8) || 'none'}`,
|
|
750
762
|
`Latest draft reply:\n${normalizeOutgoingMessage(lastReply) || '(empty)'}`,
|
|
751
763
|
].filter(Boolean).join('\n'),
|
|
@@ -1623,6 +1635,7 @@ class AgentEngine {
|
|
|
1623
1635
|
providerName,
|
|
1624
1636
|
model,
|
|
1625
1637
|
messages,
|
|
1638
|
+
tools,
|
|
1626
1639
|
analysis,
|
|
1627
1640
|
plan,
|
|
1628
1641
|
toolExecutions,
|
|
@@ -1731,9 +1744,16 @@ class AgentEngine {
|
|
|
1731
1744
|
messages.push(toolMessage);
|
|
1732
1745
|
|
|
1733
1746
|
if (toolErrorMessage) {
|
|
1747
|
+
const alternativeTools = summarizeAvailableTools(tools, { exclude: toolName });
|
|
1734
1748
|
messages.push({
|
|
1735
1749
|
role: 'system',
|
|
1736
|
-
content:
|
|
1750
|
+
content: [
|
|
1751
|
+
`Tool "${toolName}" failed with error: ${summarizeForLog(toolErrorMessage, 240)}.`,
|
|
1752
|
+
'This tool failure is not, by itself, a user-facing blocker.',
|
|
1753
|
+
'Continue autonomously: retry with corrected arguments, try an alternative tool/path, or verify the outcome using other available tools.',
|
|
1754
|
+
alternativeTools ? `Other available tools in this run: ${alternativeTools}.` : '',
|
|
1755
|
+
'Only stop and tell the user you are blocked if the remaining issue truly requires an external dependency or user action outside this run.'
|
|
1756
|
+
].filter(Boolean).join(' ')
|
|
1737
1757
|
});
|
|
1738
1758
|
}
|
|
1739
1759
|
|