test(auth): cover Composio upstream 401 session guard#2544
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR adds test coverage to distinguish Composio provider authentication failures from user session expiry. Client-side tests verify that Composio 401 Invalid API key errors classify as ChangesError classification for Composio provider auth failures
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
CI note: all other checks are green, and there are no unresolved review comments. The only failing check is , but it failed before running diff-cover: could not fetch the PR merge ref and ended with after retries. I do not have admin permission to rerun upstream Actions jobs from here, so please rerun the failed Coverage Gate job/check. |
|
CI note: all other checks are green, and there are no unresolved review comments. The only failing check is I do not have admin permission to rerun upstream Actions jobs from here, so please rerun the failed Coverage Gate job/check. |
Summary
classifyRpcErrorregression case proving that same shape is treated asprovider_auth, notauth_expired.SessionExpired.Problem
openhuman.composio_list_connectionsreturns a backend 500 that wraps a Composio401 Invalid API key.mainalready has the narrowed session-expiry classifier; this PR pins the reported wire shape so future broad 401 matching cannot regress it.Solution
src/core/jsonrpc_tests.rswith the verbatim backend-wrapped Composio invalid-key shape and asserts it does not matchis_session_expired_error.app/src/services/__tests__/coreRpcClient.test.tswith the same shape and asserts it classifies asprovider_auth.Submission Checklist
## Related— N/A: no feature matrix row affected.docs/RELEASE-MANUAL-SMOKE.md) — N/A: test-only regression guard.Closes #NNNin the## RelatedsectionImpact
Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
fix/2537-upstream-401-session-expiry986013b9b89f803be2f789210802bba284ee626dValidation Run
pnpm --filter openhuman-app format:checkviapnpm format:checkand pre-push hookpnpm typecheckvia pre-pushpnpm compile(tsc --noEmit)pnpm debug unit src/services/__tests__/coreRpcClient.test.ts -t classifyRpcError— 1 file passed, 27 tests passed / 57 skippedGGML_NATIVE=OFF cargo test --manifest-path Cargo.toml is_session_expired_error_does_not_match_backend_wrapped_composio_invalid_api_key --lib— 1 passedcargo fmt --manifest-path ../Cargo.toml --all --checkviapnpm format:check; pre-pushpnpm rust:checkpassed withGGML_NATIVE=OFFcargo fmt --manifest-path src-tauri/Cargo.toml --all --checkviapnpm format:check; pre-pushpnpm rust:checkpassed withGGML_NATIVE=OFFValidation Blocked
command:N/Aerror:N/Aimpact:N/ABehavior Changes
Parity Contract
auth_expired; downstream/provider 401s remain scoped errors.Duplicate / Superseded PR Handling
Summary by CodeRabbit
Note: This release contains no end-user visible changes.