clementine-agent 1.0.59 → 1.0.61
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/agent/assistant.js
CHANGED
|
@@ -2571,6 +2571,18 @@ You have a cost budget per message — not a hard turn limit. Work until the tas
|
|
|
2571
2571
|
if (!contradictionRetried && attempt < PersonalAssistant.RATE_LIMIT_MAX_RETRIES && responseText.trim()) {
|
|
2572
2572
|
try {
|
|
2573
2573
|
const toolCallRecords = collectToolCalls(collectedSdkMessages);
|
|
2574
|
+
// Diagnostic — emits once per turn so we can see what the
|
|
2575
|
+
// validator is working with even when it doesn't fire. Without
|
|
2576
|
+
// this we're blind to the "regex missed the phrasing" case.
|
|
2577
|
+
if (toolCallRecords.length > 0) {
|
|
2578
|
+
logger.info({
|
|
2579
|
+
sessionKey,
|
|
2580
|
+
sdkMessagesCaptured: collectedSdkMessages.length,
|
|
2581
|
+
toolCallsPaired: toolCallRecords.length,
|
|
2582
|
+
resultClasses: toolCallRecords.map(r => `${r.name}:${r.resultClass}`),
|
|
2583
|
+
replyPreview: responseText.slice(0, 200).replace(/\n/g, ' '),
|
|
2584
|
+
}, 'Contradiction validator pass');
|
|
2585
|
+
}
|
|
2574
2586
|
const finding = detectContradiction(responseText, toolCallRecords);
|
|
2575
2587
|
if (finding) {
|
|
2576
2588
|
contradictionRetried = true;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
const ARG_ERROR_RE = /\b(invalid|unknown field|required|missing parameter|schema|unrecognized|unexpected property)\b/i;
|
|
16
16
|
const AUTH_ERROR_RE = /\b(unauthori[sz]ed|401|not authenticated|token expired|token has expired|invalid[_ ]?token|access denied)\b/i;
|
|
17
17
|
/** Regex matching reply phrasings that claim a connector-wide failure. */
|
|
18
|
-
export const CONTRADICTION_RE = /(dead\s*end|doesn'?t exist|not in (the |my )?schema|schema[- ]level|
|
|
18
|
+
export const CONTRADICTION_RE = /(dead\s*end|doesn'?t exist|not in (the |my )?schema|schema[- ]level|aren'?t loading into|(not|isn'?t|aren'?t|wasn'?t) (loaded|wired|available|connected|coming through|responding|reachable|working)|connector[^.]{0,40}(dropped|is (a )?dead)|tools? array is empty|MCP server (still connecting|dropped|not responding|just isn'?t connected|isn'?t connected)|no such tool available|tool doesn'?t exist|both directions are blocked|(restart|close and reopen|reconnect) Claude Code)/i;
|
|
19
19
|
export function classifyResult(content, isError) {
|
|
20
20
|
if (!isError)
|
|
21
21
|
return 'success';
|
|
@@ -101,7 +101,13 @@ export function detectContradiction(reply, calls) {
|
|
|
101
101
|
const match = reply.match(CONTRADICTION_RE);
|
|
102
102
|
if (!match)
|
|
103
103
|
return null;
|
|
104
|
-
|
|
104
|
+
// Cover every connector — claude_ai_* (remote), imessage/figma/hostinger/etc.
|
|
105
|
+
// (Desktop Extensions + stdio servers), everything except Clementine's own
|
|
106
|
+
// tools server and plugins. Earlier versions only filtered claude_ai_*,
|
|
107
|
+
// which let "isn't loaded" replies slip through for iMessage etc.
|
|
108
|
+
const connectorCalls = calls.filter(c => c.name.startsWith('mcp__') &&
|
|
109
|
+
!c.name.startsWith('mcp__clementine-tools__') &&
|
|
110
|
+
!c.name.startsWith('mcp__plugin_'));
|
|
105
111
|
const recoverable = connectorCalls.find(c => c.resultClass === 'success' || c.resultClass === 'arg_error');
|
|
106
112
|
if (!recoverable)
|
|
107
113
|
return null;
|