Cloud sessions v2: forward-compat guard for isActiveTaskState#325372
Merged
osortega merged 2 commits intoJul 13, 2026
Conversation
Follow-up to the cloud sessions v2 "Copilot stopped" work, addressing PR review feedback: - Add an explicit `default` branch to `isActiveTaskState` so an unknown task state added server-side returns `true` (active) instead of falling through to `undefined`. This matches `taskStateToChatSessionStatus` (unknown -> InProgress) and avoids reintroducing the stuck "Session is in progress..." spinner when the detail view would otherwise settle while the session state still reads `in_progress`. - Remove a stale duplicate comment block in the task history builder. - Add tests covering `isActiveTaskState`/`isFailedTaskState` across all states plus the unknown/forward-compat case. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds forward compatibility for unknown cloud-agent task states.
Changes:
- Treats unknown task states as active.
- Adds lifecycle-state coverage.
- Removes a stale duplicate comment.
Show a summary per file
| File | Description |
|---|---|
copilotCodingAgentUtils.ts |
Adds the unknown-state fallback. |
copilotCloudSessionsProvider.spec.ts |
Tests task-state classification. |
copilotCloudSessionContentBuilder.ts |
Removes stale commentary. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Medium
benvillalobos
approved these changes
Jul 10, 2026
justschen
approved these changes
Jul 13, 2026
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.
Follow-up to the cloud sessions v2 "Copilot stopped: " work, addressing PR review feedback that landed after the original PR was merged.
Changes
isActiveTaskState(copilotCodingAgentUtils.ts): theswitchhad nodefault, so an unknown task state added server-side fell through and returnedundefinedat runtime. Added an explicitdefault: return true(unknown → active), matching the siblingtaskStateToChatSessionStatus(unknown →InProgress). Returningfalsewould let the detail view settle while the session state still readsin_progress, reintroducing the stuck "Session is in progress…" spinner with no live callback to recover.isActiveTaskState/isFailedTaskStateacross all lifecycle states plus the unknown/forward-compat case.Validation
vitest— 32 tests pass (2 new).tsgo --noEmit— clean.