mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
Include request_id in _handle_error_response of TongyiLargeLanguageModel for better error traceability #766
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @scdeng on GitHub (Oct 30, 2025).
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
Currently, the _handle_error_response function does not have any parameter or logic to include the request_id from the originating request/response. This makes it harder to trace the exact request that caused the error when reviewing logs or diagnosing API issues.
For example, in the calling code:
The response to object (GenerationResponse which is import from from dashscope.api_entities.dashscope_response) has a request_id field, but it is not passed to _handle_error_response.
Proposed Enhancement
Add a new optional request_id parameter to _handle_error_response and append it to the error message when present. This will allow developers/operators to quickly find the problematic request in logs or tracing systems.
Example usage:
python
Inside _handle_error_response:
python
error_msg = f"[Request ID: {request_id}] " + error_msg if request_id else error_msgBenefits
Easier debugging and log correlation
Minimal impact on existing code (parameter is optional)
Aligns with general observability best practices
2. Additional context or comments
No response
3. Can you help us with this feature?
@dosubot[bot] commented on GitHub (Nov 15, 2025):
Hi, @scdeng. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.
Issue Summary:
_handle_error_responsefunction inTongyiLargeLanguageModelby adding an optionalrequest_idparameter to improve error message traceability.Next Steps:
Thank you for your understanding and contribution!
@scdeng commented on GitHub (Dec 8, 2025):
Hi @dosubot,
Thanks for the follow-up and for keeping the backlog organized.
Yes, this enhancement is still relevant. I’m currently preparing the code changes to add the optional request_id parameter to the _handle_error_response function in TongyiLargeLanguageModel to improve error traceability.
I’m happy to contribute the implementation and will submit a PR once it’s ready.
Since the issue has not yet been resolved, could you please reopen it so we can track progress and link the upcoming PR?
Thank you!
@dosubot[bot] commented on GitHub (Dec 8, 2025):
@crazywoola The user scdeng has indicated that the enhancement to add an optional request_id parameter to the _handle_error_response function in TongyiLargeLanguageModel is still relevant and they are preparing a PR for it. Could you please reopen the issue to track progress and link the upcoming PR?
@dosubot[bot] commented on GitHub (Dec 8, 2025):
Hi @scdeng! I'm Dosu and I’m helping the dify-official-plugins team.
Thanks for confirming the enhancement is still needed and for preparing the PR! Issue reopening is usually handled by maintainers, but you can reference the original issue in your PR description to keep everything linked and traceable.
Your approach—adding an optional request_id parameter to _handle_error_response and including it in error messages—fits well with recent improvements to error handling in TongyiLargeLanguageModel, and there are no conflicting changes in the repo so far (see recent PR #1636).
When you submit your PR, include a clear description of the change and its benefits for error traceability. If you run into any questions or need help with the contribution process, let me know!
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other