Skip to content

fix(oci): 🐛 restore inline-PEM key normalization dropped during upstream sync [sc-553919] - #108

Merged
miguelangelmorenochacon merged 1 commit into
upstream-sync/v1.83.14-stablefrom
bug/sc-553919/oci-key-content-not-defined
Jun 2, 2026
Merged

fix(oci): 🐛 restore inline-PEM key normalization dropped during upstream sync [sc-553919]#108
miguelangelmorenochacon merged 1 commit into
upstream-sync/v1.83.14-stablefrom
bug/sc-553919/oci-key-content-not-defined

Conversation

@miguelangelmorenochacon

Copy link
Copy Markdown

Summary

The May 19 upstream-sync merge (PR #106, commit 03c53bc4b3) dropped the CARTO inline-PEM normalization block in litellm/llms/oci/chat/transformation.py but kept the upstream rename oci_keyoci_key_content in the private_key assignment. Net result: every OCI chat completion on this branch fails with NameError: name 'oci_key_content' is not defined at _sign_with_manual_credentials. Production (v1.83.3-carto.1.19.6) is unaffected because it predates the bad merge; ded-29 running this build is.

Root cause of the CI gap

.github/carto-features.yml is the manifest consumed by carto-features-check.yml to assert that critical CARTO patches survive each sync. The OCI Gemini tool-call feature (PR #68) was listed and the resolver restored it; the OCI inline-PEM feature (PR BerriAI#17159, 2905feb889) was not in the manifest, so the verifier had nothing to flag.

Changes

  • litellm/llms/oci/chat/transformation.py — re-apply the dropped block: define oci_key_content, normalize escaped \n / \r\n sequences, reject non-string oci_key with OCIError, and switch the missing-key path from bare Exception to OCIError (both behaviors from feat(oci): Enable Oracle Cloud Infrastructure configuration via UI BerriAI/litellm#17159).
  • .github/carto-features.yml — add OCI Inline PEM Key Normalization (source PR 17159) with two verification patterns so future syncs fail loud if this regresses.

Validation

tests/litellm/llms/oci/chat/test_oci_chat_transformation.py::TestOCIKeyNormalization — all 4 pass:

test_oci_key_with_escaped_newlines      PASSED
test_oci_key_with_crlf_newlines         PASSED
test_oci_key_rejects_non_string_type    PASSED
test_oci_key_rejects_list_type          PASSED

Manifest verifier locally — all 12 patterns OK (including the 2 new).

Story

sc-553919

…eam sync [sc-553919]

The May 19 upstream-sync merge (PR #106) kept the upstream rename
`oci_key` → `oci_key_content` in the `private_key` assignment but
dropped the CARTO block (from PR BerriAI#17159) that *defines*
`oci_key_content`, leaving an undefined-name reference that breaks
every OCI chat completion with `NameError: name 'oci_key_content' is
not defined`.

- transformation.py: re-apply the normalization block — define
  `oci_key_content`, replace escaped `\n`/`\r\n` sequences, reject
  non-string `oci_key` with `OCIError`, and use `OCIError` for the
  missing-key path (also from PR BerriAI#17159).
- carto-features.yml: add an `OCI Inline PEM Key Normalization` entry
  so the manifest verifier catches it if the block is dropped again on
  future syncs. Original feature was not tracked, which is why the
  resolver did not flag the regression.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@miguelangelmorenochacon
miguelangelmorenochacon marked this pull request as ready for review June 2, 2026 09:28
@miguelangelmorenochacon
miguelangelmorenochacon merged commit b781527 into upstream-sync/v1.83.14-stable Jun 2, 2026
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.

1 participant