Require pressure for autonomous Persona turns
This commit is contained in:
parent
3f87346dee
commit
0840aab32d
4 changed files with 20 additions and 6 deletions
|
|
@ -511,13 +511,19 @@ export function selectReadyParticipants<TParticipant extends InitiativeParticipa
|
|||
});
|
||||
|
||||
const mentioned = ready.filter((participant) => (mentionCounts.get(participant.identityId) ?? 0) > 0);
|
||||
const unprompted = ready.filter((participant) => (mentionCounts.get(participant.identityId) ?? 0) === 0);
|
||||
const unprompted = ready.filter((participant) =>
|
||||
(mentionCounts.get(participant.identityId) ?? 0) === 0
|
||||
&& hasMeaningfulUnpromptedPressure(participant));
|
||||
const allowsUnprompted = !unpromptedTurnPolicy.nextUnpromptedTurnAllowedAt
|
||||
|| Date.parse(unpromptedTurnPolicy.nextUnpromptedTurnAllowedAt) <= nowMs;
|
||||
const admittedUnprompted = allowsUnprompted && mentioned.length < maxJobs ? unprompted.slice(0, 1) : [];
|
||||
return [...mentioned, ...admittedUnprompted].slice(0, maxJobs);
|
||||
}
|
||||
|
||||
function hasMeaningfulUnpromptedPressure(participant: InitiativeParticipant): boolean {
|
||||
return participant.responsePressure >= participant.interruptThreshold;
|
||||
}
|
||||
|
||||
function round3(value: number): number {
|
||||
return Math.round(value * 1000) / 1000;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue