@blockrun/clawrouter 0.12.36 → 0.12.37

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/index.js CHANGED
@@ -7364,6 +7364,19 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
7364
7364
  routingProfile: routingProfile ?? void 0,
7365
7365
  hasTools
7366
7366
  });
7367
+ if (hasTools && routingDecision.tier === "SIMPLE") {
7368
+ const simpleRoutingDecision = route(prompt, systemPrompt, maxTokens, {
7369
+ ...routerOpts,
7370
+ routingProfile: routingProfile ?? void 0,
7371
+ hasTools: false
7372
+ });
7373
+ if (simpleRoutingDecision.tier === "SIMPLE") {
7374
+ console.log(
7375
+ `[ClawRouter] SIMPLE+tools: using non-agentic model ${simpleRoutingDecision.model} (tools present but query is trivial)`
7376
+ );
7377
+ routingDecision = simpleRoutingDecision;
7378
+ }
7379
+ }
7367
7380
  if (existingSession) {
7368
7381
  const tierRank = {
7369
7382
  SIMPLE: 0,
@@ -7387,6 +7400,14 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
7387
7400
  routingDecision.tier
7388
7401
  );
7389
7402
  }
7403
+ } else if (routingDecision.tier === "SIMPLE") {
7404
+ console.log(
7405
+ `[ClawRouter] Session ${effectiveSessionId?.slice(0, 8)}... SIMPLE follow-up, using cheap model: ${routingDecision.model} (bypassing pinned ${existingSession.tier})`
7406
+ );
7407
+ parsed.model = routingDecision.model;
7408
+ modelId = routingDecision.model;
7409
+ bodyModified = true;
7410
+ sessionStore.touchSession(effectiveSessionId);
7390
7411
  } else {
7391
7412
  console.log(
7392
7413
  `[ClawRouter] Session ${effectiveSessionId?.slice(0, 8)}... keeping pinned model: ${existingSession.model} (${existingSession.tier} >= ${routingDecision.tier})`