agents-relay 1.0.136 → 1.0.137
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/usage.js +5 -1
- package/dist/worker-routing.js +3 -3
- package/package.json +1 -1
package/dist/usage.js
CHANGED
|
@@ -51,7 +51,11 @@ export class BrowserWorkspaceUsageReader {
|
|
|
51
51
|
const idle = numberOrNull(raw.idle);
|
|
52
52
|
const leased = numberOrNull(raw.leased);
|
|
53
53
|
const poolSize = numberOrNull(raw.poolSize);
|
|
54
|
-
|
|
54
|
+
// `available` is allocatable capacity, not the number of currently idle tabs.
|
|
55
|
+
// Keep accepting the old boolean probe shape while callers transition.
|
|
56
|
+
const available = typeof raw.available === 'number' && Number.isFinite(raw.available) && raw.available >= 0
|
|
57
|
+
? raw.available
|
|
58
|
+
: typeof raw.available === 'boolean' ? (raw.available ? 1 : 0) : null;
|
|
55
59
|
if (idle !== null || leased !== null || poolSize !== null || available !== null) {
|
|
56
60
|
finish({ name, poolSize, idle, leased, available, observedAt: rawObservedAt, reason: null });
|
|
57
61
|
return;
|
package/dist/worker-routing.js
CHANGED
|
@@ -83,7 +83,7 @@ export function satisfiesWorker(candidate, requirements) {
|
|
|
83
83
|
return false;
|
|
84
84
|
if (requirements.runtime && candidate.runtime !== requirements.runtime)
|
|
85
85
|
return false;
|
|
86
|
-
if (candidate.adapter === 'chatgpt' && candidate.browserWorkspaceCapacity?.
|
|
86
|
+
if (candidate.adapter === 'chatgpt' && candidate.browserWorkspaceCapacity?.available === 0)
|
|
87
87
|
return false;
|
|
88
88
|
return true;
|
|
89
89
|
}
|
|
@@ -120,8 +120,8 @@ export function selectWorker(candidates, requirements) {
|
|
|
120
120
|
return { candidate: selected, selection: selection(selected, 'worker-router:fallback') };
|
|
121
121
|
}
|
|
122
122
|
function noEligibleWorkerReason(candidates) {
|
|
123
|
-
if (candidates.some(candidate => candidate.adapter === 'chatgpt' && candidate.browserWorkspaceCapacity?.
|
|
124
|
-
return 'No eligible worker: ChatGPT Browser Workspace has no
|
|
123
|
+
if (candidates.some(candidate => candidate.adapter === 'chatgpt' && candidate.browserWorkspaceCapacity?.available === 0)) {
|
|
124
|
+
return 'No eligible worker: ChatGPT Browser Workspace has no allocatable capacity.';
|
|
125
125
|
}
|
|
126
126
|
return 'No eligible worker satisfies the authoritative worker constraints';
|
|
127
127
|
}
|