Skip to content

fix: resolve conflicts for upstream sync PR #41 - #45

Closed
Cartofante wants to merge 4202 commits into
carto/mainfrom
upstream-sync-resolver/41
Closed

fix: resolve conflicts for upstream sync PR #41#45
Cartofante wants to merge 4202 commits into
carto/mainfrom
upstream-sync-resolver/41

Conversation

@Cartofante

Copy link
Copy Markdown
Collaborator

⛔ CRITICAL: MERGE INSTRUCTIONS ⛔

🚨 DO NOT USE "Squash and merge" 🚨

You MUST select "Create a merge commit" when merging this PR.

Why This Matters

Merge Type Result
Create a merge commit Preserves upstream history, future syncs work correctly
❌ Squash and merge DESTROYS upstream history, breaks future syncs
❌ Rebase and merge DESTROYS upstream history, breaks future syncs

What Happens If You Squash

  • 📈 Future sync PRs will show thousands of extra commits/files
  • 🔍 `git bisect` and `git blame` become useless for upstream code
  • 🔄 Every future sync will look like a massive change
  • 😱 This ALREADY happened with PR fix: resolve conflicts for upstream sync PR #24 #26 - don't repeat it!

🔧 Automated Conflict Resolution

This PR resolves merge conflicts in #41.

🎯 Resolution Strategy

Followed strict priority order:

  1. 🏢 CARTO Customizations - Preserved all CARTO-specific infrastructure
  2. 🔧 LiteLLM Core - Accepted upstream improvements to core functionality
  3. ⚖️ Manual Merge - Combined both when needed

📋 Files Modified

Total conflicts resolved: 632 files

CARTO versions kept:

  • All CARTO-specific files were already non-conflicting (workflows, scripts, documentation)
  • `.github/workflows/carto_*.yaml` (6 files)
  • `.github/scripts/calculate_carto_version.sh`
  • `CARTO_CLAUDE.md`, `APSCHEDULER_MEMORY_LEAK_FIX.md`, `REDIS_SESSION_PATCH.md`, etc.

Upstream versions accepted: 631 files

  • Core `litellm/` (408 files) - All LLM provider implementations
  • Tests (160+ files) - All upstream test files
  • Documentation (40+ files) - All docs updates
  • UI Dashboard (100+ files) - React components and built assets
  • Infrastructure (23+ files) - Config, deps, database schemas

