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

fix: address review findings round 3 (PR #802)#805

Closed
github-actions[bot] wants to merge 4 commits into
mainfrom
fix/issue-397-shutdown-precheck-460db50e
Closed

fix: address review findings round 3 (PR #802)#805
github-actions[bot] wants to merge 4 commits into
mainfrom
fix/issue-397-shutdown-precheck-460db50e

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Addresses review findings from expert review round 3 on PR #802.

Findings addressed (5/5)

# Severity Finding Status
1 🟡 MODERATE Spurious double-reconnect on first-send-after-restart ✅ Fixed — added justResumed guard to skip pre-check after lazy-resume
2 🟡 MODERATE OperationCanceledException wrapping breaks cancellation semantics ✅ Fixed — added dedicated catch (OperationCanceledException) with throw;
3 🟡 MODERATE Tests cover only GetLastEventType, not the behavior change ✅ Fixed — added 4 new tests (2 behavioral + 2 structural)
4 🟢 MINOR Misleading error message always blames server shutdown ✅ Fixed — error now includes actual failure cause
5 🟢 MINOR Fragile structural test window (8000→10000) ✅ Fixed — replaced with IndexOf search from sendIdx

Test results

All 3648 tests pass (3644 existing + 4 new).

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 · ● 15.2M ·

github-actions Bot and others added 4 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>
…nnect

When lazy-resume runs (state.Session was null), the pre-check reads stale
events.jsonl that still contains session.shutdown, causing a spurious
second reconnect. The justResumed guard skips the pre-check in this case.

Also fixes OperationCanceledException being wrapped in InvalidOperationException
by adding a dedicated catch(OperationCanceledException) that preserves
cancellation semantics for callers.

Also improves error message to include actual failure cause instead of
always blaming server shutdown.

Also fixes null vs null! inconsistency on non-nullable Session property.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds 4 new tests:
- ShutdownPreCheck_SkipsWhenJustResumed: validates justResumed guard
- ShutdownPreCheck_TriggersWhenNotResumed: validates detection flow
- Structural test for justResumed guard presence
- Structural test for OperationCanceledException handling

Also fixes hardcoded /tmp/ path to use Path.GetTempPath().

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace Substring(sendIdx, 10000) with IndexOf from sendIdx to avoid
fragile window bumps on every SendPromptAsync growth.

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-460db50e 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