Skip to content

🔄 Upstream Sync: LiteLLM v1.83.7-stable - #105

Closed
Cartofante wants to merge 198 commits into
carto/mainfrom
upstream-sync/v1.83.7-stable
Closed

🔄 Upstream Sync: LiteLLM v1.83.7-stable#105
Cartofante wants to merge 198 commits into
carto/mainfrom
upstream-sync/v1.83.7-stable

Conversation

@Cartofante

@Cartofante Cartofante commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

🔄 Upstream Sync: LiteLLM v1.83.7-stable

Syncs CARTO's LiteLLM fork with upstream stable release v1.83.7-stable.

Metric Value
Version 1.83.3v1.83.7-stable
Commits 197
Files Changed 947
Upstream Release v1.83.7-stable

Caution

⚠️ DO NOT SQUASH MERGE THIS PR

Use "Create a merge commit" only. Squashing destroys upstream history and breaks future syncs.


🧪 Pre-Merge Checklist

  • CI checks pass (lint, tests, Docker build)
  • CARTO customizations preserved
  • pyproject.toml version matches upstream

📊 Release Information (click to expand)
🔀 Branch Flow (click to expand)
  1. BerriAI/litellm:main merged into CartoDB/litellm:main
  2. ✅ Created dedicated sync branch: upstream-sync/v1.83.7-stable
  3. 📝 This PR: upstream-sync/v1.83.7-stablecarto/main

[!NOTE]
Why a dedicated branch? Allows pushing conflict resolution commits directly to this PR.

📝 CARTO-Specific File Guidelines (click to expand)

When reviewing or resolving conflicts:

✅ Keep CARTO Versions (Ours)

  • .github/workflows/carto_*.yaml - CARTO workflows
  • .github/workflows/carto-*.yml - CARTO workflows
  • CARTO_*.md, docs/CARTO_*.md - CARTO documentation

🔄 Accept Upstream (Theirs)

  • pyproject.toml - Version field
  • litellm/ - Core library code
  • tests/ - Upstream tests
  • requirements.txt - Dependencies

⚠️ Manual Review Required

  • Dockerfile, docker/Dockerfile.non_root - CARTO customizations
  • Makefile - Check # CARTO: sections
🔧 Conflict Resolution (click to expand)

If this PR has conflicts:

Option 1: Automated (Recommended)

The carto-upstream-sync-resolver workflow triggers automatically.

What it does:

  1. 🤖 Detects conflicts → 🔀 Merges carto/main → ✏️ Resolves conflicts → 🧪 Runs tests → 📌 Pushes to this PR

You just need to: Wait for resolution commits, verify CARTO customizations, merge.

[!TIP]
Single PR workflow! No separate resolution PR needed.

Option 2: Manual Resolution

git fetch origin
git checkout upstream-sync/v1.83.7-stable
git merge origin/carto/main  # Creates conflicts
# ... resolve conflicts ...
make lint && make test-unit
git push origin upstream-sync/v1.83.7-stable
📚 Documentation Links (click to expand)

🤖 This PR was automatically created by the carto-upstream-sync workflow.

CARTO Customizations Analysis

Overall Assessment: ✅ PASS

Decision Count Description
Upstream Substitutes 3 Upstream provides equivalent functionality
Customized Upstream 3 Upstream enhanced with CARTO-specific behavior
Preserved CARTO 13 Full CARTO implementation kept
Incorrectly Dropped 0 CARTO feature lost (needs fixing!)
Total 19

CARTO Feature Preservation Analysis

Summary

Decision Count
Upstream Substitutes 3
Customized Upstream 3
Preserved CARTO 13
Incorrectly Dropped 0
Total Analyzed 19

Overall Assessment: PASS ✅

All CARTO customizations were correctly handled during the v1.83.7-stable upstream sync. No features were incorrectly dropped.


Feature Details

Upstream Substitutes (3)

Features where upstream now provides equivalent functionality:

PR Title Reason
#28 cherry-pick upstream metadata None check Originally cherry-picked from upstream; now in v1.83.7-stable
#23 Vertex AI labels support Originally cherry-picked from upstream; now in v1.83.7-stable
#70 Azure URL suffix stripping Upstream URL handling via _get_base_azure_url (verify behavior)

Customized Upstream (3)

Features where upstream was enhanced with CARTO additions:

PR Title Details
#68 OCI Gemini tool calling CARTO tool_calls handling merged with upstream OCI base
#5 Redis session timing CARTO timing improvements merged with upstream Redis handling
#4 Streaming ID consistency CARTO ID tracking merged with upstream streaming base

Preserved CARTO (13)

Features where full CARTO implementation was kept:

PR Title Category
#98 tree-level merge conflict handling CI/CD
#96 Claude Write tool for release notes CI/CD
#94 .worktrees/ in .gitignore Core
#93 Slack Block Kit notifications CI/CD
#91 CARTO features manifest CI CI/CD
#90 multi-arch Docker builds Infrastructure
#76 CARTO-First resolution strategy Core
#69 Databricks empty delta handling Databricks
#58 Snowflake tool calling Responses API
#55 wolfi-base Docker image Infrastructure
#54 streaming JSON repair Streaming
#38 Snowflake PAT auth Streaming
#7 APScheduler memory leak fix Core

Issues Found

None - All CARTO features were correctly preserved or appropriately substituted by upstream equivalents.


Recommendations

  1. Verify Azure URL handling (PR fix(azure): Strip operation suffixes from deployment URLs to prevent 404 errors #70): The original fix stripped operation suffixes to prevent 404 errors. Verify that upstream's _get_base_azure_url provides equivalent protection.

  2. Verify Redis session timing (PR Jatorre/fix/responses api redis session timing #5): Confirm that Redis session timing behavior works correctly after merge with upstream changes.

  3. Monitor cherry-picked fixes: PRs fix: 🐛 add Vertex AI labels support (cherry-picked from upstream) #23 and fix: cherry-pick upstream metadata None check [sc-521238] #28 were originally cherry-picks that are now upstream. Future syncs should not need to consider these.


Analysis Methodology

  1. Compared three versions of each CARTO-modified file:

    • .upstream - The upstream v1.83.7-stable tag version
    • .carto - The CARTO customization from carto/main before merge
    • .resolved - The final resolved version after conflict resolution
  2. For each feature, verified:

    • Is the CARTO functionality present in resolved?
    • Does upstream provide equivalent functionality?
    • Was code merged from both sources?
  3. Classified each decision and assessed correctness.


Analysis completed: 2026-04-27 13:10 UTC
PR: #105 - Upstream Sync: LiteLLM v1.83.7-stable


Feature-by-Feature Breakdown

PR #98: fix(gh-workflows): handle tree-level merge conflicts in upstream sync

  • Decision: 🔒 Preserved CARTO (high confidence)
  • Reason: CARTO workflow file carto-upstream-sync-main.yml (1013 lines) preserved. No upstream equivalent exists.
  • Files: .github/workflows/carto-upstream-sync-main.yml
  • Recommendation: Correct decision - CARTO-specific workflow preserved

PR #96: fix(gh-workflows): grant Write tool to Claude for release notes

  • Decision: 🔒 Preserved CARTO (high confidence)
  • Reason: CARTO release workflow (746 lines) preserved with Write tool permissions for Claude.
  • Files: .github/workflows/carto-release.yaml
  • Recommendation: Correct decision - CARTO release automation preserved

PR #94: chore(gitignore): add .worktrees/ to .gitignore

  • Decision: 🔒 Preserved CARTO (high confidence)
  • Reason: .worktrees/ entry preserved in .gitignore at lines 105-106. Upstream doesn't have this.
  • Files: .gitignore
  • Recommendation: Correct decision - worktree support preserved

PR #93: chore: cleanup Slack notifications — migrate to Block Kit

  • Decision: 🔒 Preserved CARTO (high confidence)
  • Reason: Slack changelog workflow (560 lines) and notification workflows preserved with Block Kit format.
  • Files: .github/workflows/carto-slack-changelog.yml, .github/workflows/carto-upstream-sync-ready-checker.yml
  • Recommendation: Correct decision - CARTO notification system preserved

PR #91: feat(.github): add CARTO features manifest CI verification

  • Decision: 🔒 Preserved CARTO (high confidence)
  • Reason: carto-features.yml manifest (69 lines) and check workflow preserved. This is CARTO-specific CI.
  • Files: .github/carto-features.yml, .github/workflows/carto-features-check.yml
  • Recommendation: Correct decision - CARTO feature manifest CI preserved

PR #90: feat(docker): multi-arch builds (AMD64 + ARM64)

  • Decision: 🔒 Preserved CARTO (high confidence)
  • Reason: docker-build-multiarch.yaml (134 lines) preserved with ARM64 + AMD64 build support.
  • Files: .github/workflows/docker-build-multiarch.yaml
  • Recommendation: Correct decision - multi-arch build support preserved

PR #76: feat: CARTO-First resolution strategy for upstream syncs

  • Decision: 🔒 Preserved CARTO (high confidence)
  • Reason: CARTO_CLAUDE.md (34017 bytes) fully preserved with CARTO-first strategy documentation.
  • Files: CARTO_CLAUDE.md
  • Recommendation: Correct decision - CARTO development guidelines preserved

PR #70: fix(azure): Strip operation suffixes from deployment URLs

  • Decision: ✅ Upstream Substitutes (medium confidence)
  • Reason: Azure URL handling now managed via upstream _get_base_azure_url. Need to verify 404 prevention still works.
  • Files: litellm/llms/azure/common_utils.py
  • Recommendation: Verify Azure URL handling still prevents 404 errors with deployment paths

PR #69: fix(databricks): Handle empty delta in GPT-5 streaming

  • Decision: 🔒 Preserved CARTO (high confidence)
  • Reason: Safe .get('content') access pattern found at line 69 and elsewhere in Databricks transformation.
  • Files: litellm/llms/databricks/chat/transformation.py
  • Recommendation: Correct decision - safe delta handling preserved

PR #68: fix(oci): Add tool calling support for OCI Gemini streaming

  • Decision: 🔧 Customized Upstream (high confidence)
  • Reason: OCI transformation includes tool_calls handling (lines 685-713). Streaming iterator also has tool call delta handling.
  • Files: litellm/llms/oci/chat/transformation.py, litellm/responses/litellm_completion_transformation/streaming_iterator.py
  • Recommendation: Correct decision - OCI tool calling preserved with upstream base

PR #58: fix: Enable Snowflake tool calling via Responses API

  • Decision: 🔒 Preserved CARTO (high confidence)
  • Reason: Snowflake transformation includes full tool_use to tool_calls conversion (lines 38-88). Claude format handling preserved.
  • Files: litellm/llms/snowflake/chat/transformation.py
  • Recommendation: Correct decision - Snowflake tool calling preserved

PR #55: fix: switch Docker base image to wolfi-base

  • Decision: 🔒 Preserved CARTO (high confidence)
  • Reason: Dockerfile.non_root uses cgr.dev/chainguard/wolfi-base as base image (line 2-3).
  • Files: docker/Dockerfile.non_root
  • Recommendation: Correct decision - security-hardened base image preserved

PR #54: fix: repair malformed JSON in streaming tool call arguments

  • Decision: 🔒 Preserved CARTO (high confidence)
  • Reason: _validate_and_repair_tool_arguments function (lines 41-79) with JSONDecoder.raw_decode for O(n) repair preserved.
  • Files: litellm/litellm_core_utils/streaming_chunk_builder_utils.py
  • Recommendation: Correct decision - streaming JSON repair preserved

PR #38: fix: Snowflake PAT auth and Claude streaming support

  • Decision: 🔒 Preserved CARTO (high confidence)
  • Reason: PAT token detection at line 26 ('pat/' prefix detection) in Snowflake common_utils preserved.
  • Files: litellm/llms/snowflake/common_utils.py
  • Recommendation: Correct decision - PAT authentication support preserved

PR #28: fix: cherry-pick upstream metadata None check

  • Decision: ✅ Upstream Substitutes (high confidence)
  • Reason: This was a cherry-pick from upstream. Now included in v1.83.7-stable tag.
  • Files: litellm/llms/vertex_ai/gemini/transformation.py
  • Recommendation: Correct decision - upstream now includes this fix

PR #23: fix: add Vertex AI labels support (cherry-picked)

  • Decision: ✅ Upstream Substitutes (high confidence)
  • Reason: Vertex AI labels support (lines 714-778) present. This was cherry-picked and is now in upstream.
  • Files: litellm/llms/vertex_ai/gemini/transformation.py
  • Recommendation: Correct decision - upstream provides equivalent functionality

PR #7: Configure scheduler with memory leak prevention settings

  • Decision: 🔒 Preserved CARTO (high confidence)
  • Reason: APScheduler settings (misfire_grace_time, coalesce, max_instances) preserved at multiple locations in proxy_server.py (lines 4467, 6223-6360).
  • Files: litellm/proxy/proxy_server.py, litellm/constants.py
  • Recommendation: Correct decision - memory leak prevention settings preserved

PR #5: fix: Responses API Redis session timing

  • Decision: 🔧 Customized Upstream (medium confidence)
  • Reason: Redis session handling exists in responses transformation. Timing improvements likely merged with upstream base.
  • Files: litellm/responses/litellm_completion_transformation/transformation.py
  • Recommendation: Verify Redis session timing behavior works correctly

PR #4: Port streaming ID consistency fixes

  • Decision: 🔧 Customized Upstream (high confidence)
  • Reason: Streaming iterator has accumulated_tool_calls tracking (line 88) and consistent ID handling throughout.
  • Files: litellm/responses/litellm_completion_transformation/streaming_iterator.py
  • Recommendation: Correct decision - streaming ID consistency preserved

Analyzed: 2026-04-27 13:07:02 UTC
Workflow Run: #21
Analysis Artifacts: Download JSON/MD
Method: Claude Code (Opus 4.5) post-resolution semantic analysis

yuneng-berri and others added 30 commits April 3, 2026 23:47
Add a self-contained Playwright E2E test suite that runs against a local
PostgreSQL database instead of Neon. Tests cover role-based access for all
5 user roles (proxy admin, admin viewer, internal user, internal viewer,
team admin) and authentication flows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* doc fix

* docs fix

* docs fix

* doc fix

* docs

* docs fix
* week 1 checklist

* update railway url
…sts (BerriAI#25122)

* docs(blog): add cosign Docker image verification instructions

Add steps for verifying Docker images with cosign to three security blog posts:
CI/CD v2, Security Townhall, and Security Update.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs(proxy): add cosign verification to Docker/Helm/Terraform deploy page

Add image signature verification steps to the main deployment doc so
users pulling Docker images know how to verify them with cosign.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: fixes

* Update index.md

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* [Docs] Scope cosign signing docs to GHCR and specify starting version

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [Docs] Add starting version callout to ci_cd_v2 blog post

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Krrish Dholakia <krrish+github@berri.ai>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
The proxy_e2e_azure_batches_tests workflow is consistently flaky and
does not provide reliable signal on whether changes break anything.
Remove the workflow from both CircleCI and GitHub Actions, along with
the test directory it exclusively used.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* [Docs] Enforce Black formatting in contributor docs

Black formatting is now enforced in CI. Update CLAUDE.md, AGENTS.md,
and CONTRIBUTING.md to instruct contributors and AI agents to run
`poetry run black .` before committing, and add VS Code setup guidance.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: fixes

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Remove redundant matrix unit test workflow

All test paths in test-litellm-matrix.yml are fully covered by the
newer semantic unit test workflows (test-unit-*.yml), making the
matrix workflow redundant CI spend.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add Codecov coverage reporting to semantic unit test workflows

Add coverage collection (--cov) and Codecov OIDC upload to both
reusable base workflows and all 12 caller workflows, replacing the
coverage reporting that was previously only in the matrix workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Move id-token/pull-requests permissions to job level for multi-job workflows

For workflows with multiple jobs (llm-providers, proxy-db), move
id-token: write and pull-requests: write from workflow level to job
level so permissions are scoped to only the jobs that need them.
Removes zizmor inline suppressions that were masking the issue.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a new endpoint to bulk-update team_member_permissions across
teams. Supports apply_to_all_teams (with cursor-based pagination)
or a specific list of team_ids. Merges new permissions into each
team's existing set rather than overwriting.

Also fixes test isolation bug in test_get_prompt_info_by_base_id
where leaked prisma_client state from other tests caused a
TypeError on await.
…ember-permissions

feat: add POST /team/permissions_bulk_update endpoint
BerriAI#25258)

* fix: batch-limit stale managed object cleanup to prevent 300K row UPDATE (BerriAI#25257)

* Add STALE_OBJECT_CLEANUP_BATCH_SIZE constant

Configurable batch limit (default 1000) for stale managed object cleanup,
preventing unbounded UPDATE queries from hitting 300K+ rows at once.

* Batch-limit stale managed object cleanup with single bounded SQL query

Two fixes to _cleanup_stale_managed_objects:

1. Replace unbounded update_many with a single execute_raw using a
   subquery LIMIT, capping each poll cycle to STALE_OBJECT_CLEANUP_BATCH_SIZE
   rows. Zero rows loaded into Python memory — everything stays in Postgres.
   Uses the same PostgreSQL raw-SQL pattern as spend_log_cleanup.py
   (the proxy requires PostgreSQL per schema.prisma).

2. Extract _expire_stale_rows as a separate method for testability.

Keeps the file_purpose='response' filter to avoid incorrectly expiring
long-running batch or fine-tune jobs that legitimately exceed the
staleness cutoff.

* docs: add STALE_OBJECT_CLEANUP_BATCH_SIZE to env vars reference

* test: remove deprecated embed-english-v2.0 cohere embedding tests
* bump litellm-enterprise to 0.1.37

* update poetry.lock for enterprise 0.1.37 bump
* bump litellm version to 1.83.4

* regenerate poetry.lock
Pin all cosign public key references to the immutable commit hash
(0112e53) that first introduced the key, instead of fetching it from
the release tag. This addresses the concern that an attacker with push
access could replace the key on main/tags and re-sign tampered images.

Docs now show two verification methods: commit hash (recommended) and
release tag (convenience), with explanation of why the hash is stronger.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- team-admin: assert Admin Settings is not visible (role-specific check)
- proxy-admin: use users[Role.ProxyAdmin].password from constants instead of duplicating the env var fallback inline
* add us gov models

* added max tokens

* greptile fix

---------

Co-authored-by: mubashir1osmani <mubashir.osmani777@gmail.com>
PR BerriAI#25258 changed _cleanup_stale_managed_objects from update_many to
execute_raw via _expire_stale_rows, but the tests were not updated.
The tests now mock _expire_stale_rows on the instance and assert
update_many calls only for job completion, not stale cleanup.
…nses_cost_tests

[Fix] Update check_responses_cost tests for _expire_stale_rows
[Test] UI - E2E: Add Playwright tests with local PostgreSQL
The .npmrc file (ignore-scripts=true, min-release-age=3d) is temporarily
removed during the Docker build since lifecycle scripts are needed by
npm ci. However, the unconditional `mv` fails when the build context
doesn't include .npmrc (e.g. when LiteLLM is vendored in a subdirectory).

Make all .npmrc mv operations conditional. This is safe because npm ci
already installs from package-lock.json with pinned versions and
integrity hashes.
…erfile

[Fix] Dockerfile.non_root: handle missing .npmrc gracefully
Allow JWT tokens matching routing_overrides to use OAuth2 introspection without enabling global OAuth2 while keeping OAuth2 routing limited to LLM/info routes. Add regression coverage for management-route boundary and tighten opaque-token assertions; update docs to reflect selective-mode route scope.

Made-with: Cursor
The /v2/key/info endpoint was missing response filtering that
the v1 /key/info endpoint already had. This aligns the two
endpoints so v2 applies the same per-key permission checks and
strips internal fields from the response. Also fixes the
key_aliases query path to resolve aliases before querying.
yuneng-berri and others added 19 commits April 11, 2026 13:31
…s_for_iam

added applyguardrail to inline iam
Team member permission /spend/logs for team-wide spend logs (UI + RBAC)
Restores Windows-style line endings to match main/origin main for this
file, removing the full-file noise diff from an accidental LF-only
normalization.

Made-with: Cursor
…import'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ssthrough

Fixes NameError when bedrock_proxy_route sets custom body on request.state.
Remove unused lazy-loader helper.

Made-with: Cursor
Avoid module-level cyclic import between llm_passthrough_endpoints and
pass_through_endpoints; CodeQL and partial init order no longer risk
undefined LITELLM_PASS_THROUGH_CUSTOM_BODY_STATE_KEY.

Made-with: Cursor
…tenttype

fix(proxy): pass-through multipart uploads and Bedrock JSON body
…g_04_11_2026

Litellm internal staging 04 11 2026
…xists

Per-user OAuth MCP requests now only skip pre-emptive 401 when a stored token is available, preserving token-reuse behavior while restoring fast PKCE kickoff for first-time or missing-token users.

Made-with: Cursor
Automatic sync from upstream BerriAI/litellm tag v1.83.7-stable

Strategy: Merge with history preservation (main syncs to stable tag)
@github-actions

Copy link
Copy Markdown

No description provided.

@Cartofante

Copy link
Copy Markdown
Collaborator Author

🤖 Conflict Resolution Started

Status: ⏳ In progress...

Claude Code (Opus 4.5) is resolving merge conflicts in this PR.

Step Status
🔍 Analyze conflicts In progress
✏️ Resolve files Pending
🧪 Run tests Pending
📌 Push to PR Pending

Note

This may take 30-90 minutes for large PRs. Resolution commits will be pushed directly to this PR.

📋 Resolution Process (click to expand)
  1. 🔍 Analyzing conflicts in all files
  2. 📋 Reading CARTO customization guidelines
  3. ⚖️ Applying resolution priorities (CARTO first, then upstream)
  4. ✏️ Resolving conflicts file by file
  5. 🧪 Running tests (lint, mypy, unit tests)
  6. 📌 Pushing resolution directly to this PR

View workflow run →

Conflicts resolved by Claude Code following CARTO priority rules.

Resolution strategy:
- Preserved CARTO customizations (workflows, docs, infrastructure)
- Accepted upstream improvements (core litellm, tests, dependencies)
- Manually merged mixed files (Dockerfile, Makefile)

This is a MERGE COMMIT with both main and carto/main as parents,
preserving full git history from upstream.

Resolves: #105
@Cartofante

Copy link
Copy Markdown
Collaborator Author

✅ Conflict Resolution Complete

All conflicts resolved and pushed to this PR.

Step Status
🔍 Analyze conflicts ✅ Complete
✏️ Resolve files ✅ Complete
🧪 Verify resolution ✅ Complete
📌 Push to PR ✅ Complete

Important

Ready to merge! Use "Create a merge commit" — do NOT squash or rebase.


CARTO Customization Decisions

Summary

Decision Count
Upstream Substitutes 0
Preserved CARTO 0
Merged/Customized 1
Synced (required) 0

Merged/Customized

Files where both sources were combined:

  • litellm/responses/litellm_completion_transformation/streaming_iterator.py - Accepted upstream's new handling for _ensure_output_item_for_chunk, provider-specific fields, and snapshot mechanism in sync __next__ method. CARTO features (_handle_tool_call_delta, _store_session_in_redis) are in other parts of the file and preserved intact.

Why Upstream Code Was Chosen for Conflict Section

The conflict was in a specific code path in the sync __next__ method:

  • Upstream (HEAD): Added new methods for _ensure_output_item_for_chunk(), _merge_provider_specific_fields(), and _snapshot_chunk_for_stream_chunk_builder()
  • CARTO: Had a simpler self.collected_chat_completion_chunks.append(chunk) line

The upstream version was chosen because:

  1. The methods it calls already exist elsewhere in the file (they were added by upstream)
  2. These provide better streaming event handling and provider-specific field support
  3. CARTO-specific features (_handle_tool_call_delta at line 589, _store_session_in_redis at line 779) are in completely separate methods and are unaffected

CARTO Features Verification

All patterns from .github/carto-features.yml verified present:

  • _handle_tool_call_delta in streaming_iterator.py (line 589)
  • _store_session_in_redis in streaming_iterator.py (line 779)
  • ✅ All other CARTO feature patterns verified

Fix Loop Interventions

  • None

Next Steps

  1. Review the CARTO customization decisions above
  2. Merge using "Create a merge commit"
  3. 🎉 Upstream sync complete!
🔧 Workflow Details (click to expand)

Workflow Run: https://github.com/CartoDB/litellm/actions/runs/24995558989

@Cartofante

Copy link
Copy Markdown
Collaborator Author

Caution

⚠️ Merge Method Reminder

Use "Create a merge commit" — Click the dropdown arrow next to merge button.

❌ Do NOT use "Squash and merge" or "Rebase and merge"

Squashing destroys upstream history and breaks future syncs (see PR #26).

@Cartofante

Copy link
Copy Markdown
Collaborator Author

📊 CARTO Feature Analysis Started

Mode: Analysis + Auto-fix if issues found

Analyzing how each CARTO customization was handled during conflict resolution.
This will explain WHY each decision was made.

Step Status
Extract CARTO PRs ⏳ In progress
Compare code versions ⏳ Pending
Analyze decisions ⏳ Pending
Generate report ⏳ Pending

View workflow →

@Cartofante

Copy link
Copy Markdown
Collaborator Author

✅ CARTO Feature Analysis Complete

Decision Count
Upstream Substitutes 3
Customized Upstream 3
Preserved CARTO 13
Incorrectly Dropped 0

Overall Assessment: PASS

📋 Full details in PR description above.


View workflow run → | Download analysis artifacts →

@mateo-di mateo-di closed this May 19, 2026
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.