Skip to content

fix(copilot): remove process.env#854

Merged
Sg312 merged 1 commit intostagingfrom
fix/copilot-env-vars
Aug 2, 2025
Merged

fix(copilot): remove process.env#854
Sg312 merged 1 commit intostagingfrom
fix/copilot-env-vars

Conversation

@Sg312
Copy link
Contributor

@Sg312 Sg312 commented Aug 2, 2025

Summary

Brief description of what this PR does and why.

Fixes #(issue)

Type of Change

  • Bug fix

Testing

How has this been tested? What should reviewers focus on?

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

@vercel
Copy link

vercel bot commented Aug 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sim 🔄 Building (Inspect) Visit Preview 💬 Add feedback Aug 2, 2025 11:42pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Aug 2, 2025 11:42pm

@Sg312 Sg312 merged commit 9f0673b into staging Aug 2, 2025
3 of 4 checks passed
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR systematically refactors environment variable access across the copilot API endpoints to use the centralized env configuration system instead of direct process.env access. The changes affect six files in the copilot module, replacing hardcoded environment variable access with imports from @/lib/env.

The refactoring standardizes how environment variables are handled throughout the copilot system by leveraging the project's established environment configuration built on @t3-oss/env-nextjs and Zod validation. This system provides type safety, runtime validation, and better support for Docker deployments through next-runtime-env. The PR adds SERPER_API_KEY to the centralized environment schema and updates all copilot tools to use the validated environment object.

The changes touch various copilot functionality including workflow management (build-workflow.ts, edit-workflow.ts), API methods (methods/route.ts), user tools (set-environment-variables.ts), and search capabilities (online-search.ts). One file (get-user-workflow.ts) had unused environment variables removed since it only performs local database operations. This refactoring aligns the copilot module with the project's broader architecture for environment variable management and improves maintainability across the codebase.

Confidence score: 1/5

  • This PR contains a critical bug that will break functionality and requires immediate attention before merging
  • Score reflects a serious endpoint path mismatch in set-environment-variables.ts that will cause runtime failures
  • Pay close attention to apps/sim/app/api/copilot/tools/user/set-environment-variables.ts which references a non-existent API endpoint

7 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@vercel vercel bot temporarily deployed to Preview – sim August 2, 2025 23:44 Inactive
@waleedlatif1 waleedlatif1 deleted the fix/copilot-env-vars branch August 4, 2025 17:49
waleedlatif1 pushed a commit that referenced this pull request Aug 5, 2025
waleedlatif1 pushed a commit that referenced this pull request Aug 6, 2025
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
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