fix(cohere): accept cohere 6.x and 7.x in the dependency check - #4409
fix(cohere): accept cohere 6.x and 7.x in the dependency check#4409Anai-Guo wants to merge 1 commit into
Conversation
|
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Cohere instrumentation dependency range now supports versions ChangesCohere dependency support
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
opentelemetry-instrumentation-coheredeclaresBaseInstrumentor.instrument()checks that against the installed distribution and, on a conflict, logs aDependencyConflictand returns without instrumenting anything. Cohere shipped6.0.0on 2026-04-08 and7.0.0on 2026-05-22, so anyone on a currentcoheregets:and then simply no spans — no exception, no warning at the call site.
The cap is not protecting anything real. Everything this instrumentation touches is unchanged in 7.x:
cohere.client.Clientstill subclassesBaseCohere, which still definesgenerate,chat,chat_streamandrerank— all fourWRAPPED_METHODStargets resolve.Generation.id/.generations[].text/.id,NonStreamedChatResponse.text/.response_id,RerankResponse.id/.results[].index/.relevance_score/.document.Change
One line:
<6→<8.Verification
Ran the package's own test suite against
cohere==7.0.8(everything else per thetestgroup), before and after the change:<6)IndexError: tuple index out of rangein every test, i.e. the exporter got zero spans, plusassert 0 == 1on the embed span counts<8)The recorded cassettes replay unchanged under 7.x, so the wire traffic for the v1
chat/generate/rerank/embedendpoints is identical too.Note on CI
I deliberately left the
testgroup pinned atcohere>=5.18.0,<6, so this PR does not touchuv.lockand CI keeps exercising the version it exercises today (where the change is a no-op). Happy to bump the test pin to<8in this PR if you'd rather have CI cover 7.x — as shown above the suite is already green there.🤖 Generated with Claude Code
Summary by CodeRabbit