Skip to content

feat: support project-scoped Langfuse configuration - #41

Open
suolongcn wants to merge 1 commit into
langfuse:mainfrom
suolongcn:fix/40-project-scoped-config
Open

suolongcn wants to merge 1 commit into
langfuse:mainfrom
suolongcn:fix/40-project-scoped-config

Conversation

@suolongcn

Copy link
Copy Markdown

Closes #40.

Pi sessions can now target a workspace-specific Langfuse instance through .pi/langfuse.json in the current working directory. The plugin selects that file before the global agent config, while environment variables retain their existing precedence.

Missing, unreadable, malformed, or non-object project files fall back to the global config. Valid project objects are used as a whole, including empty or incomplete objects, so credentials and endpoints from different instances are not merged. The README documents precedence, fallback behavior, and keeping project credentials out of version control.

Validation:

  • TypeScript typecheck passed (tsc --noEmit).
  • Full test suite passed: 141 tests, 0 failures (Node 24.21.0, pi 0.84.3, Ubuntu/WSL).
  • Added configuration regressions and a real Pi integration test proving that only the project target receives a trace while the global target receives no requests.
  • Verified a real Pi session with a deterministic mock model against a local Langfuse instance: the project config produced a Pi Turn trace containing 6 observations, including generations and tool calls. Test credentials were kept out of the commit.

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.

Support project-scoped langfuse.json config (per-workspace Langfuse targeting)

1 participant