dify - 💡(How to fix) Fix dify_plugin - in AgentModelConfig.history_prompt_messages adding send time or id for ordering or identity [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langgenius/dify#35266Fetched 2026-04-16 07:06:44
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
1
Participants
Timeline (top)
labeled ×1

Code Example

self.session.storage.set(conversation_id, [msg1_extra, msg2_extra, msg3_extra, ...])
RAW_BUFFERClick to expand / collapse

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

i'm devoloping a strategy plugin, i will store extra information for certain history message, using

self.session.storage.set(conversation_id, [msg1_extra, msg2_extra, msg3_extra, ...])

but history message doesn't have id or datetime, i just have two irrelevance list

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.

extent analysis

TL;DR

Consider using a unique identifier or a combination of message attributes to create a key for storing extra information in the session storage.

Guidance

  • Review the structure of the conversation_id and msg_extra data to identify potential unique attributes that can be used as a key.
  • Explore alternative data structures, such as a dictionary or a custom object, to store the extra information for each message, allowing for easier identification and retrieval.
  • Investigate the possibility of adding a timestamp or a unique identifier to each message, enabling the creation of a unique key for storage.
  • Consider the implications of using a list to store extra information for multiple messages and how it may impact data retrieval and management.

Example

# Assuming a dictionary with message attributes
message_attributes = {
    'message_id': 'unique_id',
    'text': 'message_text',
    'extra_info': 'extra_data'
}

# Create a unique key using message attributes
key = f"{message_attributes['message_id']}_{message_attributes['text']}"
self.session.storage.set(key, message_attributes['extra_info'])

Notes

The provided code snippet is a hypothetical example and may require adjustments based on the actual data structure and requirements.

Recommendation

Apply workaround: Use a unique identifier or a combination of message attributes to create a key for storing extra information in the session storage, as this approach allows for more flexibility and easier data management.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING