Skip to content

Cloud sessions v2: forward-compat guard for isActiveTaskState#325372

Merged
osortega merged 2 commits into
mainfrom
osortega/agents/cloud-sessions-v2-stopped-followup
Jul 13, 2026
Merged

Cloud sessions v2: forward-compat guard for isActiveTaskState#325372
osortega merged 2 commits into
mainfrom
osortega/agents/cloud-sessions-v2-stopped-followup

Conversation

@osortega

Copy link
Copy Markdown
Contributor

Follow-up to the cloud sessions v2 "Copilot stopped: " work, addressing PR review feedback that landed after the original PR was merged.

Changes

  • Forward-compat guard for isActiveTaskState (copilotCodingAgentUtils.ts): the switch had no default, so an unknown task state added server-side fell through and returned undefined at runtime. Added an explicit default: return true (unknown → active), matching the sibling taskStateToChatSessionStatus (unknown → InProgress). Returning false would let the detail view settle while the session state still reads in_progress, reintroducing the stuck "Session is in progress…" spinner with no live callback to recover.
  • Removed a stale duplicate comment block in the Task history builder that referenced an earlier revision.
  • Tests covering isActiveTaskState / isFailedTaskState across all lifecycle states plus the unknown/forward-compat case.

Validation

  • vitest — 32 tests pass (2 new).
  • tsgo --noEmit — clean.

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>
Copilot AI review requested due to automatic review settings July 10, 2026 21:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@osortega osortega enabled auto-merge (squash) July 10, 2026 22:04
@osortega osortega merged commit 0ec7ad8 into main Jul 13, 2026
29 checks passed
@osortega osortega deleted the osortega/agents/cloud-sessions-v2-stopped-followup branch July 13, 2026 23:17
@vs-code-engineering vs-code-engineering Bot added this to the 1.130.0 milestone Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants