Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
N
nocode-gpu-stack
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • agently
  • nocode-gpu-stack
  • Merge requests
  • !3

Merged
Created Jul 02, 2026 by nico.kruger@nico.krugerContributor

litellm: capture & re-apply LiteLLM distro source patches; sync custom_callbacks.py

  • Overview 0
  • Commits 1
  • Changes 13

LiteLLM is pip-installed, but we depend on edits to its installed source files. Those are wiped on every install/upgrade, so this vendors them and re-applies them from the role after the pip step.

  • files/distro-patches/: 4 unified patches (pinned to litellm 1.89.2) + full/ reference copies + README explaining each:
    • proxy/anthropic_endpoints/endpoints.py — honour failure-hook rewrite on /v1/messages (enables the Claude Agent SDK context-window self-heal via custom_callbacks.py)
    • proxy/proxy_server.py — inject global success/failure_callback before schedule_acompletion
    • litellm_core_utils/litellm_logging.py — return ResponsesAPIResponse directly (chat_template_kwargs)
    • litellm_core_utils/streaming_handler.py — whitespace-only, captured for byte-exact match
  • tasks/apply-distro-patches.yml: idempotent apply (skip if already present, fail loudly on version drift), imported after the pip install task.
  • files/custom_callbacks.py: synced to the live host version — adds the context-window error rewrite (x-agent-context-error: anthropic gate) and the langfuse trace-linking header fix that had drifted out of the repo.
  • README: documents the distro-patch mechanism.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: agent/litellm-distro-patches-997c