Skip to content

refactor(langfuse/chatapp):#380

Merged
lsdefine merged 1 commit into
lsdefine:mainfrom
desmonna:main
May 14, 2026
Merged

refactor(langfuse/chatapp):#380
lsdefine merged 1 commit into
lsdefine:mainfrom
desmonna:main

Conversation

@desmonna

Copy link
Copy Markdown
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
Copilot AI review requested due to automatic review settings May 14, 2026 14:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_log monkey patch to accept and forward log_path.
  • Adds project-root path setup in chatapp_common.py before 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)
@lsdefine
lsdefine merged commit ffb2685 into lsdefine:main May 14, 2026
3 of 4 checks passed
RocketLi pushed a commit to RocketLi/GenericAgent that referenced this pull request May 18, 2026
lsdefine added a commit that referenced this pull request Jul 23, 2026
refactor(langfuse/chatapp):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants