Skip to content

Conversation

@aadamgough
Copy link
Contributor

@aadamgough aadamgough commented Sep 10, 2025

Summary

Follow other uses of SIM_AGENT_API_URL to allow easier local testing.

Testing

Manually

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)

@vercel
Copy link

vercel bot commented Sep 10, 2025

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

Project Deployment Preview Comments Updated (UTC)
sim Ready Ready Preview Comment Sep 10, 2025 1:13am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Sep 10, 2025 1:13am

@icecrasher321 icecrasher321 changed the title Fix(yaml env var): added env var Fix(yaml env var): added env var fallback Sep 10, 2025
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 introduces a partial fix for environment variable handling in the YAML workflow conversion route. The change adds proper fallback logic for the SIM_AGENT_API_URL environment variable by importing the SIM_AGENT_API_URL_DEFAULT constant and creating a local variable that falls back to the default value when the environment variable is undefined.

The modification addresses a potential runtime issue where the application could fail when making API calls to the sim-agent service if the SIM_AGENT_API_URL environment variable is not configured. According to the environment configuration, this variable is optional, so providing a fallback ensures the application can gracefully default to 'https://agent.sim.ai' in deployment scenarios where this environment variable isn't set.

The change follows the established pattern in the codebase where critical URLs have default fallbacks, ensuring robustness across different deployment environments. This aligns with the application's architecture of supporting multiple deployment configurations while maintaining core functionality.

PR Description Notes:

  • The PR description is incomplete with empty Summary, Type of Change, and Testing sections
  • All checklist items remain unchecked

Confidence score: 2/5

  • This PR introduces an incomplete fix that creates inconsistent behavior within the same file
  • Score reflects the partial implementation where only one of two usages of the same environment variable was updated (line 295 fixed, line 96 still vulnerable)
  • Pay close attention to apps/sim/app/api/workflows/[id]/yaml/route.ts as it contains inconsistent environment variable usage that could cause runtime errors

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@vercel vercel bot temporarily deployed to Preview – docs September 10, 2025 01:03 Inactive
@icecrasher321 icecrasher321 merged commit 4d973ff into staging Sep 10, 2025
5 of 6 checks passed
Sg312 pushed a commit that referenced this pull request Sep 15, 2025
* added env var to route

* lint

---------

Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
* added env var to route

* lint

---------

Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
@waleedlatif1 waleedlatif1 deleted the fix/yaml-env-var branch October 13, 2025 17:39
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