Skip to content

feat: add tests for Codex vault configuration and error handling: - #334

Merged
yashdev9274 merged 2 commits into
mainfrom
supercode-cli
Oct 30, 2026
Merged

yashdev9274 merged 2 commits into
mainfrom
supercode-cli

Conversation

@yashdev9274

@yashdev9274 yashdev9274 commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner
  • Introduced unit tests for the Codex vault configuration to validate encryption key handling and error messages.
  • Enhanced the configuredCodexVault function to improve error reporting for missing or invalid environment variables.
  • Added checks for JSON parsing and base64 encoding of encryption keys to ensure correct configuration.
  • Updated the CodexDeviceConnectionCard component to reflect changes in connection status messaging.

Description

Please include a summary of the change and which issue is fixed.

Fixes #(issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional changes)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

  • bun test passes
  • bun run typecheck passes
  • bun run lint passes (if applicable)

Checklist:

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Summary by CodeRabbit

  • Bug Fixes
    • Updated the connected Codex status message to clarify that the connection is saved and model access is checked separately.
    • Improved error messages for unavailable Codex vault configuration, identifying missing or invalid settings and noting when redeployment is needed.

- Introduced unit tests for the Codex vault configuration to validate encryption key handling and error messages.
- Enhanced the `configuredCodexVault` function to improve error reporting for missing or invalid environment variables.
- Added checks for JSON parsing and base64 encoding of encryption keys to ensure correct configuration.
- Updated the CodexDeviceConnectionCard component to reflect changes in connection status messaging.
@vercel

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
supercli Ready Ready Preview Oct 30, 2026 8:55am UTC
supercli-client Ready Ready Preview Oct 30, 2026 8:55am UTC
supercli-docs Ready Ready Preview Oct 30, 2026 8:55am UTC
1 Skipped Deployment
Project Deployment Actions Updated
vercel-supercodeai-integration Skipped Skipped Oct 30, 2026 8:55am UTC

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 31c9d741-6981-44f1-b6dc-e98b2e2ef968
Commits

Reviewing files that changed from the base of the PR and between f90f024 and 95d6a71.

Files selected for processing: 1
  • apps/web/modules/nova/codex/vault.ts

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3e40cb62-2aa3-4bb5-b4b2-24e901b5c8a2
Commits

Reviewing files that changed from the base of the PR and between d0d2d2d and f90f024.

Files selected for processing: 3
  • apps/web/modules/nova-web/components/codex-device-connection-card.tsx
  • apps/web/modules/nova/codex/vault.test.ts
  • apps/web/modules/nova/codex/vault.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Walkthrough

The Codex vault now validates its environment configuration and reports specific configuration errors. The Codex connection card uses updated text for its connected state.

Changes

Codex vault configuration

Layer / File(s) Summary
Validate vault configuration
apps/web/modules/nova/codex/vault.ts, apps/web/modules/nova/codex/vault.test.ts
configuredCodexVault accepts an optional environment object and validates the active version, key configuration shape, and 32-byte base64 keys. Tests cover whitespace handling, invalid settings, public errors, and successful configuration after correcting a missing key.

Codex connection card

Layer / File(s) Summary
Update connected-state text
apps/web/modules/nova-web/components/codex-device-connection-card.tsx
When Codex is connected, the card says “Connection saved · model access checked separately.” The authorization message is unchanged.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • yashdev9274/supercli#331: Introduced the Codex vault, configuredCodexVault, and CodexDeviceConnectionCard, which this pull request updates.
Merge Risk: Minimal · previous review f90f0

No merge-blocking risk was identified in the configuration validation or connection-status wording.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the Codex vault tests and error-handling work. It covers a central part of the changeset, although it does not mention the implementation validation or connection-status u…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title clearly identifies the Codex vault tests and error-handling work. It covers a central part of the changeset, although it does not mention the implementation validation or connection-status update.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 3 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

A rabbit checks the key with care,
And finds the vault settings there.
The card says saved, with access apart,
Clear words hop straight from the heart.
Then off the rabbit bounds to play!

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5 Tier: plus

[Medium impact] The changes affect Codex setup and connection messaging within Nova.

Fix the environment parameter type before merging so the web app’s TypeScript check can pass.

Findings

  1. P1 TypeScript check fails ▶

Summary

Improves Codex vault setup errors and adds configuration tests.

  • Codex vault setup explains which encryption setting needs attention.
  • The Codex card says a saved connection does not guarantee model access.

The new environment parameter needs a type fix before the web app’s TypeScript check can pass. Tests and UI capture were not run: dependencies are absent, and the connected page requires a signed-in account and database.

Reviews (1) · Last reviewed commit: "feat: add tests for Codex vault configur..." · Reviewed by Greptile

Comment thread apps/web/modules/nova/codex/vault.ts Outdated
NOVA_CODEX_ENCRYPTION_KEY_VERSION?: string
}

export function configuredCodexVault(env: CodexVaultEnvironment = process.env): CodexVault {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 TypeScript check fails

The new default assigns process.env to CodexVaultEnvironment, but NodeJS.ProcessEnv has no declared field in common with this all-optional type. Its string index does not satisfy TypeScript’s check, so this produces TS2559 and blocks the web app’s typecheck. Bun can still run the tests without checking types.

Use NodeJS.ProcessEnv for the parameter, add a string index to CodexVaultEnvironment, or build the default object from the two settings explicitly.

Suggested change
export function configuredCodexVault(env: CodexVaultEnvironment = process.env): CodexVault {
export function configuredCodexVault(env: CodexVaultEnvironment = {
NOVA_CODEX_ENCRYPTION_KEYS: process.env.NOVA_CODEX_ENCRYPTION_KEYS,
NOVA_CODEX_ENCRYPTION_KEY_VERSION: process.env.NOVA_CODEX_ENCRYPTION_KEY_VERSION,
}): CodexVault {

… values

- Modified the `configuredCodexVault` function to initialize with default environment values for encryption keys and version.
- Ensured that the function retrieves the necessary environment variables directly from `process.env` for better configuration handling.

This branch was successfully deployed

3 active and 1 inactive deployments
Preview – supercli — 95d6a719 Deployed Oct 30, 2026 by vercel[bot]
Preview – supercli-client — 95d6a719 Deployed Oct 30, 2026 by vercel[bot]
Preview – supercli-docs — 95d6a719 Deployed Oct 30, 2026 by vercel[bot]
Preview – vercel-supercodeai-integration — 95d6a719 Deployed Oct 30, 2026 by vercel[bot]
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.

1 participant