Manually merged: 7 files (all accepted upstream after review)

  • `Dockerfile` - Accepted upstream tornado test cleanup
  • `Makefile` - Accepted upstream OpenAI 2.8.0 (vs CARTO's 1.99.5)
  • `docker/Dockerfile.non_root` - Accepted upstream Prisma caching improvements
  • `README.md` - Accepted upstream formatting updates
  • `.circleci/config.yml` - Accepted upstream CI improvements
  • `.circleci/requirements.txt` - Accepted upstream (added `responses==0.25.7`)
  • `ci_cd/security_scans.sh` - Accepted upstream (both added independently)

🐛 Bugs Fixed During Resolution

  1. batch_utils.py - Fixed missing `model_name` parameter in 4 functions

    • `calculate_batch_cost_and_usage()` - Added `model_name: Optional[str] = None`
    • `_handle_completed_batch()` - Added `model_name: Optional[str] = None`
    • `_batch_cost_calculator()` - Added `model_name: Optional[str] = None`
    • `_get_batch_job_total_usage_from_file_content()` - Added `model_name: Optional[str] = None`
  2. generic_guardrail_api.py - Fixed MyPy TypedDict literal-required error

    • Added `# type: ignore[literal-required]` comment for dynamic field iteration
  3. Complexity warnings - Added noqa comments

    • `base_invoke_transformation.py:137` - Added `# noqa: PLR0915`
    • `team_endpoints.py:1172` - Added `# noqa: PLR0915`

✅ Testing Results

  • `make format` - PASSED (626 files reformatted)
  • `make lint` - PASSED (Black + Ruff checks)
  • `make lint-mypy` - PASSED (MyPy type checking, 1389 files)
  • `make test-unit` - RUNNING (5221 tests with 4 parallel workers)
  • Manual review of conflicts completed
  • All conflict markers removed
  • No syntax errors

🔑 Key Changes

Dependencies:

  • OpenAI SDK: `1.99.5` → `2.8.0` (upstream version)
  • CircleCI: Added `responses==0.25.7`

Cleanup:

  • Removed 81 old `dist/` wheel files from enterprise & litellm-proxy-extras

New Features from Upstream:

  • OCR support (Azure OCR, Mistral OCR)
  • Video generation support
  • IBM Guardrails integration
  • Grayswan Guardrails integration
  • Tool permission guardrails
  • Enhanced MCP server features
  • Fal.ai image generation
  • Vertex AI search datastores

🔍 Review Guidelines

Please verify:

  1. ✅ CARTO workflows intact (`.github/workflows/carto_*.yaml`)
  2. ✅ CARTO documentation preserved (`CARTO_CLAUDE.md`, etc.)
  3. ✅ Core LiteLLM functionality improved with upstream changes
  4. ✅ All linting and type checking passing
  5. ⏳ Unit tests (check CI results when complete)

📊 Statistics

  • Files changed: 938
  • Insertions: 20,410
  • Deletions: 9,085
  • Conflicts resolved: 632
  • Bugs fixed: 3

📝 Notes

OpenAI SDK Upgrade:

  • Changed from `1.99.5` (CARTO) to `2.8.0` (upstream)
  • May require compatibility testing
  • Includes newer bug fixes and features

Docker Optimizations:

  • Tornado test file cleanup (reduces image size)
  • Improved Prisma binary caching (faster builds)

🔄 What Happens After Merge

When this PR is merged into `carto/main`:

  1. ✅ All upstream changes from `main` will be in `carto/main` (with conflicts resolved)
  2. ✅ CARTO customizations will be preserved
  3. Close PR 🔄 sync: upstream v1.79.3-stable #41 - it becomes redundant (changes already merged)
  4. 🎉 Upstream sync complete!

Branch flow:
```
upstream → main (mirror) → carto/main (via this PR)
```


🤖 Automated conflict resolution by Claude Code
Resolves conflicts in #41

reflection and others added 30 commits November 25, 2025 14:49
* include server_tool_use in streaming usage

* add test
…#16791)

* fix transcription exception handling

* reraise the exception
* init RAG api types

* add RAG endpoints

* init main.py for RAG ingest API

* init RecursiveCharacterTextSplitter

* add BaseRAGIngestion

* fix OpenAIRAGIngestion

* fix img handler

* init OpenAIRAGIngestion

* init BedrockRAGIngestion

* init BedrockRAGIngestion

* init rag tests

* init BedrockVectorStoreOptions

* implement BedrockRAGIngestion

* add BaseRAGAPI

* add endpoint for RAG ingest

* add ingest RAG endpoints

* add test doc

* add parse_rag_ingest_request

* update endpoints

* docs add docs for new RAG API

* fix qa check

* fix linting

* docs ficx

* docs

* add max depth checks

* docs anthropic
…text-format-bridge-conversion

fix: Support response_format parameter in completion -> responses bridge
- Automatically pass LiteLLM virtual key context as X-LiteLLM-* headers
- Includes key_alias, user_id, team_id, org_id, and user_email
- No configuration required - always enabled for application/user tracking
- Excludes sensitive data (metadata, API tokens) for security
- Add comprehensive tests (30 tests, all passing)
- Update documentation with header details
This should allow postgres to perform a more efficient index scan instead of a sequential table scan.

These two queries consistently show up in the longest-running ones in our instance, and are a major latency source for the usage page on the admin UI.
…meters (BerriAI#17019)

- Add model identifier to FLASH_IMAGE_PREVIEW_MODEL_IDENTIFIERS
- Add imageSize parameter support (1K, 2K, 4K) with GeminiImageSize type
- Add tests for imageSize parameter transformation
- Update documentation with new model
[Feature] UI - Disable edit, delete, info, for dynamically generated spend tags
…s_fix

[Feature] UI - Org Admin Team Permissions Fix
Chesars and others added 25 commits December 1, 2025 19:58
…) (BerriAI#17306)

Handle the case where metadata is explicitly set to null/None in the
request body. This was causing a 401 error with "'NoneType' object
has no attribute 'get'" when calling /v1/batches with metadata: null.

The fix uses `or {}` instead of a default dict value since the key
exists but has a None value.
* feat: add experimental latest-user filtering for Bedrock

* doc: add experimental bedrock latest-message flag
…cks pricing test). (BerriAI#17277)

* update databricks pricing and add DBU<>USD test

* Refactor test_databricks_pricing.py

Removed unnecessary sys.path modification and cleaned up comments.
…ype (request/response), image support (BerriAI#17338)

* refactor(generic_guardrail_api.py): refactor to update to new guardrail api logic

* refactor: refactor llm api integrations to support passing in text as a list[str] instead of one at a time

* refactor: fix linting errors

* refactor: pass request type to guardrail api

allows request vs. response processing to occur

* feat: pass user api key dict information to the guardrail api

* fix: pass user api key dict information to the guardrail api

* feat: pass litellm call id + trace id, if present

* docs: update docs
We recommend using 10–20 connections. Our actual default is 10, but the documentation incorrectly listed the default as 100.
* add OPENAI_COMPATIBLE_BATCH_AND_FILES_PROVIDERS

* fix use OPENAI_COMPATIBLE_BATCH_AND_FILES_PROVIDERS

* add _get_batch_job_total_usage_from_file_content

* fixes for vLLM + 12 labs async invoke

* fix: vLLM Batch APIs

* afile_retrieve

* test_hosted_vllm_full_workflow

* fix SERVER_URL for test
…ribute_error_code_raise

Fix 500 error for malformed request
…ader_forwarding

Fix: litellm user auth not passing issue
…7104)

* docs: add Azure AI Foundry documentation for Claude models

Add documentation explaining how to use Claude models (Sonnet 4.5,
Haiku 4.5, Opus 4.1) deployed on Azure AI Foundry with LiteLLM.

Azure exposes Claude using Anthropic's native API, so users can use
the existing anthropic/ provider with their Azure endpoint.

Closes BerriAI#17066

* docs: Add alternative method for Azure AI Foundry using anthropic/ provider

Document that users can use anthropic/ provider with Azure endpoint
as an alternative to the dedicated azure_ai/ provider.
* Update constants.py

added constants

* Update base_aws_llm.py

added steps

* Update invoke_handler.py

added openai support

* Update base_invoke_transformation.py

added

* Update test_bedrock_completion.py

added
[Fix] Bedrock Guardrail Indent and Import fix
[Infra] Add Google Private API Endpoint to Vertex AI fields
Automatic sync from upstream BerriAI/litellm
Preparing for v1.79.3-stable release

Strategy: Merge with history preservation (main mirrors upstream)
Conflict resolution strategy:
- Preserved CARTO customizations in infrastructure files
- Accepted upstream improvements to core LiteLLM functionality
- Fixed upstream bugs in batch_utils.py (missing model_name parameter)
- Fixed linting issues (unused imports, type errors, complexity warnings)

Testing:
- ✅ make format passed (626 files reformatted)
- ✅ make lint passed (Black + Ruff checks)
- ✅ make lint-mypy passed (MyPy type checking)
- 🔄 make test-unit running (5221 tests with 4 parallel workers)

Files resolution summary:
- Accepted upstream: 631 files (core litellm, tests, docs, UI)
- CARTO preserved: 0 conflicted files (CARTO workflows already non-conflicting)
- Manually reviewed: 7 files (Dockerfile, Makefile, docker/Dockerfile.non_root, README.md, .circleci/config.yml, .circleci/requirements.txt, ci_cd/security_scans.sh)

Key changes:
- OpenAI SDK upgraded: 1.99.5 → 2.8.0 (upstream)
- Added responses==0.25.7 to CircleCI requirements
- Fixed batches/batch_utils.py missing model_name parameters
- Fixed generic_guardrail_api.py TypedDict literal-required error
- Added PLR0915 noqa comments for complex functions

Total files modified: 939 (156 added, 9 modified, 81 deleted, 3 renamed, 690 from formatting)
@Cartofante

Copy link
Copy Markdown
Collaborator Author

⚠️ REMINDER: Use "Create a merge commit" ⚠️

When you're ready to merge this PR:

  1. Click the dropdown arrow next to the merge button
  2. Select "Create a merge commit"
  3. DO NOT select "Squash and merge" or "Rebase and merge"

This preserves upstream commit history and ensures future syncs work correctly.

Why?

Using squash/rebase will destroy the upstream commit history, causing:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.