Suppress transient startup TCP errors - #1241
Conversation
|
Reviewed the diff. Two actionable points in
Everything else (the |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af3e712720
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let reference = healthDismissedAt ?? headerAppearedAt | ||
| let deadline = reference.addingTimeInterval(RuntimeStartupTiming.uiGracePeriod) |
There was a problem hiding this comment.
Anchor TCP grace to the runtime transition
When the overlay window is first created or recreated after the app has already been running, both fallback timestamps describe header/UI lifecycle rather than Kanata startup. If Kanata's process is running but its event TCP connection is in a settled failed state, opening the overlay starts a fresh 140-second grace period and displays Starting… instead of No TCP; dismissing the health indicator similarly restarts that grace. Base the deadline on actual runtime startup/transition state or its timestamp so creating or dismissing UI cannot mask an established disconnection.
Useful? React with 👍 / 👎.
|
Reviewed the diff. One correctness/reliability concern and one minor UX nit: Silent failure when the runtime never recovers ( When a TCP let didRetry = await retryAfterRuntimeTransition()
if !didRetry, !Task.isCancelled {
AppLogger.shared.warn(...) // only a log, nothing user-visible
}Previously, any TCP network error surfaced immediately via Minor: |
|
Reviewed the diff (runtime-transition-aware reload handling + overlay TCP status). Overall solid — the transition/cooldown distinction is well tested. Two smaller points worth a look:
Test coverage for the new transition-retry paths and the |
|
Review of the reload/runtime-transition changes
Nothing else jumped out — the notification |
…sient-tcp-startup-errors
|
Review: potential self-cancellation race in the deferred-retry mechanism (
Since No other blocking issues found — the pending/disposition handling, |
|
Reviewed the diff — one correctness issue worth a look before merge. In if isCooldownBlockMessage(errorMessage) {
if scheduleRetryOnPending { scheduleDeferredReloadAfterCooldown() }
} else if notifyOnFailure {
NotificationCenter.default.post(name: .configReloadFailed, ...)
}If the retry attempt fails for a persistent reason — e.g. a genuine config validation error surfaced as Net effect: a real, permanent config problem hit during the post-transition retry window gets misreported as a transient startup/restart timing issue, and the specific error message is lost. Given the whole point of this PR is to make TCP-churn-during-restart distinguishable from real failures, it'd be good to have No tests currently cover a persistent/validation failure occurring inside the transition-retry window — worth adding one alongside the fix. Everything else (the |
|
Reviewed the diff. The runtime-transition-aware reload retry logic in
Nice test coverage overall, including the shared-task coalescing behavior between cooldown and runtime-transition retries. |
|
Reviewed the diff. A few findings on the new runtime-transition reload logic:
Test coverage for the new retry state machine ( |
|
Reviewed the diff. Overall solid — the runtime-transition/cooldown coalescing via
Nothing blocking — just flagging the retry-classification edge case as worth confirming is intentional, and the notification-object change as worth a quick grep across observers. |
Summary
Starting…/Restarting…during the canonical startup grace window, while preservingNo TCPfor settled failuresRoot cause
Startup bootstrap could begin a TCP reload against the old Kanata process just before stale-runtime recovery replaced it. The old process closed the acknowledged reload connection during termination, and KeyPath surfaced that expected transport churn as a configuration error.
User impact
Normal runtime replacement no longer produces the false
Reload delayed: Connection failed: Connection closedtoast, error sound, or transientNo TCPstate. Real validation errors and network failures outside an intentional transition remain visible.Validation
swift build --jobs 4TEST_FILTER=ConfigReloadCoordinatorTests ./Scripts/run-tests-safe.shTEST_FILTER=OverlayTCPStatusPresentationTests ./Scripts/run-tests-safe.shpython3 Scripts/check-accessibility.pygit diff --check./Scripts/review-gate.shselected the enforced remoteclaude-reviewgateA broad local safe-suite run also completed; unrelated existing failures were three Home Row snapshot height mismatches and one timing-sensitive canonical capture-timeout assertion. The new parallel notification test issue found in that run was fixed and its full coordinator suite was rerun successfully.