Skip to content

some type err #46769

Open
Open

Description

@asukaminato0721
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

Activity

  1. asukaminato0721 commented on Nov 19, 2026

    @asukaminato0721
    ContributorAuthor
  2. dosubot commented on Nov 19, 2026

    @dosubot

    These diagnostics point to three places:

    • 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.

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about dify with Dosu

  3. P-r-e-m-i-u-m commented on Nov 19, 2026

    @P-r-e-m-i-u-m

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions