Refresh speech pressure under moderation lock
This commit is contained in:
parent
d1dcbeed32
commit
358d648406
5 changed files with 27 additions and 1 deletions
|
|
@ -995,6 +995,12 @@ if ($SkipModel) {
|
|||
$combinedText = (($execution.StdOut, $execution.StdErr) | Where-Object { -not [string]::IsNullOrWhiteSpace($_) }) -join [Environment]::NewLine
|
||||
}
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($combinedText)) {
|
||||
[System.IO.File]::WriteAllText($tracePath, "Codex rumination produced no stdout/stderr trace." + [Environment]::NewLine, [System.Text.UTF8Encoding]::new($false))
|
||||
} else {
|
||||
[System.IO.File]::WriteAllText($tracePath, $combinedText + [Environment]::NewLine, [System.Text.UTF8Encoding]::new($false))
|
||||
}
|
||||
|
||||
if ($exitCode -ne 0) {
|
||||
$failureMessage = if ([string]::IsNullOrWhiteSpace($combinedText)) { "Codex rumination failed with exit code $exitCode." } else { $combinedText }
|
||||
throw $failureMessage
|
||||
|
|
|
|||
|
|
@ -26,16 +26,33 @@ async function main() {
|
|||
const now = new Date();
|
||||
|
||||
await withLock(async () => {
|
||||
const typedState = await loadVoidSelfStateTypedDocuments({ canonicalPath: statePath });
|
||||
|
||||
if (isRecentLockPresent(moderationLockPath, 20 * 60 * 1000)) {
|
||||
const speakingPressure = updateSpeakingPressure({
|
||||
typedState,
|
||||
previous: typedState.scheduledRuntime.speakingPressure,
|
||||
sleepCycle: typedState.scheduledRuntime.sleepCycle,
|
||||
now,
|
||||
});
|
||||
await applyVoidSelfStateOperation(
|
||||
{ canonicalPath: statePath },
|
||||
{
|
||||
operation: "update_speaking_pressure",
|
||||
speakingPressure,
|
||||
},
|
||||
);
|
||||
writeStatus({
|
||||
status: "skipped",
|
||||
reason: "moderation_loop_active",
|
||||
observedAt: now.toISOString(),
|
||||
statePath,
|
||||
speakingPressure,
|
||||
sleepCycle: typedState.scheduledRuntime.sleepCycle,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const typedState = await loadVoidSelfStateTypedDocuments({ canonicalPath: statePath });
|
||||
const sleepCycle = updateSleepCycle(typedState.scheduledRuntime.sleepCycle, now);
|
||||
const speakingPressure = updateSpeakingPressure({
|
||||
typedState,
|
||||
|
|
|
|||
Loading…
Reference in a new issue