Skip to content

fix: repair resend env and schema scaffolds#262

Merged
zbeyens merged 1 commit into
mainfrom
codex/resend-env-schema
May 20, 2026
Merged

fix: repair resend env and schema scaffolds#262
zbeyens merged 1 commit into
mainfrom
codex/resend-env-schema

Conversation

@zbeyens
Copy link
Copy Markdown
Member

@zbeyens zbeyens commented May 20, 2026

  • Auto release

🐛 Fixes Resend scaffold env/schema drift
🟢 95-100% confidence

Phase 🧪 Tests 🌐 Browser
Reproduced ✅ Regression assertions cover hidden Convex env-proxy reads, defaulted optional keys, helper reruns, comments, non-literal arrays, and Resend camelCase table names. ➖ N/A
Verified bun check passed, including full fixtures and scenario runtime verification. ➖ N/A

✅ Outcome

  • Resend scaffolds opt into lazy runtime reads for optional env keys, so getEnv() resolves Convex env-proxy values instead of freezing them as undefined.
  • Resend schema table literals are camelCase, matching the schema extension keys generated by kitcn add resend.
  • Env helper reruns now fail loudly for non-literal readOptionalRuntimeEnv values instead of duplicating or silently dropping keys.
  • Repo-local codex-review helper no longer points at an author-local path and only parses final review findings.

⚠️ Caveat

  • No browser surface changed.

🏗️ Design

  • Chosen layer: createEnv plus scaffold env-helper generation.
  • Direct process.env reads inside Resend would have scattered env ownership and broken the existing generated getEnv() contract.
  • A targeted opt-in keeps optional env reads lazy without rewriting package-wide env parsing.

🧪 Verified

  • bun lint:fix
  • bun typecheck
  • bun --cwd packages/kitcn build
  • git diff --check
  • bun test packages/kitcn/src/server/env.test.ts packages/kitcn/src/cli/registry/planner.test.ts
  • bun test ./packages/kitcn/src/cli/cli.commands.ts --test-name-pattern "run\\(add resend\\).*scaffold|ratelimit/auth/resend"
  • CI=1 bun test ./packages/kitcn/src/cli/cli.commands.ts
  • CODEX_REVIEW_AUTO_TESTS=0 .agents/skills/codex-review/scripts/codex-review --mode local --output /tmp/better-convex-codex-review-final.txt
  • bash -n .agents/skills/codex-review/scripts/codex-review
  • bun check

Resolve optional Resend env reads through createEnv runtime proxy opt-in.

Align Resend table literals with camelCase extension keys.

Harden env helper reruns and codex-review helper.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

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

Project Deployment Actions Updated (UTC)
better-convex Ready Ready Preview, Comment May 20, 2026 1:01pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2026

🦋 Changeset detected

Latest commit: d9bdf17

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
kitcn Patch
@kitcn/resend Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown

@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.

Reviewed commit: d9bdf17771

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

if [[ -z "$final_review_output" ]]; then
final_review_output=$(cat "$review_output")
fi
grep -Eq '^[[:space:]]*-[[:space:]]+\[P[0-3]\]' <<<"$final_review_output"
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 Badge Detect Codex findings without requiring list bullets

review_output_has_findings only matches lines shaped like - [P1]..., so reviews that emit priorities without a leading dash (for example structured/JSON-derived output) are treated as clean. In that case the helper can print codex-review clean and exit 0 even when actionable findings are present, which weakens the intended review gate for codex-review runs.

Useful? React with 👍 / 👎.

@zbeyens zbeyens merged commit a33d263 into main May 20, 2026
5 checks passed
@zbeyens zbeyens deleted the codex/resend-env-schema branch May 20, 2026 13:51
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