Skip to content

bug: propagate_types_to_choice=[] ignored — tool attachments still pushed to choice #551

Description

@VinShurik

QuickApps version

latest

What steps will reproduce the bug?

  1. Configure a dial-mcp tool pointing at a deployment that returns attachments, e.g.:
{
    "type": "dial-mcp",
    "deployment_id": "toolsets/public/document_vision__1.0.0",
    "attachment": {
        "propagate_types_to_choice": []
    }
}
  1. Trigger a tool call that returns an attachment whose MIME type is not in the (empty) allow-list.
  2. Observe the chat response / choice.

What is the expected behavior?

With propagate_types_to_choice set to [], no tool attachments should be pushed to the choice.
matches_type(type, []) in src/quickapp/common/utils.py returns False for every type, so
StagedBaseTool._run_in_stage_report_success (src/quickapp/common/staged_base_tool.py:316)
should not append any attachment to result.propagate_to_choice.

What do you see instead?

Tool message attachments are still pushed to the choice — the flag has no effect.

Additional information

The direct tool_call_result.propagate_to_choice path in staged_base_tool.py does appear to
honor the empty list correctly. The leak looks like it comes from a second path: attachments kept
in context for the orchestrator model (keep_in_context_types) get echoed back by the LLM in its
own assistant-message stream, and ChoiceUiSink._add_attachments
(src/quickapp/common/chat_completion_stream/choice_ui_stream_sink.py) currently adds every
attachment from that stream to the choice unconditionally, with no awareness of the tool's
propagate_types_to_choice config. This second path isn't gated by the attachment config at all.

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions