Skip to content

build: validate KubeTEE overlay on upstream 1.108.9 - #7

Merged
pamanseau merged 281 commits into
kubetee-prodfrom
feat/upstream-1.108.9-kubetee
Nov 16, 2026
Merged

pamanseau merged 281 commits into
kubetee-prodfrom
feat/upstream-1.108.9-kubetee

Conversation

@pamanseau

@pamanseau pamanseau commented Nov 16, 2026 •

Copy link
Copy Markdown

Scope

Replays only the current KubeTEE overlay and its focused CI regressions directly on upstream v1.108.9 (82ae95fa3d7194df7178e9f06e1c497e37611a07). It retains the measured attestation, binding, east-west TLS, route guard, MCP trust, GLM-effort, health-query, bootstrap, and site customization modules and their tests.

This is a source-only release candidate. Do not treat it as an image release or deployment: no merge, image publication, gateway release, or cluster action was performed by this task.

Base and CI

  • Pins ghcr.io/berriai/litellm-database@sha256:9839e334bbeda191491b2709f4bb4a785ce668d545f8bd510884cec2711b0571, the verified multi-architecture v1.108.9 base.
  • Uses BerriAI's Cosign key pinned to e82a3c646908ba0a6ee0beddc4310d7a6cac4065.
  • Retains the auto-incremented 1.108.9-kubetee.N tag logic; this PR does not create or claim 1.108.9-kubetee.1 as published.
  • Hardens checkout credentials and keeps CI-only PR builds separate from production publishing.
  • Verifies all 2,881 litellm/ Python sources against the packaged base byte-for-byte; all match.
  • v1.108.3..v1.108.9 has zero changes to schema.prisma, litellm/proxy/schema.prisma, or litellm-proxy-extras/litellm_proxy_extras/schema.prisma; no SQL migration change, only the Wolfi digest in migrations/Dockerfile.
  • Retains kubetee_health_latest.py: upstream still ranks health records model-id first, not newest per public model name. kubetee_pricing.py stays retired.

The direct upstream comparison is 22 files, +3,284/-2, with nearly all content in the minimal overlay and its tests:
v1.108.9...feat/upstream-1.108.9-kubetee

Actual-source regression coverage

The workflow runs existing upstream tests inside the pinned v1.108.9 base container, using a Linux-compatible dependency target from the frozen lockfile:

  • GHSA-2rwg-2wh4-7c4f: Azure Entra request-credential injection, including the remote branch's three-route coverage.
  • #51120: budget-reset job and atomic unit-of-work spend reset.
  • #47429: Bedrock passthrough guardrail preservation.
  • #48490: team-wildcard BYOK precedence.
  • #51503: canonical provider file IDs.
  • KubeTEE overlay tests plus a non-buffering ToolPermissionGuardrail streaming regression when default_on=False.

Local validation

  • Credential/routing/overlay/streaming group: 105 passed, 751 deselected.
  • Bedrock/files/BYOK/budget-reset group: 281 passed.
  • Ruff, Python compilation, workflow YAML and git diff --check: passed.
  • Local Docker --load overlay build: succeeded as kubetee-litellm-candidate:1.108.9-kubetee.1-local, with offline module imports verified. This is not a published multi-architecture release artifact.
  • Two pre-existing upstream regex SyntaxWarnings in tests/unit/proxy/auth/test_auth_utils.py outside this diff remain.

Review notes

  • The remote feature branch already contained four commits from closed #5. This push preserves them via a merge commit, then replays the clean upstream-based overlay; no force-push was used.
  • #6 was merged separately at c1f8d86bd92b21b126ab769c3799c798e3815f44 while this source candidate was being finalized. It contains a 417-file partial pre-1.108.9 source delta outside the overlay. Commit 37e7c1a8a2c6f00727838e8d24aae7f523fcec16 performs an explicit forward merge of that base and retains it in history, while selecting the fully validated upstream v1.108.9 tree as the result. No merge into kubetee-prod or history rewrite was performed. Review the commit rationale and complete upstream source parity, not just the historical remote commit sequence.
  • GitHub CI passed at 1ca30c5116aa2cd65c4b5b635c9712487ea1c7aa: candidate build. It independently confirms source parity, 105 passed / 751 deselected then 281 passed, BerriAI Cosign signature verification, native aiohttp transport, overlay imports and build, and the Trivy actionable HIGH/CRITICAL gate.
  • The GitHub artifact is the non-published PR-only pr-7-validation candidate; release publication and digest-signing steps correctly stayed skipped. A future merge must still create a new auto-incremented 1.108.9-kubetee.N immutable artifact. Deployment, measured Fleet policy/initdata pinning, and live gateway tests remain outside this task.

Made with Cursor

