refactor(langfuse/chatapp):#380
Merged
Merged
Conversation
desmonna
commented
May 14, 2026
Contributor
- Fix 1: _patched_log function signature mismatch
- Location: plugins-langfuse_tracing.py
- Problem: monkey-patch function only accepts 2 parameters, but the original function has 3 parameters (including the default parameter log_path)
- Fix: add log_path=None parameter and pass it to the original function
- Fix 2: Agentmain module import failure
- Location: frontends-chatapp_common.py
- Problem: frontends directory cannot be imported into the agentmain of the upper directory
- Fix: Add the parent directory to sys.path at the beginning of the file
- Fix 1: _patched_log function signature mismatch - Location: plugins-langfuse_tracing.py - Problem: monkey-patch function only accepts 2 parameters, but the original function has 3 parameters (including the default parameter log_path) - Fix: add log_path=None parameter and pass it to the original function - Fix 2: Agentmain module import failure - Location: frontends-chatapp_common.py - Problem: frontends directory cannot be imported into the agentmain of the upper directory - Fix: Add the parent directory to sys.path at the beginning of the file
There was a problem hiding this comment.
Pull request overview
This PR refactors small import/logging compatibility issues in the Langfuse plugin and shared chat frontend utilities.
Changes:
- Updates Langfuse
_write_llm_logmonkey patch to accept and forwardlog_path. - Adds project-root path setup in
chatapp_common.pybefore root-level imports.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
plugins/langfuse_tracing.py |
Aligns patched log function with the core logging signature. |
frontends/chatapp_common.py |
Adds parent-directory insertion to sys.path for shared frontend imports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3
to
+6
| # 确保能导入上级目录的模块(如 agentmain) | ||
| _parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
| if _parent_dir not in sys.path: | ||
| sys.path.insert(0, _parent_dir) |
RocketLi
pushed a commit
to RocketLi/GenericAgent
that referenced
this pull request
May 18, 2026
refactor(langfuse/chatapp):
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.