Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Parse Azure connection string to extract credentials for SAS token generation
  • Previously, presigned URLs failed when only AZURE_CONNECTION_STRING was set
  • Adds helper functions to consistently extract account name/key across all blob operations

Type of Change

  • Bug fix

Testing

Tested 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 Jan 25, 2026

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

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 25, 2026 8:55pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 25, 2026

Greptile Overview

Greptile Summary

This PR fixes Azure Blob Storage presigned URL generation when using connection strings and adds embedding dimension optimization. The core bug fix properly parses Azure connection strings to extract credentials needed for SAS token generation, resolving failures when only AZURE_CONNECTION_STRING is set.

Key Changes:

  • Added parseConnectionString() and getAccountCredentials() helper functions to consistently extract account name/key across all blob operations
  • Applied the fix to getPresignedUrl(), getPresignedUrlWithConfig(), and getMultipartPartUrls()
  • Added dimension parameter (1536) for text-embedding-3-* models to optimize vector storage
  • Updated documentation with three-tier resource requirements (Small/Standard/Production)
  • Updated Helm charts to increase memory limits for app (4Gi→8Gi) and adjust realtime service

Critical Issue:

  • Docker Compose files reduce memory limits to 1G, directly conflicting with the documentation updates in this same PR that state the app needs 4-12 GB. This will cause out-of-memory errors in all environments.

Confidence Score: 2/5

  • This PR contains critical configuration errors that will cause production failures
  • The Azure connection string parsing logic is well-implemented and solves the stated bug. However, all Docker Compose files reduce memory limits to 1G, which directly contradicts the documentation updates in this same PR stating the app needs 4-12 GB. This will cause immediate OOM failures in production, development, and devcontainer environments.
  • All docker-compose*.yml files have critical memory configuration issues that must be fixed before merge

Important Files Changed

Filename Overview
apps/sim/lib/uploads/providers/blob/client.ts Added helper functions to parse Azure connection string and extract credentials for SAS token generation, fixing presigned URL generation when using connection string authentication
apps/sim/lib/knowledge/embeddings.ts Added support for custom dimensions parameter (1536) for text-embedding-3-* models to optimize vector storage
.devcontainer/docker-compose.yml Reduced memory limit from 4G to 1G - may cause OOM errors under heavy load based on documented requirements
docker-compose.local.yml Reduced memory limit from 8G to 1G - may cause OOM errors under heavy load based on documented requirements
docker-compose.ollama.yml Reduced memory limit from 8G to 1G - may cause OOM errors under heavy load based on documented requirements
docker-compose.prod.yml Reduced memory limit from 4G to 1G - conflicts with updated documentation stating app needs 4-12 GB

Sequence Diagram

sequenceDiagram
    participant App as Application
    participant Client as BlobClient
    participant Parser as parseConnectionString()
    participant Getter as getAccountCredentials()
    participant Azure as Azure Blob Storage
    
    Note over App,Azure: Presigned URL Generation Flow
    
    App->>Client: getPresignedUrl(key, expiresIn)
    Client->>Getter: getAccountCredentials()
    
    alt Connection String Available
        Getter->>Parser: parseConnectionString(connectionString)
        Parser->>Parser: Extract AccountName via regex
        Parser->>Parser: Extract AccountKey via regex
        Parser-->>Getter: {accountName, accountKey}
    else Account Name/Key Available
        Getter-->>Getter: Return {accountName, accountKey}
    end
    
    Getter-->>Client: credentials
    Client->>Client: Create StorageSharedKeyCredential
    Client->>Client: Generate SAS token with credentials
    Client->>Azure: Sign URL with SAS token
    Azure-->>Client: Presigned URL
    Client-->>App: Presigned URL
    
    Note over App,Azure: Embedding Generation with Custom Dimensions
    
    App->>Client: generateEmbeddings(texts, model)
    Client->>Client: supportsCustomDimensions(modelName)
    
    alt Model supports dimensions (embedding-3)
        Client->>Azure: Request with dimensions: 1536
    else Model doesn't support
        Client->>Azure: Request without dimensions
    end
    
    Azure-->>Client: Embeddings
    Client-->>App: Embeddings array
Loading

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.

4 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@waleedlatif1 waleedlatif1 merged commit be2a9ef into staging Jan 25, 2026
11 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/docs branch January 25, 2026 21:06
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