@bizzywork/routing 0.1.0 → 0.3.0
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/README.md +3 -1
- package/dist/bundle/THIRD-PARTY-NOTICES.txt +160 -0
- package/dist/bundle/bizzy-routing.js +12 -21
- package/dist/bundle/chunk-RYVRLJBJ.js +62 -0
- package/dist/bundle/clack-ui-KG2I32T5.js +1406 -0
- package/dist/bundle/harnesses/claude-code/hooks/register.ts +11 -2
- package/dist/bundle/{main-VPXMU5TG.js → main-6WPWCLN3.js} +346 -264
- package/dist/bundle/ui-PEKFVWX7.js +44 -0
- package/package.json +2 -1
|
@@ -233,7 +233,13 @@ async function fallback<E extends { model: string; turnId: string }>(
|
|
|
233
233
|
error: unknown,
|
|
234
234
|
): Promise<E | undefined> {
|
|
235
235
|
const text = error instanceof Error ? error.message : String(error ?? "");
|
|
236
|
-
|
|
236
|
+
// Bare "model" matched too much: "Fable requires usage credits. /model to switch models." is a
|
|
237
|
+
// hard refusal, not a flaky retry, but only by luck of containing the word "model" at all —
|
|
238
|
+
// "the model is temporarily overloaded, please retry" would have matched the same way.
|
|
239
|
+
const transient =
|
|
240
|
+
!/not.?found|permission denied|40[34]|usage credit|insufficient.?credit|quota exceeded/i.test(
|
|
241
|
+
text,
|
|
242
|
+
);
|
|
237
243
|
let model = e.model;
|
|
238
244
|
try {
|
|
239
245
|
const decision = await post<{ model: string | null }>($, "/v1/harness/fallback", {
|
|
@@ -296,7 +302,10 @@ export const register: Register = (on) => {
|
|
|
296
302
|
on("command.run", { command: "model" }, async ($, e, next) => {
|
|
297
303
|
const result = await next(e);
|
|
298
304
|
await sync($);
|
|
299
|
-
|
|
305
|
+
// Gating on e.args meant picking a model from /model's own interactive menu (no inline
|
|
306
|
+
// argument) never paused Bizzy Auto: the next turn routed right over the manual pick. By the
|
|
307
|
+
// time next(e) resolves the pick is final either way, so just check whether Bizzy is on.
|
|
308
|
+
if (enabled) pause($, await $.session.model());
|
|
300
309
|
return result;
|
|
301
310
|
}).catch(($, e, next) => (next.called ? {} : next(e)));
|
|
302
311
|
|