fix step insertion

This commit is contained in:
Francesco Renzi
2026-01-22 11:22:13 +00:00
committed by GitHub
parent 8fbe9aa963
commit 514d122c9d
4 changed files with 376 additions and 18 deletions

View File

@@ -247,6 +247,24 @@ namespace GitHub.Runner.Worker.Dap
/// <param name="checkpointIndex">The index of the checkpoint to restore</param>
/// <param name="jobContext">The job execution context</param>
void RestoreCheckpoint(int checkpointIndex, IExecutionContext jobContext);
/// <summary>
/// Gets whether a step was inserted "here" (before current step) while paused.
/// When true, StepsRunner should skip current step execution and re-process from queue.
/// </summary>
bool HasStepInsertedHere { get; }
/// <summary>
/// Consumes the "step inserted here" flag (resets it to false).
/// Called by StepsRunner after handling the insertion.
/// </summary>
void ConsumeStepInsertedHere();
/// <summary>
/// Sets the "step inserted here" flag.
/// Called by StepManipulator when --here insertion occurs.
/// </summary>
void SetStepInsertedHere();
}
/// <summary>
@@ -320,6 +338,9 @@ namespace GitHub.Runner.Worker.Dap
// Job cancellation token for REPL commands and blocking waits
private CancellationToken _jobCancellationToken;
// Flag for step inserted "here" (before current step)
private bool _hasStepInsertedHere;
public bool IsActive => _state == DapSessionState.Ready || _state == DapSessionState.Paused || _state == DapSessionState.Running;
public DapSessionState State => _state;
@@ -328,6 +349,18 @@ namespace GitHub.Runner.Worker.Dap
public bool HasPendingRestore => _pendingRestoreCheckpoint.HasValue;
public bool HasStepInsertedHere => _hasStepInsertedHere;
public void ConsumeStepInsertedHere()
{
_hasStepInsertedHere = false;
}
public void SetStepInsertedHere()
{
_hasStepInsertedHere = true;
}
public override void Initialize(IHostContext hostContext)
{
base.Initialize(hostContext);