mateo-berri and others added 30 commits November 6, 2026 18:16
The retry warning keeps provider, model, status, and error code, and leaves the ciphertext out.

Backport of the third BerriAI#49076 commit to lts/1.108.x. Cherry-picked from c62c92d.

Co-authored-by: DDT <141296842+Hugo-DDT@users.noreply.github.com>
…error chain

Backport of BerriAI#49183 to lts/1.108.x.
Cherry-picked from 0f7003a (fix-ollama-chat-stream-tool-call-index).
The backported Responses bridge tags each reasoning item's thinking block with its output index, but this line's Anthropic stream wrapper only opened a new block when the block type changed, so a second reasoning item of the same type was dropped. This ports the index check from BerriAI#46863, which main already has.
…rt_bedrock_converse_s3_sources_lts_1_108_x

# Conflicts:
#	litellm/responses/litellm_completion_transformation/transformation.py
#	tests/unit/llms/bedrock/files/test_bedrock_files_transformation.py
A summary delta carries no item index, so the next item's summary joined the block that already got its signature. A thinking chunk after an indexed signature now opens a new block.
…e logging is off

Backport of BerriAI#49183 to lts/1.108.x.
Cherry-picked from 5ef6d62 (fix-ollama-chat-stream-tool-call-index).
Adapted to the line. The repair warning lives in common_utils.py here.
… keep xAI web search reasoning, and retry only when the sent request carried it
…ted reasoning a backend rejects

The openai/ Responses path on /v1/messages had no retry, so a chatgpt/ block left in history answered 400 on every later openai/ turn. That path now sends the turn once more without encrypted reasoning, the same way the chat bridge does. The retry matches only invalid_encrypted_content or a "could not be verified" message naming the content, so the exception mapper's own hint no longer triggers it. The xAI web search keep path is backed out, since xAI sends no encrypted reasoning over the bridge.

Backport of 15e6017 from BerriAI#49076 to lts/1.108.x, ported by hand onto the pass_through modules.

Co-authored-by: DDT <141296842+Hugo-DDT@users.noreply.github.com>
Backport of BerriAI#49183 to lts/1.108.x.
Cherry-picked from 1f71ed3 (fix-ollama-chat-stream-tool-call-index).
Adapted to the line. The repair warning tests live in test_litellm_core_utils_prompt_templates_common_utils.py here.
…1.108.x

