Skip to content

Fix import side effect#63

Merged
fcogidi merged 5 commits intomainfrom
fco/fix_import_side_effect
Mar 16, 2026
Merged

Fix import side effect#63
fcogidi merged 5 commits intomainfrom
fco/fix_import_side_effect

Conversation

@fcogidi
Copy link
Collaborator

@fcogidi fcogidi commented Mar 12, 2026

PR Type

Fix

Short Description

  • Fix import-time side effects of langfuse_client by using lazy initialization.
  • Ignore unknown environment variables so that Configs can be used in other environments.
  • Bump package to new version.

Tests Added

...

@fcogidi fcogidi requested review from amrit110 and Copilot March 12, 2026 19:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Lazy-initializes the shared Langfuse client to avoid import-time side effects (e.g., requiring env vars at import), and allows Configs to tolerate unknown environment variables via extra="ignore".

Changes:

  • Refactored shared_client.py and __init__.py to use cached_property and module-level __getattr__ for lazy Langfuse client creation.
  • Added extra="ignore" to the pydantic Configs settings so unknown env vars are silently skipped.
  • Bumped aieng-agents from 0.1.0 → 0.1.1.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
aieng-agents/aieng/agents/langfuse/shared_client.py Wraps client in _LangfuseClientManager with cached_property; adds module __getattr__ for lazy access
aieng-agents/aieng/agents/langfuse/__init__.py Re-exports langfuse_client lazily via __getattr__
aieng-agents/aieng/agents/env_vars.py Adds extra="ignore" to Configs
aieng-agents/pyproject.toml Version bump to 0.1.1
pyproject.toml Updates dependency to >=0.1.1
uv.lock Reflects version bump

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fcogidi fcogidi merged commit e5bf361 into main Mar 16, 2026
4 checks passed
@fcogidi fcogidi deleted the fco/fix_import_side_effect branch March 16, 2026 13:02
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