@illuma-ai/agents 1.3.0 → 1.3.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/cjs/graphs/Graph.cjs +5 -12
- package/dist/cjs/graphs/Graph.cjs.map +1 -1
- package/dist/cjs/main.cjs +4 -0
- package/dist/cjs/main.cjs.map +1 -1
- package/dist/cjs/utils/errors.cjs +113 -0
- package/dist/cjs/utils/errors.cjs.map +1 -0
- package/dist/esm/graphs/Graph.mjs +5 -12
- package/dist/esm/graphs/Graph.mjs.map +1 -1
- package/dist/esm/main.mjs +1 -0
- package/dist/esm/main.mjs.map +1 -1
- package/dist/esm/utils/errors.mjs +109 -0
- package/dist/esm/utils/errors.mjs.map +1 -0
- package/dist/types/utils/errors.d.ts +37 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/graphs/Graph.ts +5 -14
- package/src/utils/__tests__/errors.test.ts +136 -0
- package/src/utils/errors.ts +115 -0
- package/src/utils/index.ts +1 -0
|
@@ -29,6 +29,7 @@ var contextPressure = require('../utils/contextPressure.cjs');
|
|
|
29
29
|
var toolDiscoveryCache = require('../utils/toolDiscoveryCache.cjs');
|
|
30
30
|
var pruneCalibration = require('../utils/pruneCalibration.cjs');
|
|
31
31
|
var fileManifest = require('../utils/fileManifest.cjs');
|
|
32
|
+
var errors = require('../utils/errors.cjs');
|
|
32
33
|
var providers = require('../llm/providers.cjs');
|
|
33
34
|
var ToolNode = require('../tools/ToolNode.cjs');
|
|
34
35
|
var index = require('../llm/openai/index.cjs');
|
|
@@ -1550,14 +1551,8 @@ class StandardGraph extends Graph {
|
|
|
1550
1551
|
}, config);
|
|
1551
1552
|
}
|
|
1552
1553
|
catch (primaryError) {
|
|
1553
|
-
|
|
1554
|
-
const
|
|
1555
|
-
const isInputTooLongError = errorMessage.includes('too long') ||
|
|
1556
|
-
errorMessage.includes('input is too long') ||
|
|
1557
|
-
errorMessage.includes('context length') ||
|
|
1558
|
-
errorMessage.includes('maximum context') ||
|
|
1559
|
-
errorMessage.includes('validationexception') ||
|
|
1560
|
-
errorMessage.includes('prompt is too long');
|
|
1554
|
+
const errorMessage = primaryError.message;
|
|
1555
|
+
const isInputTooLongError = errors.isLikelyContextOverflowError(errorMessage);
|
|
1561
1556
|
// Log when we detect the error
|
|
1562
1557
|
if (isInputTooLongError) {
|
|
1563
1558
|
logging.mwarn('[Graph] Detected input too long error:', errorMessage.substring(0, 200));
|
|
@@ -1661,10 +1656,8 @@ If I seem to be missing something we discussed earlier, just give me a quick rem
|
|
|
1661
1656
|
console.info(`[Graph] ✅ Retry successful at ${reductionFactor * 100}% with ${reducedMessages.length} messages (reduced from ${finalMessages.length})`);
|
|
1662
1657
|
}
|
|
1663
1658
|
catch (retryError) {
|
|
1664
|
-
const retryErrorMsg = retryError.message
|
|
1665
|
-
const stillTooLong =
|
|
1666
|
-
retryErrorMsg.includes('context length') ||
|
|
1667
|
-
retryErrorMsg.includes('validationexception');
|
|
1659
|
+
const retryErrorMsg = retryError.message;
|
|
1660
|
+
const stillTooLong = errors.isLikelyContextOverflowError(retryErrorMsg);
|
|
1668
1661
|
if (stillTooLong && reductionFactor > 0.1) {
|
|
1669
1662
|
logging.mwarn(`[Graph] Still too long at ${reductionFactor * 100}%, trying more aggressive pruning...`);
|
|
1670
1663
|
}
|