Skip to content

[Bug] Generated media history passes image metadata dicts as image URLs #6371

Description

@zhonggang666

Problem Description

The generated media nodes store image_list entries as dictionaries, but later replay the whole dictionary as the image_url.url string in history messages.

For example, image generation stores:

self.context['image_list'] = [{'file_id': path.split('/')[-1], 'url': path} for path in file_urls]

But history replay uses:

*[{'type': 'image_url', 'image_url': {'url': f'{file_url}'}} for file_url in image_list]

Since each file_url is a dict, f'{file_url}' becomes a string like "{'file_id': '...', 'url': './oss/file/...'}", not an actual image URL.

Code Locations

  • apps/application/flow/step_node/image_generate_step_node/impl/base_image_generate_node.py:74
  • apps/application/flow/step_node/image_generate_step_node/impl/base_image_generate_node.py:87
  • Same pattern also appears in:
    • apps/application/flow/step_node/image_to_video_step_node/impl/base_image_to_video_node.py:153
    • apps/application/flow/step_node/text_to_video_step_node/impl/base_text_to_video_node.py:130

Steps to Reproduce

  1. Create a workflow using an image generation node with dialogue_type not equal to WORKFLOW and dialogue_number > 0.
  2. Run the node once so it stores image_list in execution details.
  3. Run a follow-up turn that includes history.

Actual Result

The previous image is replayed to the model as an invalid URL string representation of a Python dict, for example:

{'file_id': '...', 'url': './oss/file/...'}

The model cannot fetch or interpret the previous image correctly.

Expected Result

History replay should pass the actual URL field, for example file_url.get('url'), or convert file_id to a valid accessible file URL/base64 payload as other multimodal nodes do.

Impact

Multi-turn image generation / image-to-video / text-to-video workflows can lose visual context from prior turns, causing follow-up prompts to behave as if the previous generated image was unavailable.

MaxKB Version

Current v2 branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions