clementine-agent 1.18.147 → 1.18.148
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.
|
@@ -351,7 +351,15 @@ export async function classifyRoute(userMessage, agents, gateway) {
|
|
|
351
351
|
undefined, // maxHours
|
|
352
352
|
undefined, // timeoutMs
|
|
353
353
|
undefined, // successCriteria
|
|
354
|
-
undefined
|
|
354
|
+
undefined, // agentSlug
|
|
355
|
+
// 1.18.148 — F1/F2 pattern: meta-jobs run predictable to keep the
|
|
356
|
+
// prompt under Claude's input limit. Without these the classifier
|
|
357
|
+
// inherited MEMORY.md + team comms + auto-matched skills, blew up
|
|
358
|
+
// 12+ times in 8 hours (silent fallback to default route).
|
|
359
|
+
undefined, // pinnedSkills
|
|
360
|
+
[], // allowedTools
|
|
361
|
+
[], // allowedMcpServers
|
|
362
|
+
true);
|
|
355
363
|
}
|
|
356
364
|
catch (err) {
|
|
357
365
|
logger.warn({ err }, 'Route classifier call failed');
|
|
@@ -45,8 +45,17 @@ const MAX_INJECTED_SKILLS = 4;
|
|
|
45
45
|
* delegation is the one thing every cron must always be able to do).
|
|
46
46
|
*/
|
|
47
47
|
export function computeEffectiveAllowedTools(jobAllow, profileAllow) {
|
|
48
|
-
|
|
48
|
+
// 1.18.148 — distinguish "no allowlist" (undefined → unrestricted) from
|
|
49
|
+
// "explicitly empty allowlist" (`[]` → deny all). Before this, both
|
|
50
|
+
// collapsed to `undefined` because of the `?.length` check, which meant
|
|
51
|
+
// meta-jobs passing `allowedTools: []` actually got the FULL tool set
|
|
52
|
+
// injected (and blew past the prompt limit when Composio toolkits piled
|
|
53
|
+
// on tool schemas). The fix: an explicit `[]` returns `['Agent']` only
|
|
54
|
+
// (just the SDK's required spawn-subagent tool).
|
|
55
|
+
if (jobAllow === undefined)
|
|
49
56
|
return undefined;
|
|
57
|
+
if (jobAllow.length === 0)
|
|
58
|
+
return ['Agent']; // explicitly empty → minimal
|
|
50
59
|
let result;
|
|
51
60
|
if (profileAllow?.length) {
|
|
52
61
|
const jobSet = new Set(jobAllow);
|
|
@@ -67,8 +76,16 @@ export function computeEffectiveAllowedTools(jobAllow, profileAllow) {
|
|
|
67
76
|
* MCP allowlist set.
|
|
68
77
|
*/
|
|
69
78
|
export function applyMcpAllowlist(servers, jobAllowedMcpServers) {
|
|
70
|
-
|
|
79
|
+
// 1.18.148 — empty array means "deny all MCP servers", not "no
|
|
80
|
+
// restriction". Before this, passing `[]` collapsed to `?.length === 0`
|
|
81
|
+
// and returned the unfiltered server map — so meta-jobs (insight-check,
|
|
82
|
+
// grade:*, route-classify, diagnose:*) got every Composio toolkit's
|
|
83
|
+
// tool schemas wired into their prompt and blew past Claude's input
|
|
84
|
+
// limit. 110+ "Prompt is too long" errors per 8 hours.
|
|
85
|
+
if (jobAllowedMcpServers === undefined)
|
|
71
86
|
return servers;
|
|
87
|
+
if (jobAllowedMcpServers.length === 0)
|
|
88
|
+
return {};
|
|
72
89
|
const allow = new Set(jobAllowedMcpServers);
|
|
73
90
|
return Object.fromEntries(Object.entries(servers).filter(([name]) => allow.has(name)));
|
|
74
91
|
}
|
|
@@ -94,8 +111,13 @@ export function applyMcpAllowlist(servers, jobAllowedMcpServers) {
|
|
|
94
111
|
* unchanged.
|
|
95
112
|
*/
|
|
96
113
|
export function widenAllowlistWithSkillTools(jobAllow, pinnedSkillTools) {
|
|
97
|
-
|
|
114
|
+
// 1.18.148 — preserve "explicitly empty" semantics. An empty array is a
|
|
115
|
+
// contract: "I want no tools." Skill-pin widening doesn't apply when no
|
|
116
|
+
// skills are pinned (which is the case for meta-jobs).
|
|
117
|
+
if (jobAllow === undefined)
|
|
98
118
|
return undefined;
|
|
119
|
+
if (jobAllow.length === 0 && !pinnedSkillTools?.length)
|
|
120
|
+
return [];
|
|
99
121
|
if (!pinnedSkillTools?.length)
|
|
100
122
|
return [...jobAllow];
|
|
101
123
|
return [...new Set([...jobAllow, ...pinnedSkillTools])];
|
|
@@ -130,8 +152,12 @@ export function extractMcpServersFromSkillBodies(bodies) {
|
|
|
130
152
|
* allowlist; doesn't synthesize one when the cron is unrestricted.
|
|
131
153
|
*/
|
|
132
154
|
export function widenMcpAllowlistWithSkillRefs(jobMcpAllow, skillReferencedServers) {
|
|
133
|
-
|
|
155
|
+
// 1.18.148 — preserve "explicitly empty" semantics. See note on
|
|
156
|
+
// applyMcpAllowlist + widenAllowlistWithSkillTools above.
|
|
157
|
+
if (jobMcpAllow === undefined)
|
|
134
158
|
return undefined;
|
|
159
|
+
if (jobMcpAllow.length === 0 && !skillReferencedServers.length)
|
|
160
|
+
return [];
|
|
135
161
|
if (!skillReferencedServers.length)
|
|
136
162
|
return [...jobMcpAllow];
|
|
137
163
|
return [...new Set([...jobMcpAllow, ...skillReferencedServers])];
|
|
@@ -572,8 +598,10 @@ export async function buildCronExecutionPlan(opts) {
|
|
|
572
598
|
const widenedJobMcpAllowlist = widenMcpAllowlistWithSkillRefs(opts.allowedMcpServers, skillReferencedMcpServers);
|
|
573
599
|
// Per-trick MCP allowlist: post-filter on the profile-narrowed map.
|
|
574
600
|
// Effective set = profile ∩ trick (widened).
|
|
601
|
+
// 1.18.148 — empty array means "deny all" not "no restriction" (was a
|
|
602
|
+
// silent prompt-bloat bug — see applyMcpAllowlist note above).
|
|
575
603
|
const mcpServerMap = applyMcpAllowlist(mcp.servers, widenedJobMcpAllowlist);
|
|
576
|
-
const allowSet = widenedJobMcpAllowlist
|
|
604
|
+
const allowSet = widenedJobMcpAllowlist === undefined ? null : new Set(widenedJobMcpAllowlist);
|
|
577
605
|
const composioConnected = allowSet ? mcp.composioConnected.filter(n => allowSet.has(n)) : mcp.composioConnected;
|
|
578
606
|
const externalConnected = allowSet ? mcp.externalConnected.filter(n => allowSet.has(n)) : mcp.externalConnected;
|
|
579
607
|
const mcpServersApplied = Object.keys(mcpServerMap);
|
|
@@ -546,7 +546,15 @@ export async function diagnoseBrokenJob(broken, gateway) {
|
|
|
546
546
|
undefined, // maxHours
|
|
547
547
|
undefined, // timeoutMs
|
|
548
548
|
undefined, // successCriteria
|
|
549
|
-
undefined
|
|
549
|
+
undefined, // agentSlug
|
|
550
|
+
// 1.18.148 — F1/F2 pattern: diagnostics are pure analysis of an
|
|
551
|
+
// existing run, no need for MEMORY.md / team / auto-skills. Without
|
|
552
|
+
// these flags the diagnostic prompt blew past Claude's input limit
|
|
553
|
+
// and broken jobs went undiagnosed silently.
|
|
554
|
+
undefined, // pinnedSkills
|
|
555
|
+
[], // allowedTools
|
|
556
|
+
[], // allowedMcpServers
|
|
557
|
+
true);
|
|
550
558
|
}
|
|
551
559
|
catch (err) {
|
|
552
560
|
logger.warn({ err, job: broken.jobName }, 'Diagnostic LLM call failed');
|
|
@@ -140,7 +140,16 @@ export async function gradeRun(entry, gateway, jobPrompt) {
|
|
|
140
140
|
undefined, // maxHours
|
|
141
141
|
undefined, // timeoutMs
|
|
142
142
|
undefined, // successCriteria
|
|
143
|
-
undefined
|
|
143
|
+
undefined, // agentSlug
|
|
144
|
+
// 1.18.148 — F1/F2 pattern: meta-jobs don't get user MEMORY.md /
|
|
145
|
+
// team comms / auto-matched skills, otherwise the prompt blows
|
|
146
|
+
// past Claude's input limit (110+ "Prompt is too long" errors/8h
|
|
147
|
+
// before this fix). Same shape applied to insight-check (1.18.132)
|
|
148
|
+
// and route-classify / failure-diagnostics in this same ship.
|
|
149
|
+
undefined, // pinnedSkills
|
|
150
|
+
[], // allowedTools — empty = no MCP injection
|
|
151
|
+
[], // allowedMcpServers — empty = no MCP servers wired
|
|
152
|
+
true);
|
|
144
153
|
}
|
|
145
154
|
catch (err) {
|
|
146
155
|
logger.warn({ err, jobName: entry.jobName }, 'Outcome grader LLM call failed');
|