The picks touch tests/unit/test_utils.py, so ruff now checks it, and
the line's model info schema lists supports_bedrock_native_structured_output
twice with the same value. The second copy goes
… flatten it for the Responses bridge (BerriAI#49043)

Backport of BerriAI#49043 to lts/1.108.x.
Cherry-picked from 28c8004 (main). Import conflicts in the Responses bridge and the Azure chat config resolved to the line's imports plus the helper import.

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…t on chat completions

Backport of BerriAI#50467 to lts/1.108.x.
Cherry-picked from e56c060 (litellm_allowed_tools_flat_tool_choice).
…refuse conflicting flat entries

Backport of BerriAI#50467 to lts/1.108.x.
Cherry-picked from 361aeca (litellm_allowed_tools_flat_tool_choice). Azure chat config import conflict resolved to the line's imports.
…to after a drop

Backport of BerriAI#50467 to lts/1.108.x.
Cherry-picked from 5f8f54a (litellm_allowed_tools_flat_tool_choice). Conflicts resolved by applying this commit's hunks to the line's simpler Responses bridge handler and responses() bridge branch, and appending its new tests to the line's test files.
Backport of BerriAI#50467 to lts/1.108.x.
Cherry-picked from e25a82c (litellm_allowed_tools_flat_tool_choice). Conflicts resolved by applying this commit's hunks to the line's code. Test hunks that need main-only test helpers are carried by the line's test adaptation commit.
…ded MCP call back unrun

Backport of BerriAI#50467 to lts/1.108.x.
Cherry-picked from be0bb7a (litellm_allowed_tools_flat_tool_choice). Conflicts resolved by applying this commit's hunks to the line's MCP handlers and responses(). Test hunks that need main-only test helpers are carried by the line's test adaptation commit.
…tring

Backport of BerriAI#50467 to lts/1.108.x.
Cherry-picked from 2ac020c (litellm_allowed_tools_flat_tool_choice). Test hunks that need main-only test helpers are carried by the line's test adaptation commit.
…op hooks running excluded calls

Backport of BerriAI#50467 to lts/1.108.x.
Cherry-picked from 939034d (litellm_allowed_tools_flat_tool_choice). Resolved: tool_precheck.py is not on the line, so server_labels_serving lives in litellm_proxy_mcp_handler.py. The line has no refused-turn path, so a hook turn holding a call the choice excludes answers 400 through refuse_tool_calls_the_choice_excludes. Test hunks that need main-only fixtures move to the line test commit.
…lt-in entries allow their interception call

Backport of BerriAI#50467 to lts/1.108.x.
Cherry-picked from 4755727 (litellm_allowed_tools_flat_tool_choice). Resolved: kept only this pick's helper and import where the line lacks main's sandbox result types and core_helpers import. Test hunks that need main-only fixtures move to the line test commit.
…in the interception hooks

Backport of BerriAI#50467 to lts/1.108.x.
Cherry-picked from cd076fb (litellm_allowed_tools_flat_tool_choice).
…hoice on every hook path

Backport of BerriAI#50467 to lts/1.108.x.
Cherry-picked from 6be4f0b (litellm_allowed_tools_flat_tool_choice). Resolved: the line has no tool_precheck.py or agentic_loop_refusal.py, so the MCP label resolver lives in litellm_proxy_mcp_handler.py and mirrors the line's own toolset resolution (admin view and granted toolsets, no access-group fallback), and the line's toolset listing now calls the same resolver. A chat hook turn holding a call the choice excludes answers 400 through the line's AgenticLoopSafetyError path. Main-only code in the conflicted hunks (internal_sub_call, first-round billing, Claude Code web search prefix) is left out. Test hunks that need main-only fixtures move to the line test commit.
…orcing another call

Backport of BerriAI#50467 to lts/1.108.x.
Cherry-picked from 478fb95 (litellm_allowed_tools_flat_tool_choice). Resolved: test imports merged with the line's, and the tests that need main's web search fixtures move to the line test commit.
… excludes

The line's OpenAI chat handler runs its own agentic hook loop instead of
the shared one main uses, so the picked exclusion check never reached
it. This checks the response before a hook runs, like the line's HTTP
handler already does after the picks, and answers 400 when the model
called a tool the choice leaves out. Chat calls with an allowed_tools
choice answer 400 on the line today, so no call that succeeds changes.
The picked test files reach a few names the line does not have, so this
ports them to the line's code without bringing those features over.
The MCP response tests stub the line's own proxy_server imports, the
web search tests get main's perplexity_search fixture, and the chat and
Responses hook tests expect what the line does. An excluded chat hook
call answers 400, and native /v1/responses hooks run as before since
the line cannot end a Responses turn early
…nother call

Backport of BerriAI#50467 to lts/1.108.x.
Cherry-picked from 08eb785 (litellm_allowed_tools_flat_tool_choice). Resolved: adds main's _WEB_SEARCH_FUNCTION_CALL test constant, which came with BerriAI#38885 and is not on the line, and wraps one long test line.
…/1.108.x

On the line, native /v1/responses with gateway MCP tools passes any
tool_choice through to the provider, with or without drop_params, and
providers that accept a malformed allowed_tools choice answer 200. The
picks answer 400 for it without drop_params and drop it under
drop_params, so this keeps the line's behavior. The choice reaches the
provider unchanged and the gateway enforces nothing for it, while a
choice that parses still gets the picked rewrite and enforcement
…ed tool choice on lts/1.108.x

On the line, a tool_choice of type allowed_tools that also carries a
function passes validation and reaches the provider as a named function
choice, so Anthropic and other providers that read function.name force
that tool and answer 200. The picks treat it as a malformed allowed_tools
choice, which answers 400 without drop_params and drops the choice with
it. This keeps the line's behavior, so such a choice is not read as an
allowed_tools choice anywhere and goes on as the named choice it was
…ollow-up calls on lts/1.108.x

On main the agentic follow-up keeps the caller's allowed_tools choice
under a reserved kwarg that main lists among its loop control keys.
That list does not exist on the line, so the line's acompletion dropped
the key and a follow-up call could run a hook call the caller's choice
leaves out. acompletion now passes the key on when the caller sent it or
sent an allowed_tools choice, and leaves every other call as it was
… on lts/1.108.x

The line types the hook loop's kwargs and optional_params as plain
dicts, so passing them to the picked refusal helpers added unknown
argument errors that main does not have. They are now cast to
Mapping[str, object] at the call sites, and the loop settings reader
takes a Mapping

The new cast import in the agentic loop would grow the banned-API
count, so the duplicate function-level cast import in
llm_http_handler.py goes, since the module already imports cast
mateo-berri and others added 29 commits November 14, 2026 01:38
…ne off a doubled /openai/responses path

o-series chat on a Foundry project /openai/v1 base, or with api_version none, now builds the v1 OpenAI client
the same way as the other chat paths, so it sends no api-version. With api_version none, an api_base that ends
in /openai/responses no longer becomes /openai/responses/openai/v1/responses

(cherry picked from commit 547044d)
… goes to input on the bridge

A message-level cache_control on the first of two leading string system
messages sent that message to input as a breakpoint-carrying part, while
the unmarked second one still joined instructions. The Responses API reads
instructions before input, so the model saw the second message first and
followed the first one instead

The leading run that may join instructions now stops at the first message
that is not a system message with string content. A list-content system
message ends the run the same way, so the system messages after it keep
their place in input

Port of the matching change on BerriAI#51783 to lts/1.108.x
…reasoning_effort_lts_1_108_x

fix(azure_ai): send reasoning_effort to Foundry Kimi K3 and keep its reasoning_content on lts/1.108.x
…_identity_labels_lts_1_108_x

feat(vertex_ai): backport caller identity labels on Vertex requests to lts/1.108.x
… test async and streaming chat on v1 bases

(cherry picked from commit f701738)
…y were on the bridge

Bedrock Mantle already caches the growing prefix on its own, so turning
cache_control into breakpoints there added write charges. The client-order
rule for leading system messages now applies only when a mark turns a system
string into a list, so unmarked chats send the same request as before.

(cherry picked from commit 74cb624, adapted to this line's converter)
…t test

A cache_control mark on the user message must not switch unmarked leading
system messages to the client-order rule. The split test now runs with the
user turn plain and marked, so dropping the role check from the system
string test fails it.

(cherry picked from commit 6419de8)
…penai

Chat and embeddings under api_version none, and chat under api_version v1, built /openai/openai/v1 from an api_base ending in /openai, while Responses on the same base already built /openai/v1. The v1 client now joins the route the same overlap-aware way

(cherry picked from commit 7990576)
…ient base

Join openai/v1 by string instead of add_path_to_api_base, which decodes %2F, %25, %3F and %23 in the base path. Type the chat test helper's mode as a Literal with assert_never.

(cherry picked from commit 075dee0)
…tests load on Python 3.10

typing.assert_never needs Python 3.11, and the package supports 3.10

(cherry picked from commit c9ed2cb)
…s_bridge_cache_control_breakpoints

fix(responses): backport cache_control breakpoints on the chat-to-Responses bridge to lts/1.108.x
…responses_project_v1_api_version_lts_1_108_x

fix(azure): backport Foundry project and resource /openai/v1 Responses bases to lts/1.108.x
…ine image test

Adapted from b03d4db: the line's test file also gains the AsyncOnlyImageFetch import
…42_lts_1_108_x

feat(decisions): backport Vercel AI Gateway decision models to lts/1.108.x (BerriAI#50642)
…k_vs_filters_lts_1_108_x

fix(bedrock): backport OpenAI vector store search filter mapping to lts/1.108.x
litellm 1.108.8 already shipped, so the next release off this line is 1.108.9
…-> 2.10 and 4.1 on lts/1.108.x

Follows main's BerriAI#51712 and BerriAI#51585. The opentelemetry pins move to 1.45.2 and 0.66b2, the dnspython and tornado floors on Python 3.11+ move to the fixed versions, and soupsieve resolves 4.1 on Python 3.11.5+ and 2.10 below it. The ignore list gains the advisories that have no fix on Python 3.10 or below 3.11.5, with the same expiry as the other 3.10 entries on this line.
….108.x

Same digest main moved to in BerriAI#51550. It ships glibc 2.44-r17, where the old digest stays on 2.44-r9 because apk upgrade finds nothing newer for it.
chore: bump litellm to 1.108.9 on lts/1.108.x
Pin the verified upstream v1.108.3 digest, remove retired video/image pricing callbacks while preserving the video route guard, and add signed reproducible CI evidence with native transport and regression tests.
Pin the cosign-verified v1.108.9 upstream image in the release workflow. Verify the GHSA-2rwg-2wh4-7c4f fix across the relevant request routes and exercise read-replica routing in the base image.

Signed-off-by: Pierre A Manseau <pierre@kubetee.ai>
Co-authored-by: Cursor <cursoragent@cursor.com>
Pin the verified litellm-database v1.108.9 multi-arch base and BerriAI Cosign key while retaining the minimal KubeTEE runtime overlay and its regression tests.

Run credential-injection, spend-reset, Bedrock passthrough, team wildcard BYOK, canonical file ID, and non-buffering guardrail tests against the verified upstream base.
Retain the remote branch's route coverage on top of the validated upstream source.
Preserve the existing remote commits while keeping the clean v1.108.9 replay and validated CI as the resulting source tree.
Retain the measured 1.108.9 workflow from the merged production branch in history while using the fully validated upstream v1.108.9 tree as the resulting source. The merged branch carried a partial pre-1.108.9 source delta outside the overlay.
Use the pinned uv container binary for dependency export as well as the Linux-compatible base-container installation.
@pamanseau
pamanseau merged commit 50a80a8 into kubetee-prod Nov 16, 2026
3 checks passed
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.