@saturn-universe/projections 0.1.2-dev.7 → 0.1.2-dev.9
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/team.js +13 -7
- package/package.json +2 -2
package/dist/team.js
CHANGED
|
@@ -103,9 +103,7 @@ export function planTeam(s, e, run) {
|
|
|
103
103
|
? teamConcurrency(team)
|
|
104
104
|
: (current?.concurrency ?? teamConcurrency(team));
|
|
105
105
|
const mergedConcurrency = asyncCoordinator && current ? Math.max(current.concurrency, incomingConcurrency) : incomingConcurrency;
|
|
106
|
-
const cappedConcurrency = mainMembership.config.
|
|
107
|
-
? Math.min(mergedConcurrency, mainMembership.config.teamMaxConcurrency)
|
|
108
|
-
: mergedConcurrency;
|
|
106
|
+
const cappedConcurrency = resolveEffectiveTeamConcurrency(mainMembership.config.teamDefaultConcurrency !== undefined ? team.concurrency : mergedConcurrency, mainMembership.config);
|
|
109
107
|
s.teams[runId] = {
|
|
110
108
|
runId,
|
|
111
109
|
concurrency: Math.max(1, cappedConcurrency),
|
|
@@ -141,7 +139,9 @@ export function attachTeamMember(s, m) {
|
|
|
141
139
|
invalid('invalid team root');
|
|
142
140
|
s.teams[m.runId] = {
|
|
143
141
|
runId: m.runId,
|
|
144
|
-
concurrency:
|
|
142
|
+
concurrency: m.config.teamDefaultConcurrency === undefined
|
|
143
|
+
? teamConcurrency(config)
|
|
144
|
+
: resolveEffectiveTeamConcurrency(config.concurrency, m.config),
|
|
145
145
|
members: [{ id: teamRootId, parent: null, agentSessionId: m.agentSessionId, status: 'waiting' }],
|
|
146
146
|
tasks: config.members.map(({ id, task }) => ({ memberId: id, task, status: 'waiting' })),
|
|
147
147
|
inbox: [],
|
|
@@ -197,9 +197,12 @@ export function attachTeamMember(s, m) {
|
|
|
197
197
|
const tasksMatch = asyncCoordinator
|
|
198
198
|
? expectedTasks.every((expected) => currentTasks.some((cur) => cur.memberId === expected.memberId && cur.task === expected.task))
|
|
199
199
|
: canonicalJson(expectedTasks) === canonicalJson(currentTasks);
|
|
200
|
+
const concurrency = rootConfig.teamDefaultConcurrency === undefined
|
|
201
|
+
? teamConcurrency(config)
|
|
202
|
+
: resolveEffectiveTeamConcurrency(config.concurrency, rootConfig);
|
|
200
203
|
const concurrencyValid = asyncCoordinator
|
|
201
|
-
?
|
|
202
|
-
:
|
|
204
|
+
? concurrency <= current.concurrency
|
|
205
|
+
: concurrency === current.concurrency;
|
|
203
206
|
if (!worker ||
|
|
204
207
|
!concurrencyValid ||
|
|
205
208
|
!tasksMatch ||
|
|
@@ -255,7 +258,10 @@ export function projectTeamTurn(s, turn, e) {
|
|
|
255
258
|
? s.memberships[`${turn.runId}:${mainAgentSessionId}`]?.config
|
|
256
259
|
: undefined;
|
|
257
260
|
const asyncCoordinator = mainConfig ? isAsyncCoordinatorConfig(mainConfig) : false;
|
|
258
|
-
|
|
261
|
+
// Older event logs may contain starts above the recorded team concurrency.
|
|
262
|
+
const effectiveConcurrency = asyncCoordinator && mainConfig?.teamDefaultConcurrency === undefined
|
|
263
|
+
? (mainConfig?.teamMaxConcurrency ?? team.concurrency)
|
|
264
|
+
: resolveEffectiveTeamConcurrency(team.concurrency, mainConfig);
|
|
259
265
|
if (e.type === 'turn.started' || e.type === 'turn.resumed') {
|
|
260
266
|
if (asyncCoordinator) {
|
|
261
267
|
if (member.id !== teamRootId &&
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saturn-universe/projections",
|
|
3
|
-
"version": "0.1.2-dev.
|
|
3
|
+
"version": "0.1.2-dev.9",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
8
8
|
],
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@saturn-universe/core": "0.1.2-dev.
|
|
10
|
+
"@saturn-universe/core": "0.1.2-dev.9"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|