feat(agents): add session resumption for interrupted deployments#118
Open
lukemurraynz wants to merge 4 commits into
Open
feat(agents): add session resumption for interrupted deployments#118lukemurraynz wants to merge 4 commits into
lukemurraynz wants to merge 4 commits into
Conversation
- Implement check for interrupted deployments on startup - Provide user options to resume, start fresh, or view details - Track phase state to allow resuming at specific points - Update output formatting for resumable deployments
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds guidance for resuming interrupted Azure deployment workflows by introducing a startup “resume check” and a phase-state.json tracking pattern that records phase transitions and resumable statuses.
Changes:
- Documented session resumption flow (detect resumable deployments, prompt to resume/new/view).
- Added phase state tracking guidance (
tracking/phase-state.json) with recommended write points and statuses. - Updated deployment directory initialization to include a
tracking/folder.
Comment on lines
+178
to
+196
| _jq_read() { local file=$1 field=$2 | ||
| jq -r ".$field" "$file" 2>/dev/null || \ | ||
| python3 -c "import json,sys; print(json.load(sys.stdin)['$field'])" < "$file" 2>/dev/null | ||
| } | ||
|
|
||
| for dir in .azure/deployments/*/; do | ||
| state_file="${dir}tracking/phase-state.json" | ||
| if [ -f "$state_file" ]; then | ||
| status=$(_jq_read "$state_file" status) | ||
| case "$status" in | ||
| suspended|blocked|awaiting-confirmation) | ||
| dep=$(_jq_read "$state_file" deploymentId) | ||
| phase=$(_jq_read "$state_file" phase) | ||
| updated=$(_jq_read "$state_file" updatedAt) | ||
| echo "Found: $dep | $phase | $status | $updated" | ||
| ;; | ||
| esac | ||
| fi | ||
| done |
Comment on lines
+202
to
+211
| ⏸️ In-Progress Deployment Found | ||
|
|
||
| | Deployment | Last Stage | Status | Last Updated | | ||
| |------------|-----------|--------|--------------| | ||
| | {deploymentId} | {phase} | {status} | {updatedAt} | | ||
|
|
||
| Would you like to: | ||
| R. Resume — continue from {phase} | ||
| N. Start a new deployment | ||
| V. View details of the interrupted deployment |
Comment on lines
+562
to
+573
| cat > .azure/deployments/$DEPLOYMENT_ID/tracking/phase-state.json << 'EOF' | ||
| { | ||
| "deploymentId": "DEPLOYMENT_ID_PLACEHOLDER", | ||
| "phase": "PHASE_PLACEHOLDER", | ||
| "status": "in-progress", | ||
| "startedAt": "STARTED_AT_PLACEHOLDER", | ||
| "updatedAt": "UPDATED_AT_PLACEHOLDER", | ||
| "completedPhases": [], | ||
| "mode": "MODE_PLACEHOLDER" | ||
| } | ||
| EOF | ||
| # Replace placeholders with actual values using jq or shell substitution at write time |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Allow 'in-progress' status to be treated as resumable - Update documentation to reflect changes in resumable statuses - Improve phase-state.json creation for tracking deployments
This was referenced May 27, 2026
Member
|
Thanks for the PR @Luke-Murray_atprod, good catch, let us review and integrate! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tracking/phase-state.jsonunder each deployment directory so an interrupted Copilot Chat session can be resumed rather than restarted from scratchsuspended,blocked, orawaiting-confirmationstate and offers an R/N/V prompt before asking what to deploycompletedblocked(security gate) andawaiting-confirmation(deploy confirmation) so resume re-presents the right prompt rather than re-running the stageWhat changes
Single file:
.github/agents/git-ape.agent.md## Workflow Stages. Runs a bash scan on startup using ajq+python3fallback (handles environments wherejqis not installed, including Windows/VS Code without jq in PATH)mkdirfix — changedmkdir -p .azure/deployments/$DEPLOYMENT_IDtomkdir -p .azure/deployments/$DEPLOYMENT_ID/trackingso the subdirectory exists from the start of every deploymentPhase state schema
{ "deploymentId": "deploy-20260525-143022", "phase": "stage-2.5-security-gate", "status": "blocked", "startedAt": "2026-05-25T14:30:00Z", "updatedAt": "2026-05-25T14:35:10Z", "completedPhases": ["stage-1-requirements", "stage-2-template"], "mode": "interactive" } Resumable statuses: suspended · blocked · awaiting-confirmation Terminal statuses (never resumed): completed · failed · aborted