You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary>The honest-redo line: fires ONLY when a resumed conversation exists but the workspace was NOT pinned to a prior pushed branch — never on a genuine cold-start retry (no prior attempt at all), which stays byte-identical.</summary>
public const string HonestNoContinuityHint = "Note: your prior attempt's conversation is restored, but its git changes were NOT preserved in this workspace (no pushed branch was found to continue from) — you must redo any relevant file changes from scratch.";
public const string HonestNoContinuityHint = "Note: your prior attempt's conversation is restored, but its git changes were NOT preserved in this workspace (your prior attempt pushed no branch of its own) — you must redo any relevant file changes from scratch.";
/// <summary>Append <see cref="HonestNoContinuityHint"/> to a resumed task's goal. One composition, so the two lanes cannot drift on the separator either.</summary>
public static string WithHonestNoContinuityHint(string goal) => $"{goal}\n\n{HonestNoContinuityHint}";
/// <summary>
/// 3c: what a CROSS-HOST continuation is told, and the reason it needs its own sentence. The two lanes above
/// retry an attempt that FINISHED on a live host, so their only open question is whether a branch was pushed.
/// This lane continues an attempt whose machine was lost mid-run: the conversation comes from a checkpoint taken
/// some time before the loss, and the working tree is simply gone. Both halves have to be said, because the
/// restored transcript will describe edits — possibly edits made after the checkpoint — that the new workspace
/// does not contain, and an agent that is not told will read its own transcript as evidence about files it cannot
/// see.
/// This lane continues an attempt whose machine or process was lost mid-run: the conversation comes from a
/// checkpoint taken some time before the loss, and the working tree is simply gone. Both halves have to be said,
/// because the restored transcript will describe edits — possibly edits made after the checkpoint — that the new
/// workspace does not contain, and an agent that is not told will read its own transcript as evidence about files
/// it cannot see.
/// </summary>
public const string LostHostPreamble = "Note: the machine running your previous attempt was lost mid-run. Your conversation is restored from a checkpoint taken before that, so it may describe work you did after the checkpoint, and it may be missing your last few turns.";
public const string LostHostPreamble = "Note: the machine or the process running your previous attempt was lost mid-run. Your conversation is restored from a checkpoint taken before that, so it may describe work you did after the checkpoint, and it may be missing your last few turns.";
/// <summary>Said when the lost attempt HAD published a branch: the workspace is checked out at it, so the published work is present and only the unpublished remainder is gone. Takes the branch name so the agent can verify rather than take the claim on trust.</summary>
public static string LostHostPublishedBranchHint(string branch) =>
$"Your previous attempt published branch `{branch}`, and this workspace is checked out AT that branch — that work is here. Anything you had NOT published to it died with the machine, so check the files before continuing and redo whatever is missing.";
$"Your previous attempt published branch `{branch}`, and this workspace is checked out AT that branch — that work is here. Anything you had NOT published to it was lost with that attempt, so check the files before continuing and redo whatever is missing.";
/// <summary>
/// Append the cross-host continuation's honesty block to a resumed task's goal: the preamble always, then what
/// 3c: said when the lost host's checkpoint could not be READ — reaped, or its storage unreachable. The attempt
/// still runs (failing it would spend the retry this whole path exists to improve), but it runs COLD, and an
/// agent that was going to be handed a conversation must be told it is not getting one. Appended to the
/// lost-host block rather than replacing it: the machine really was lost, which is still the reason.
/// agent that was going to be handed a conversation must be told it is not getting one. Appended to the lost-host
/// block rather than replacing it: the machine or the process really was lost, which is still the reason.
/// </summary>
public const string LostHostCheckpointUnreadableHint = "Your previous conversation could not be recovered either — the checkpoint it was stored in is no longer readable — so you are starting this task from the beginning.";
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// without a pulse the reconciler reads a genuinely-alive resolve grade as abandoned and re-dispatches
// the run mid-grade. Starts only when a real grade fires (every early return above skips it).
using var heartbeatCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
var heartbeat = RunGradingHeartbeatLoopAsync(supervisorRunId, nodeId, SupervisorLane.AcceptanceGradeHeartbeatInterval, heartbeatCts.Token, "Supervisor resolve acceptance grading is still in progress.");
var heartbeat = RunGradingHeartbeatLoopAsync(supervisorRunId, nodeId, SupervisorLane.AcceptanceGradeHeartbeatInterval, heartbeatCts.Token, TimeProvider.System, "Supervisor resolve acceptance grading is still in progress.");
// reconciler reads this genuinely-alive fold as abandoned and re-dispatches the run mid-grade (the S3
// adversarial scan's M4: the baseline roughly doubled the silent window).
using var heartbeatCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
var heartbeat = RunGradingHeartbeatLoopAsync(supervisorRunId, nodeId, SupervisorLane.AcceptanceGradeHeartbeatInterval, heartbeatCts.Token, "Supervisor per-unit acceptance grading is still in progress.");
var heartbeat = RunGradingHeartbeatLoopAsync(supervisorRunId, nodeId, SupervisorLane.AcceptanceGradeHeartbeatInterval, heartbeatCts.Token, TimeProvider.System, "Supervisor per-unit acceptance grading is still in progress.");
using var heartbeatCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
var heartbeat = RunGradingHeartbeatLoopAsync(supervisorRunId, nodeId, SupervisorLane.AcceptanceGradeHeartbeatInterval, heartbeatCts.Token);
var heartbeat = RunGradingHeartbeatLoopAsync(supervisorRunId, nodeId, SupervisorLane.AcceptanceGradeHeartbeatInterval, heartbeatCts.Token, TimeProvider.System);
try
{
Expand All
@@ -1567,14 +1567,14 @@ private async Task<BenchmarkGrade> GradeStopTargetsWithHeartbeatAsync(Guid super
}
}
/// <summary>The heartbeat loop itself: sleeps, logs, repeats — until <paramref name="cancellationToken"/> fires (grading finished). A cancellation mid-sleep is the expected exit, never propagated as a fault. Internal + interval-parameterized so a unit test can pin the cancellation contract with a millisecond-scale interval instead of waiting out the real 90s production value.</summary>
internal async Task RunGradingHeartbeatLoopAsync(Guid supervisorRunId, string nodeId, TimeSpan interval, CancellationToken cancellationToken, string message = "Supervisor stop acceptance grading is still in progress.")
/// <summary>The heartbeat loop itself: sleeps, logs, repeats — until <paramref name="cancellationToken"/> fires (grading finished). A cancellation mid-sleep is the expected exit, never propagated as a fault. Internal + clock-parameterized so a unit test drives the sleep on a fake <paramref name="timeProvider"/> instead of racing the wall clock; REQUIRED rather than defaulting to the system clock for the reason <see cref="HeartbeatLoop.RunAsync"/> gives — a default is how a call site keeps the wall clock without saying so.</summary>
internal async Task RunGradingHeartbeatLoopAsync(Guid supervisorRunId, string nodeId, TimeSpan interval, CancellationToken cancellationToken, TimeProvider timeProvider, string message = "Supervisor stop acceptance grading is still in progress.")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -42,9 +42,10 @@ public static class ArtifactRetentionPolicy
/// A mid-run session-transcript checkpoint. TWO HOURS, not seven days, and the short floor is the whole reason
/// the class exists: a run writes one of these per minute, each supersedes the last, and a clean landing
/// (completion or a deliberate cancel) clears the column that references the survivor — so on the seven-day floor
/// a single long run would hold every superseded copy of a growing transcript for over a week. An abandon keeps
/// the column on purpose, and that survivor is then Referenced for good; this floor does not collect it. Two hours still sits far outside the window in which
/// the reference lands (the stamp is the next statement after the write) and far outside the window in which a
/// a single long run would hold every superseded copy of a growing transcript for over a week. An abandon-class
/// ending (the reconciler's abandon, or its spool recovery) keeps the column on purpose, and that survivor is then
/// Referenced for good; this floor does not collect it. Two hours still sits far outside the window in which the
/// reference lands (the stamp is the next statement after the write) and far outside the window in which a
/// continuation reads it (an abandon follows the host's death within one liveness window), so the floor costs
/// nothing it protects. The quarantine stays the standard 24 h: the second, independent wait is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -808,7 +808,7 @@ public async Task A_retried_agent_node_restores_the_lost_hosts_checkpoint()
resumed.ResumedFromCheckpointAt.ShouldNotBeNull("the launch stamps this onto the run's permanent confinement record");
resumed.ResumedFromAgentRunId.ShouldBe(lostAgent, "which attempt took over from which is a column, not prose");
retry.ResumedFromAgentRunId.ShouldBe(lostAgent, "and the task's provenance is promoted onto the row, like AgentDefinitionId");
resumed.Goal.ShouldContain("machine running your previous attempt was lost", Case.Sensitive,
resumed.Goal.ShouldContain("the machine or the process running your previous attempt was lost", Case.Sensitive,
"a restored conversation describes a working tree this sandbox does not have, and the agent must be told rather than left to infer it");
}
finally
Expand DownExpand Up
@@ -850,7 +850,7 @@ public async Task A_host_loss_with_no_checkpoint_is_retried_cold_and_claims_noth
resumed.ResumedFromCheckpointAt.ShouldBeNull();
resumed.ResumedFromAgentRunId.ShouldBeNull();
retry.ResumedFromAgentRunId.ShouldBeNull();
resumed.Goal.ShouldNotContain("machine running your previous attempt was lost", Case.Sensitive, "nothing may assert a restored conversation this attempt does not have");
resumed.Goal.ShouldNotContain("the machine or the process running your previous attempt was lost", Case.Sensitive, "nothing may assert a restored conversation this attempt does not have");
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Woken by the drop's LAST effect rather than by polling HasLease: the warning is written only after the lease
// has left the table, so once it lands both assertions below read a finished drop instead of racing one.
(await logger.Warned.WaitAsync(TimeSpan.FromSeconds(10))).ShouldBeTrue("the accept loop never reported its dead listener within 10s — the close never reached a loop still registering its first wait, or the failure was swallowed without a word");
broker.HasLease(runId).ShouldBeFalse(
"a lease whose accept loop has stopped went on reporting itself live. That is the worst answer this class can give: the child's connections sit unaccepted in a backlog instead of being refused, and a re-attach reading HasLease true concludes the run still has model access — so it lands no verdict and leaves the run Running, with no model and no explanation, for as long as the worker lives");
Say what keeps a checkpoint and settle two flaky waits #2010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Say what keeps a checkpoint and settle two flaky waits #2010
Changes from all commits
0d02d75File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing