fix(cli): classifyGatewayStatus no longer misclassifies "Not connected"#1288
fix(cli): classifyGatewayStatus no longer misclassifies "Not connected"#1288
Conversation
Move the unavailable-pattern check before the connected check, and use a strict line-anchored regex (/^\s*(?:Status:\s*)?Connected\s*$/im) so "Not connected", "Disconnected", and other substrings no longer match. Add regression tests for "Status: Not connected" and bare "Connected". Fixes #1279. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe changes fix a bug where gateway status strings containing "Not connected" were misclassified as "connected". The regex pattern for detecting a connected state is now stricter, requiring the word "Connected" to appear alone (optionally prefixed with "Status:") rather than as part of a larger phrase, with corresponding test coverage. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
…d" (#1288) ## Summary The `classifyGatewayStatus` regex matched "Not connected" as connected because `\bConnected\b` matches the substring. This was partially fixed in #1268 (added Disconnected guard) but "Not connected" still slipped through. Fix: - Move unavailable-pattern check before connected check - Use strict line-anchored regex: `/^\s*(?:Status:\s*)?Connected\s*$/im` - Add regression tests for "Status: Not connected" → inactive This fix was intended for #1268 but the auto-merge squashed before the commit landed. Fixes #1279. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved gateway connection status detection to handle edge cases and properly classify various status formats, ensuring more accurate connection state reporting. * **Tests** * Added test coverage for additional gateway status variations. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d" (NVIDIA#1288) ## Summary The `classifyGatewayStatus` regex matched "Not connected" as connected because `\bConnected\b` matches the substring. This was partially fixed in NVIDIA#1268 (added Disconnected guard) but "Not connected" still slipped through. Fix: - Move unavailable-pattern check before connected check - Use strict line-anchored regex: `/^\s*(?:Status:\s*)?Connected\s*$/im` - Add regression tests for "Status: Not connected" → inactive This fix was intended for NVIDIA#1268 but the auto-merge squashed before the commit landed. Fixes NVIDIA#1279. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved gateway connection status detection to handle edge cases and properly classify various status formats, ensuring more accurate connection state reporting. * **Tests** * Added test coverage for additional gateway status variations. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
The
classifyGatewayStatusregex matched "Not connected" as connected because\bConnected\bmatches the substring. This was partially fixed in #1268 (added Disconnected guard) but "Not connected" still slipped through.Fix:
/^\s*(?:Status:\s*)?Connected\s*$/imThis fix was intended for #1268 but the auto-merge squashed before the commit landed.
Fixes #1279.
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests