dify - ✅(Solved) Fix remove_leading_symbols remove [ [1 pull requests, 1 comments, 2 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#34830Fetched 2026-04-10 03:45:52
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
1
Author
Assignees
Timeline (top)
assigned ×1closed ×1commented ×1cross-referenced ×1

Fix Action

Fixed

PR fix notes

PR #34832: fix: fix remove_leading_symbols remove [

Description (problem / solution / changelog)

[!IMPORTANT]

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

fix #34830

Screenshots

BeforeAfter
......

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint and make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

Changed files

  • api/core/tools/utils/text_processing_utils.py (modified, +14/-1)
  • api/tests/unit_tests/utils/test_text_processing.py (modified, +51/-1)
RAW_BUFFERClick to expand / collapse

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • 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.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.13.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. call function remove_leading_symbols
  2. it remove [, so [测试] will be 测试]

✔️ Expected Behavior

[测试] should be [测试]

❌ Actual Behavior

[测试] is 测试]

extent analysis

TL;DR

The issue can be fixed by modifying the remove_leading_symbols function to handle square brackets correctly.

Guidance

  • Review the implementation of the remove_leading_symbols function to identify why it is removing the opening square bracket.
  • Verify that the function is correctly handling Unicode characters, such as those in the string "[测试]".
  • Check if there are any existing tests for the remove_leading_symbols function and update them to cover this specific case.
  • Consider adding a special case to the function to preserve square brackets when they are part of a larger symbol or character sequence.

Example

No code snippet can be provided without more information about the implementation of the remove_leading_symbols function.

Notes

The issue seems to be related to the handling of specific characters in the remove_leading_symbols function. Without more information about the implementation, it is difficult to provide a more specific solution.

Recommendation

Apply a workaround by modifying the remove_leading_symbols function to correctly handle square brackets, as this is a specific bug that needs to be addressed.

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