You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: Add a custom per-user system prompt setting guarded by an admin setting - #733
The change adds an admin setting that controls whether users can add personal chat instructions. The personal settings interface exposes a text field with a 4,000-character limit. The server rejects longer values. When the setting is enabled, ChatService adds a non-empty personal instruction to the system message for a new session after the existing instructions.
Merge Risk: Low · up to 9999d
The feature is mergeable with bounded follow-up: users can lose instructions when closing the tab immediately after editing, and emoji-heavy instructions reach the input limit prematurely.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title states the main change: a per-user custom system prompt (personal chat instructions) controlled by an admin setting. The changeset adds the personal instructions field, the admin toggle, the…
Description check
The description contains two screenshots of the personal and administrator Assistant settings pages, which show the new custom chat instructions field and the admin toggle that the changeset adds. It …
Docstring Coverage
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title states the main change: a per-user custom system prompt (personal chat instructions) controlled by an admin setting. The changeset adds the personal instructions field, the admin toggle, the length limit, and the ChatService logic that appends user instructions to the system message. The title is specific and matches the primary change.
Full details: Description check
Explanation
The description contains two screenshots of the personal and administrator Assistant settings pages, which show the new custom chat instructions field and the admin toggle that the changeset adds. It also includes an AI-generation disclosure. The description is brief but relates directly to the changeset.
Full details: Docstring Coverage
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 6 files. (2 skipped: 2 unsupported.)
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
Error: typescript-eslint does not support TS 7.0.
at Object. (/.eslint-tmp/node_modules/typescript-eslint/dist/index.js:52:11)
at Module._compile (node:internal/modules/cjs/loader:1929:14)
at Object..js (node:internal/modules/cjs/loader:2060:10)
at Module.load (node:internal/modules/cjs/loader:1651:32)
at Module._load (node:internal/modules/cjs/loader:1443:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:261:19)
at loadCJSModuleWithModuleLoad (node:internal/modules/esm/translators:372:15)
at ModuleWrap. (node:internal/modules/esm/translators:244:9)
at ModuleJob.run (node:internal/modules/esm/module_job:561:25)
at async node:internal/modules/esm/loader:647:26
src/components/PersonalSettings.vue
ESLint skipped: the matched ESLint configuration already failed (config-incompatibility).
PHPStan (2.3.1)
PHPStan reported 3 non-file analysis error(s); analysis is incomplete
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
marcelklehr
changed the title
feat: Add a custom per-user system prompt setting
feat: Add a custom per-user system prompt setting guarded by an admin setting
Nov 9, 2026
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Nitpick comments: 1
lib/Service/ChatService.php: 1
78-83: Trivial · Maintainability & Code Quality · Low value
Add session-creation tests for personal instructions.
Assert the persisted system message for enabled, disabled, empty, and distinct per-user instructions. The agency tests supply a system message directly, so they would not catch a regression that omits personal instructions or ignores the admin setting.
Review info
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: 30d75feb-2a77-4272-a7d6-3b49c545c12a
Commits
Reviewing files that changed from the base of the PR and between 9e9a064 and 9999d58.
Files selected for processing: 8
lib/AppInfo/Application.php
lib/Controller/ConfigController.php
lib/Service/ChatService.php
lib/Settings/Admin.php
lib/Settings/Personal.php
src/components/AdminSettings.vue
src/components/PersonalSettings.vue
tests/unit/Service/ChatServiceAgencyTest.php
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
HTML textarea maxlength UTF-16 code units user input specification MDN
Result:
Sources consulted:
- maxlength HTML attribute - HTML | MDN — https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/maxlength
- <textarea> HTML textarea element - HTML | MDN — https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/textarea
- <input> HTML input element - HTML | MDN — https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input
- minlength HTML attribute - HTML | MDN — https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/minlength
- HTMLTextAreaElement: maxLength property - Web APIs | MDN — https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/maxLength
- …and 11 more
Web query:
Nextcloud IConfig setUserValue configvalue maximum length database emoji preferences
Align the textarea limit with the server’s character count.
When instructions contain supplementary Unicode characters, the textarea can stop input before the server’s 4,000-character limit. For example, it cannot accept 3,000 emoji that the server permits. Validate using the same character count on both sides.
HTML standard closing document tab timers task execution stop document unload setTimeout
Result:
Sources consulted:
- HTML Standard — https://html.spec.whatwg.org/multipage/document-lifecycle.html
- HTML Standard — https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html
- HTML Standard, Edition for Web Developers — https://html.spec.whatwg.org/dev/browsing-the-web.html
- …and 18 more
Protect pending instruction edits when leaving the page.
If the user closes the tab within two seconds of editing, the save may never run. New conversations then use the previous instructions. Show the save state and warn users before they leave with unsaved changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI (if applicable)