Skip to content

🔧 fix: Keep LIBRECHAT_* placeholders out of customUserVars substitution - #97

Merged
TomasPalsson merged 2 commits into
aproorg/0.8.8from
fix/mcp-reserved-placeholders-0.8.8
Oct 26, 2026
Merged

TomasPalsson merged 2 commits into
aproorg/0.8.8from
fix/mcp-reserved-placeholders-0.8.8

Conversation

@TomasPalsson

Copy link
Copy Markdown

Summary

LIBRECHAT_USER_*, LIBRECHAT_OPENID_* and LIBRECHAT_BODY_* placeholders now always resolve from the logged-in user and the request. Stored customUserVars whose names start with LIBRECHAT_ are skipped during substitution.

Needed before tenants put {{LIBRECHAT_USER_EMAIL}} in MCP server headers (MS / msund central MCP server, GENAI-929).

Changes

  • packages/api/src/utils/env.ts: skip LIBRECHAT_* names in the customUserVars pass of processSingleValue.
  • Tests: new cases in env.spec.ts and mcp/__tests__/auth.test.ts. Two existing tests that asserted the old precedence ("prioritize customUserVars over user fields… though not recommended") are updated to the new precedence.

Testing

  • npx jest src/utils/env.spec.ts src/mcp/__tests__/auth.test.ts src/mcp/__tests__/mcp.spec.ts: 210 passed. Without the env.ts change: 5 failed.
  • npx jest src/utils src/mcp before and after: no test went from passing to failing.
  • Lint was not run locally (eslint could not load in the worktree). Left to CI.

🤖 Generated with Claude Code

LIBRECHAT_USER_*, LIBRECHAT_OPENID_* and LIBRECHAT_BODY_* placeholders are
resolved from the authenticated user and request. Skip customUserVars whose
names use the LIBRECHAT_ prefix so they always resolve from those sources.

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6e0c170e-648e-4673-993b-e799151dfe01

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude <noreply@anthropic.com>
@TomasPalsson
TomasPalsson merged commit bbccf1e into aproorg/0.8.8 Oct 26, 2026
24 of 27 checks passed
@TomasPalsson
TomasPalsson deleted the fix/mcp-reserved-placeholders-0.8.8 branch October 26, 2026 10:53
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.

2 participants