Skip to content
This repository was archived by the owner on May 24, 2026. It is now read-only.

fix: address review findings round 2 (PR #802)#804

Closed
github-actions[bot] wants to merge 5 commits into
mainfrom
fix/issue-397-shutdown-precheck-abd21312
Closed

fix: address review findings round 2 (PR #802)#804
github-actions[bot] wants to merge 5 commits into
mainfrom
fix/issue-397-shutdown-precheck-abd21312

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Addresses 5 review findings from expert review round 2.

Changes

  1. 🟡 MODERATE — OperationCanceledException catch (CopilotService.cs): Added separate catch (OperationCanceledException) that rethrows directly without wrapping, preserving cancellation semantics in orchestration/reflection paths.

  2. 🟢 MINOR — Skip pre-check after lazy-resume (CopilotService.cs): Added wasLazyResumed guard so the shutdown pre-check is skipped when the lazy-resume block just ran, avoiding redundant double-reconnect on stale events.jsonl.

  3. 🟡 MODERATE — Structural tests for pre-check code paths (ShutdownPreCheckTests.cs): Added 3 structural tests verifying OCE is not wrapped, SendingFlag is released in both catch blocks, and pre-check is skipped after lazy-resume.

  4. 🟢 MINOR — Integration test rename (SessionManagementSmokeTests.cs): Renamed ShutdownPreCheckTests to SessionManagementSmokeTests with honest names reflecting actual coverage (dashboard/prompt UI smoke tests).

  5. 🟢 MINOR — Fragile test window (MultiAgentRegressionTests.cs): Replaced fixed 10000-char Substring window with IndexOf(string, startIndex) — no longer breaks when SendPromptAsync grows.

Test Results

All 3647 unit tests pass (12 shutdown pre-check tests including 3 new structural tests).

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • 192.0.2.1

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "192.0.2.1"

See Network Configuration for more information.

Generated by Review & Fix · ● 22.6M ·

github-actions Bot and others added 5 commits April 29, 2026 12:13
Before sending a prompt, SendPromptAsync now checks if events.jsonl ends
with session.shutdown. If so, it forces a reconnect before sending instead
of sending to a dead session and discovering the failure 10+ minutes later
via the watchdog.

The GetLastEventType helper (tail-read, last 4KB) keeps overhead minimal
on the normal send path.

Also increases the structural test search window in
PrematureIdleSignal_ResetInSendPromptAsync to accommodate the new code.

Fixes #397

Co-authored-by: copilot-agentic-workflow[bot] <224017+copilot-agentic-workflow[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The blanket catch(Exception) was wrapping OperationCanceledException in
InvalidOperationException, breaking cooperative cancellation semantics in
orchestration and reflection paths. Added a separate catch that rethrows
OCE directly while still releasing SendingFlag.

Also skips the pre-check when lazy-resume just ran (wasLazyResumed guard)
to avoid redundant double-reconnect on stale events.jsonl after app restart.

Addresses review findings #1 (MODERATE) and #2 (MINOR).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Added 3 tests verifying:
- OperationCanceledException is not wrapped (separate catch + throw;)
- SendingFlag is released in both catch blocks
- Pre-check is skipped after lazy-resume (wasLazyResumed guard)

These tests verify the dispose→reconnect→send flow and SendingFlag-release
invariants that were previously untested. If the pre-check block were
deleted from production code, these tests would now fail.

Addresses review finding #3 (MODERATE).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Renamed ShutdownPreCheckTests to SessionManagementSmokeTests with honest
test names. These tests verify dashboard/prompt UI presence — a baseline
smoke test, not the shutdown pre-check feature itself.

Addresses review finding #4 (MINOR).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Changed PrematureIdleSignal_ResetInSendPromptAsync test from a 10000-char
substring window to IndexOf(string, startIndex) — no longer breaks when
SendPromptAsync grows.

Addresses review finding #5 (MINOR).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen

Copy link
Copy Markdown
Owner

Stale fix-round PR — fixes were pushed to the main PR branch.

@PureWeen PureWeen closed this Apr 30, 2026
@PureWeen PureWeen deleted the fix/issue-397-shutdown-precheck-abd21312 branch April 30, 2026 20:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant