[PR #4414] [MERGED] New Default System Prompt Variables (User ID, Workspace ID, & Workspace Name) #4620

Closed
opened 2026-02-22 18:36:11 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4414
Author: @angelplusultra
Created: 9/19/2025
Status: Merged
Merged: 9/29/2025
Merged by: @timothycarambat

Base: masterHead: 4325-new-system-prompt-variables


📝 Commits (7)

  • 27f7c19 Fix system prompt variable color logic by removing unused variable type from switch statement and adding new types.
  • c5092a2 Add workspace id, name and user id as default system prompt variables
  • 4d2d696 Combine user and workspace variable evaluations into a single if statment, reducing redundant code.
  • 9955e7d minor refactor
  • 5c0a5bd Merge branch 'master' into 4325-new-system-prompt-variables
  • d614262 add systemPromptVariable expandSystemPromptVariables test cases
  • 7d8f180 Merge branch '4325-new-system-prompt-variables' of github.com:Mintplex-Labs/anything-llm into 4325-new-system-prompt-variables

📊 Changes

4 files changed (+158 additions, -16 deletions)

View changed files

📝 frontend/src/pages/Admin/SystemPromptVariables/VariableRow/index.jsx (+7 -2)
server/__tests__/models/systemPromptVariables.test.js (+61 -0)
📝 server/models/systemPromptVariables.js (+88 -13)
📝 server/utils/chats/index.js (+2 -1)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #4325

What is in this change?

This PR introduces new default system prompt variables.

New Variables:

  • User ID (Only available in Multi-User Mode)
  • Workspace ID
  • Workspace Name

This PR also fixes a color logic bug on the frontend for evaluating the color theme of the system prompt variable type data field in the system prompt variable table.

Additional Information

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/4414 **Author:** [@angelplusultra](https://github.com/angelplusultra) **Created:** 9/19/2025 **Status:** ✅ Merged **Merged:** 9/29/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `4325-new-system-prompt-variables` --- ### 📝 Commits (7) - [`27f7c19`](https://github.com/Mintplex-Labs/anything-llm/commit/27f7c19933060580050fe0c663255911abbab9f7) Fix system prompt variable color logic by removing unused variable type from switch statement and adding new types. - [`c5092a2`](https://github.com/Mintplex-Labs/anything-llm/commit/c5092a2882f1312eaabc2c8174c2ffeabc80d549) Add workspace id, name and user id as default system prompt variables - [`4d2d696`](https://github.com/Mintplex-Labs/anything-llm/commit/4d2d696c08ba9f60964e4fc88dff3ee223b07302) Combine user and workspace variable evaluations into a single if statment, reducing redundant code. - [`9955e7d`](https://github.com/Mintplex-Labs/anything-llm/commit/9955e7dbeec184c942da5c982da9f0a606bf361d) minor refactor - [`5c0a5bd`](https://github.com/Mintplex-Labs/anything-llm/commit/5c0a5bd0adac5814505db4306c42794f46d976c6) Merge branch 'master' into 4325-new-system-prompt-variables - [`d614262`](https://github.com/Mintplex-Labs/anything-llm/commit/d6142620d54a313eb513249ec012308554f612c4) add systemPromptVariable expandSystemPromptVariables test cases - [`7d8f180`](https://github.com/Mintplex-Labs/anything-llm/commit/7d8f180e5d63c65b717aa062e5517257b00bb1b6) Merge branch '4325-new-system-prompt-variables' of github.com:Mintplex-Labs/anything-llm into 4325-new-system-prompt-variables ### 📊 Changes **4 files changed** (+158 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/pages/Admin/SystemPromptVariables/VariableRow/index.jsx` (+7 -2) ➕ `server/__tests__/models/systemPromptVariables.test.js` (+61 -0) 📝 `server/models/systemPromptVariables.js` (+88 -13) 📝 `server/utils/chats/index.js` (+2 -1) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #4325 ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> This PR introduces new default system prompt variables. New Variables: - User ID (Only available in Multi-User Mode) - Workspace ID - Workspace Name This PR also fixes a color logic bug on the frontend for evaluating the color theme of the system prompt variable type data field in the system prompt variable table. ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [ ] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:11 -05:00
yindo closed this issue 2026-02-22 18:36:12 -05:00
yindo changed title from [PR #4414] New Default System Prompt Variables (User ID, Workspace ID, & Workspace Name) to [PR #4414] [MERGED] New Default System Prompt Variables (User ID, Workspace ID, & Workspace Name) 2026-06-05 15:19:28 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4620