Skip to content

Conversation

@cometapii
Copy link

No description provided.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ 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".

Comment on lines +14 to +18
const DEBUG_LEVELS: DebugLevel[] = ['trace', 'debug', 'info', 'warn', 'error'];
const isProduction = process.env.NODE_ENV === 'production';
const envDebugLevel =
(process.env.NEXT_PUBLIC_LOG_LEVEL as DebugLevel | undefined) ??
(process.env.LOG_LEVEL as DebugLevel | undefined);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Guard logger against missing process.env in browsers

This module now reads process.env directly to determine the log level. Unlike the previous import.meta.env constants, process is not available in the browser or in the default Cloudflare Worker runtime, so importing this file will throw ReferenceError: process is not defined before any logging can occur. Because the logger is imported by many client-side stores and hooks, this would crash the UI in non‑Node environments. Consider reverting to compile‑time env injection or guarding the access behind a feature check.

Useful? React with 👍 / 👎.

Comment on lines +8 to +15
const apiKey =
env.NVIDIA_API_KEY ||
cloudflareEnv.NVIDIA_API_KEY ||
env.ANTHROPIC_API_KEY ||
cloudflareEnv.ANTHROPIC_API_KEY;

if (!apiKey) {
throw new Error('Missing NVIDIA_API_KEY environment variable');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require NVIDIA API key instead of falling back to Anthropic

The new streaming implementation targets NVIDIA’s OpenAI-compatible endpoint, yet getAPIKey still returns ANTHROPIC_API_KEY when no NVIDIA key is set. In environments that only configured the old Anthropic key (the previous default), the call will proceed with that key and fail at runtime with an opaque 401 instead of failing fast with a clear configuration error. Now that Env declares NVIDIA_API_KEY as required, this function should throw when that key is missing rather than silently accepting an incompatible one.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants