Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed

- Keep incidental provider requests out of the CrewAI VCR cassettes so a
first-use model-metadata fetch cannot fail the recorded tests.
([#270](https://github.com/alibaba/loongsuite-python/pull/270))

## Version 0.9.0 (2026-09-07)

There are no changelog entries for this release.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os

import pytest

# litellm fetches its model cost map from raw.githubusercontent.com the first time
# it is used. Under ``record_mode=none`` that request has no recorded counterpart,
# so VCR reports "Can't overwrite existing cassette" and its method/host/path
# matchers fail against the recorded api.openai.com interactions. Loading the
# bundled copy keeps the suite offline; litellm documents the switch in
# ``litellm.litellm_core_utils.get_model_cost_map``.
os.environ.setdefault("LITELLM_LOCAL_MODEL_COST_MAP", "True")


def scrub_response_headers(response):
"""Clean up common sensitive response headers before recording."""
Expand Down Expand Up @@ -48,4 +58,15 @@ def vcr_config():
],
"before_record_response": scrub_response_headers,
"decode_compressed_response": True,
# Requests incidental to the code under test must not reach the
# cassettes, or they fail playback under ``record_mode=none``. The
# litellm package's own conftest ignores its telemetry hosts for the
# same reason.
"ignore_hosts": [
"raw.githubusercontent.com",
"us.i.posthog.com",
"app.posthog.com",
"api.litellm.ai",
"telemetry.crewai.com",
],
}
Loading