You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: Argument `dict[str, JsonValue] | None` is not assignable to parameter `model_settings` with type `ModelSettings | None` in function `dify_agent.layers.dify_plugin.configs.DifyPluginLLMLayerConfig.__init__`
Error: Argument `dict[str, JsonValue] | None` is not assignable to parameter `model_settings` with type `ModelSettings | None` in function `dify_agent.layers.dify_plugin.configs.DifyPluginLLMLayerConfig.__init__`
Error: Argument `dict[str, bytes | str]` is not assignable to parameter `headers` with type `Mapping[str, str]` in function `dify_trace_sdk.egress.Egress.request`
Error: Expected a type form, got class attribute `list` of type `(self: Self@TriggerSubscriptionQueryService, *, tenant_id: str, account_id: str, provider_id: TriggerProviderID) -> list[TriggerProviderSubscriptionApiEntity]`
Note: falling back to `builtins.list` from an enclosing scope
The two model_settings errors share one helper: _agent_model_settings() returns dict[str, JsonValue] | None, and both request builders pass it to a field typed as ModelSettings | None. The typing fix belongs at that conversion boundary, preserving the existing stop_sequences and extra_body handling. [1][2][3][4]
The headers diagnostic appears to come from EgressRequestsSession.send(), which passes dict(request.headers) directly into Egress.request(). Given the reported bytes | str values, normalize byte values to strings at this boundary rather than widening the egress contract, which explicitly requires Mapping[str, str]. [5][6]
The list diagnostic matches TriggerSubscriptionQueryService.list() shadowing the built-in used in its annotations. Qualifying those annotations as builtins.list[...] would disambiguate them without renaming the service method. [7]
I haven’t run the type checker, so these are source-based locations and suggested fixes, not a verified patch.
I'll take this. The three diagnostics trace cleanly to the model_settings conversion boundary, the header normalization in EgressRequestsSession.send(), and the list method shadowing the builtin in TriggerSubscriptionQueryService. I'll fix all three and verify with the type checker before opening a PR.
Activity
asukaminato0721 commentedon Nov 19, 2026
#46765
dosubot commentedon Nov 19, 2026
These diagnostics point to three places:
model_settingserrors share one helper:_agent_model_settings()returnsdict[str, JsonValue] | None, and both request builders pass it to a field typed asModelSettings | None. The typing fix belongs at that conversion boundary, preserving the existingstop_sequencesandextra_bodyhandling. [1] [2] [3] [4]EgressRequestsSession.send(), which passesdict(request.headers)directly intoEgress.request(). Given the reportedbytes | strvalues, normalize byte values to strings at this boundary rather than widening the egress contract, which explicitly requiresMapping[str, str]. [5] [6]listdiagnostic matchesTriggerSubscriptionQueryService.list()shadowing the built-in used in its annotations. Qualifying those annotations asbuiltins.list[...]would disambiguate them without renaming the service method. [7]I haven’t run the type checker, so these are source-based locations and suggested fixes, not a verified patch.
To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
P-r-e-m-i-u-m commentedon Nov 19, 2026
I'll take this. The three diagnostics trace cleanly to the model_settings conversion boundary, the header normalization in EgressRequestsSession.send(), and the list method shadowing the builtin in TriggerSubscriptionQueryService. I'll fix all three and verify with the type checker before opening a PR.
fix(api): resolve remaining pyrefly diagnostics (langgenius#46769)
fix(api): build ModelSettings without a cast (langgenius#46769)