[Multi-provider] Gaps identified relative to js-sdk reference implementation
維護者通常 1 天內回覆
評估
研究方向
從 #511 中的 Python MultiProvider 實作開始,檢查其事件處理、get_provider_hooks()、FirstMatchStrategy 以及 run_mode 的求值路徑。將每個差距與所連結的 js-sdk、go-sdk 和 dotnet-sdk 參考進行比較。完成的標準是實作並測試所指定的狀態、hook、策略、比較和並行求值行為,同時將追蹤留待 #374 之後處理。
由索引模型根據 Issue 內容生成。
描述
Context
We conducted a cross-SDK comparison of all MultiProvider implementations using the js-sdk as the reference. The Python MultiProvider was implemented in #511 and is functional for basic use cases, but we identified several gaps relative to the reference implementation. Some of these were noted as future work in the original PR.
Note: Tracking forwarding is blocked by SDK-level tracking support (#374).
Gaps
1. Event aggregation and status tracking (High)
The MultiProvider passes child provider events through directly via attach/detach with no aggregation. If one child emits PROVIDER_ERROR while another is READY, both events propagate independently. There is no composite status, so consumers cannot determine the overall health of the MultiProvider.
Expected behavior:
- Maintain a per-provider status map
- Compute an aggregate status using "worst-wins" precedence:
FATAL > NOT_READY > ERROR > STALE > READY - Only emit an event when the aggregate status actually changes (deduplication)
- Always forward
PROVIDER_CONFIGURATION_CHANGEDevents as a pass-through
Reference: js-sdk status-tracker.ts, dotnet-sdk HandleProviderEventAsync / DetermineAggregateStatus
2. Per-provider hook isolation during evaluation (High)
Hooks are aggregated into a flat list via get_provider_hooks(), meaning ALL child provider hooks run for ALL evaluations regardless of which provider actually evaluated the flag. The js-sdk reference runs each provider's hooks only during that provider's evaluation, with an isolated context copy to prevent cross-provider mutation.
Expected behavior:
- Run each child provider's hooks only when that specific provider is being evaluated
- Isolate hook context per-provider to prevent cross-provider mutation
- Execute the full before/after/error/finally lifecycle per-provider
Reference: js-sdk hook-executor.ts, go-sdk isolation.go, dotnet-sdk ProviderExtensions.EvaluateAsync
3. FirstMatchStrategy semantics (Medium)
The current FirstMatchStrategy.should_use_result() accepts any result where reason != Reason.ERROR. It does not distinguish FLAG_NOT_FOUND from other error types. The js-sdk reference treats FLAG_NOT_FOUND as "skip to next provider" but halts on any other error.
Expected behavior:
FLAG_NOT_FOUNDshould cause fallthrough to the next provider- Any other error (e.g.
PARSE_ERROR,GENERAL) should halt evaluation and surface that error - A successful result should be returned immediately
Reference: js-sdk strategies/first-match-strategy.ts
4. Add FirstSuccessfulStrategy (Medium)
Only FirstMatchStrategy exists. There is no FirstSuccessfulStrategy, which is more resilient by skipping all errors (including non-FLAG_NOT_FOUND errors) and continuing to the next provider.
Expected behavior:
- Return the first completely successful result (no error at all)
- Skip any provider that returns an error or throws, regardless of error type
- If all providers fail, collect and report all errors
Reference: js-sdk strategies/first-successful-strategy.ts
5. Add ComparisonStrategy (Medium)
There is no ComparisonStrategy for evaluating all providers and comparing results (useful for migration validation and consistency checks).
Expected behavior:
- Evaluate all providers (ideally in parallel)
- If all providers agree on the value, return it
- If providers disagree, call an optional
onMismatchcallback and return the designated fallback provider's result - If any provider errors, collect and report all errors
- Constructor accepts a
fallbackProviderand optionalonMismatchcallback
Reference: js-sdk comparison-strategy.ts, go-sdk comparison_strategy.go, dotnet-sdk ComparisonStrategy.cs
6. True parallel evaluation (Low)
The run_mode="parallel" option currently executes providers sequentially in a for-loop despite the name. The only difference from "sequential" is the lack of early exit. The docstring acknowledges this as a planned future enhancement.
Expected behavior:
- When
run_mode="parallel", evaluate all providers concurrently (e.g. viaasyncio.gatherorThreadPoolExecutor) - Collect all results, then let the strategy determine the final result
Reference: js-sdk parallel evaluation in flagResolutionProxy
Blocked / Deferred
- Tracking forwarding: Requires SDK-level tracking support first (#374)
Related Issues
- #511 — Original multi-provider implementation
- #374 — Implement tracking in Python
Spec Reference
https://openfeature.dev/specification/appendix-a/#multi-provider
- 主要語言
- Python
- 星號
- 112
- 分支
- 46
- 平均合併
- 22 小時 52 分鐘
- 30 天內合併 PR
- 22
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
open-feature/python-sdk 的其他 Issue
-
[BUG] before hooks do not receive the evaluation context returned by earlier before hooks可能已有人在做 @Ritinpaul 於 11 天前認領。 未關閉bug
難度 3/5 1-2 天 新手友好度 78/100
open-feature/python-sdk#628 ·
維護者通常 1 天內回覆
-
question
難度 4/5 3-5 天 新手友好度 38/100
open-feature/python-sdk#627 ·
維護者通常 1 天內回覆
-
v0.9.0
難度 5/5 一週以上 新手友好度 25/100
open-feature/python-sdk#618 ·
維護者通常 1 天內回覆
-
Supply the bound domain to provider initialization可能已有人在做 @jonathannorris 於 107 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 55/100
open-feature/python-sdk#615 ·
維護者通常 1 天內回覆
-
Support isolated API instances可能已有人在做 @marcozabel 於 178 天前認領。 未關閉
open-feature/python-sdk#584 · 已指派 1 人 ·
維護者通常 1 天內回覆
查看 open-feature/python-sdk 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
sierra-research/tau2-bench#635 ·
維護者通常 1 天內回覆
-
The add-ssm-model skill requires a Cython simulator; the contributing guide allows Python ones可能已有人在做 @fmuia 今天認領。 未關閉documentation skill
難度 2/5 1-3 小時 新手友好度 83/100
lnccbrown/ssm-simulators#406 ·
維護者通常 4 天內回覆
-
難度 1/5 1 小時以內 新手友好度 95/100
btclib-org/btclib-ecc#309 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 68/100
jbacalso24/mimry#459 · 1 則留言 ·
維護者通常 1 天內回覆
-
auth bug high-priority
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