Fix undici proxy gap#375
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds HTTP proxy routing support for outgoing OIDC and NextAuth requests by integrating the ChangesHTTP Proxy Architecture and Log Fetch
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
nuxt.config.ts (1)
76-80: ⚡ Quick winResolve the proxy alias via module resolution (avoid
dist/proxy.cjs).
node-fetch-native/proxyis the supported public entry point;dist/proxy.cjsis an internal build artifact, so hardcoding it is brittle. Switch torequire.resolve("node-fetch-native/proxy")for stable resolution.Proposed change
import { fileURLToPath } from "node:url"; import { join } from "node:path"; +import { createRequire } from "node:module"; const projectRoot = fileURLToPath(new URL(".", import.meta.url)); +const require = createRequire(import.meta.url); +const nodeFetchProxyEntry = require.resolve("node-fetch-native/proxy"); export default defineNuxtConfig({ @@ nitro: { alias: { - "node-fetch-native/proxy": join(projectRoot, "node_modules/node-fetch-native/dist/proxy.cjs"), + "node-fetch-native/proxy": nodeFetchProxyEntry, }, },🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@nuxt.config.ts` around lines 76 - 80, The alias currently maps "node-fetch-native/proxy" to a hardcoded dist path; replace that brittle path with a module resolution call so the runtime resolves the published entry point. In the nitro.alias object (symbol: nitro and alias, key "node-fetch-native/proxy"), change the value from join(projectRoot, "node_modules/node-fetch-native/dist/proxy.cjs") to use require.resolve("node-fetch-native/proxy") (or an equivalent module-resolution call) so the public entry point is resolved instead of the internal dist artifact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/components/analysis/logs/ContainerLogs.vue`:
- Line 28: The initial call to getAnalysisLogs in ContainerLogs.vue can be
truncated because it omits limit (API defaults to 1000); update the initial
refreshLogs/fetch path that calls getAnalysisLogs(analysisId) so it explicitly
passes { limit: null } (or equivalent option accepted by getAnalysisLogs) to
request an unbounded snapshot, ensuring lastFetchedAt is set after the full
initial dataset is returned and subsequent polling with query: { start_date:
lastFetchedAt.value } does not permanently miss earlier entries.
In `@server/routes/flame/api/auth/`[...].ts:
- Line 201: The signOut and jwt handler parameter typings are too strict; update
them to match NextAuth shapes (make token/session optional for events.signOut
and make user/account/profile optional for callbacks.jwt) or simply remove the
inline annotations and import/ use NextAuth's official types. For example,
change the signOut signature in signOut to accept { token?: JWT; session?:
Session } and change the jwt callback signature to accept a params object where
token: JWT is required but user?: User | null, account?: Account | null,
profile?: Profile | null, isNewUser?: boolean are optional (or import the
appropriate NextAuth callback types and use those) so the implementations in
signOut and callbacks.jwt align with NextAuth's runtime shapes.
---
Nitpick comments:
In `@nuxt.config.ts`:
- Around line 76-80: The alias currently maps "node-fetch-native/proxy" to a
hardcoded dist path; replace that brittle path with a module resolution call so
the runtime resolves the published entry point. In the nitro.alias object
(symbol: nitro and alias, key "node-fetch-native/proxy"), change the value from
join(projectRoot, "node_modules/node-fetch-native/dist/proxy.cjs") to use
require.resolve("node-fetch-native/proxy") (or an equivalent module-resolution
call) so the public entry point is resolved instead of the internal dist
artifact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: cd3f362d-531a-4f10-90d5-f9081a074aba
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
app/components/analysis/logs/ContainerLogs.vuenuxt.config.tspackage.jsonserver/routes/flame/api/auth/[...].ts
Summary by CodeRabbit
Bug Fixes
Chores