Skip to content

feat: Declare new doctype and schema for assistant ✨#2349

Merged
lethemanh merged 1 commit intomasterfrom
update-for-using-assistant
Feb 2, 2026
Merged

feat: Declare new doctype and schema for assistant ✨#2349
lethemanh merged 1 commit intomasterfrom
update-for-using-assistant

Conversation

@lethemanh
Copy link
Copy Markdown

@lethemanh lethemanh commented Jan 14, 2026

Summary by CodeRabbit

  • New Features
    • Added support for managing AI chat assistants, including creation, retrieval and updates linked to account providers.
  • Chores
    • Upgraded client and UI dependencies to newer releases.
  • Permissions
    • App permissions extended to allow remote assistant data operations (create/read/update).

✏️ Tip: You can customize this high-level summary in your review settings.

Related to:

linagora/cozy-libs#2911

linagora/cozy-client#1661

cozy/cozy-store#959

cozy/cozy-stack#4641

@lethemanh lethemanh self-assigned this Jan 14, 2026
@lethemanh lethemanh marked this pull request as draft January 14, 2026 07:42
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 14, 2026

Warning

Rate limit exceeded

@lethemanh has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 25 minutes and 50 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

Adds a new permission entry assistants to manifest.webapp.permissions with type: io.cozy.ai.chat.assistants, verbs: ["ALL"], and description for fetching/creating/updating assistant data. Adds an assistants entry to src/schema.js with doctype: io.cozy.ai.chat.assistants, empty attributes, and a provider relationship (has-one) to io.cozy.accounts. Bumps dependencies in package.json: cozy-client ^60.20.0^60.21.0 and cozy-ui ^135.0.0^135.5.0.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly describes the main change: adding a new doctype and schema for assistants, which is the primary focus of all modifications across manifest.webapp, src/schema.js, and package.json updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-for-using-assistant

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.

❤️ Share

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

@bundlemon
Copy link
Copy Markdown

bundlemon bot commented Jan 14, 2026

BundleMon

Files updated (10)
Status Path Size Limits
static/js/cozy.(hash).js
890.04KB (+20.88KB +2.4%) -
services/myselfFromIdenties.js
233.71KB (+977B +0.41%) -
services/sourceAccountIdentifierNormalizerHel
per.js
233.9KB (+971B +0.41%) -
services/sourceAccountIdentifierNormalizer.js
257.07KB (+966B +0.37%) -
services/cliskTimeout.js
256.52KB (+962B +0.37%) -
services/updateAccounts.js
466.78KB (+881B +0.18%) -
services/softDeleteOrRestoreAccounts.js
468.11KB (+858B +0.18%) -
static/css/cozy.(hash).css
31.4KB (+820B +2.62%) -
services/deleteAccounts.js
317.18KB (+742B +0.23%) -
static/js/main.(hash).js
81.96KB (+25B +0.03%) -
Unchanged files (6)
Status Path Size Limits
static/js/(chunkId).(hash).js
1002.58KB -
services/polyfillFetch.js
97.16KB -
static/js/lib-react.(hash).js
43.88KB -
static/js/lib-router.(hash).js
26.7KB -
services/attributesHelpers.js
15.7KB -
static/css/main.(hash).css
8.62KB -

Total files change +27.92KB +0.63%

Groups updated (3)
Status Path Size Limits
**/*.js
7.11MB (+32KB +0.44%) -
**/*.{png,svg,ico}
276.88KB (+4.09KB +1.5%) -
**/*.css
87.07KB (+820B +0.93%) -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
manifest.webapp (1)

128-137: Critical: Duplicate JSON key will cause permission loss.

The key "announcements-uploads" is used twice (lines 128 and 133). JSON parsers typically keep only the last occurrence, so the original permission for cc.cozycloud.announcements.uploads will be silently overwritten.

Rename the new permission key to something meaningful like "assistants":

🐛 Proposed fix
     "announcements-uploads": {
       "type": "cc.cozycloud.announcements.uploads",
       "verbs": ["GET"],
       "description": "Remote-doctype required to get announcements images"
     },
-    "announcements-uploads": {
+    "assistants": {
       "type": "io.cozy.ai.chat.assistants",
       "verbs": ["ALL"],
       "description": "Remote-doctype required to fetch, create and update assistant data"
     }
🧹 Nitpick comments (1)
src/schema.js (1)

41-50: Consider using the existing ACCOUNTS_DOCTYPE constant.

For consistency with the rest of the file (see line 13), use the constant instead of the hardcoded string.

♻️ Suggested change
   assistants: {
     doctype: 'io.cozy.ai.chat.assistants',
     attributes: {},
     relationships: {
       provider: {
         type: 'has-one',
-        doctype: 'io.cozy.accounts'
+        doctype: ACCOUNTS_DOCTYPE
       }
     }
   }
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3569833 and 53c5cdc.

📒 Files selected for processing (2)
  • manifest.webapp
  • src/schema.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build and publish
  • GitHub Check: Analyze (javascript)

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
manifest.webapp (1)

123-136: Rename the duplicate permission key to avoid overriding announcements uploads.
JSON object keys must be unique. The second "announcements-uploads" overrides the first, which likely drops the cc.cozycloud.announcements.uploads permission and can break announcements images access.

🐛 Proposed fix
     "announcements-uploads": {
       "type": "cc.cozycloud.announcements.uploads",
       "verbs": ["GET"],
       "description": "Remote-doctype required to get announcements images"
     },
-    "announcements-uploads": {
+    "chatAssistants": {
       "type": "io.cozy.ai.chat.assistants",
       "verbs": ["ALL"],
       "description": "Remote-doctype required to fetch, create and update assistant data"
     }
🤖 Fix all issues with AI agents
In `@manifest.webapp`:
- Around line 133-136: The manifest entry for "announcements-uploads" currently
grants overly broad permissions via the verbs array; change the "verbs" value on
the "announcements-uploads" resource from ["ALL"] to the minimal set matching
the description (e.g., ["GET","POST","PUT"]) or alternatively update the
description to explicitly include DELETE if that verb is required; locate the
"announcements-uploads" object and adjust its "verbs" property accordingly to
enforce least privilege.
🧹 Nitpick comments (1)
src/schema.js (1)

41-48: Use ACCOUNTS_DOCTYPE for provider relationship consistency.
Minor maintainability win: avoid hardcoding the same doctype string in multiple places.

♻️ Proposed change
   assistants: {
     doctype: 'io.cozy.ai.chat.assistants',
     attributes: {},
     relationships: {
       provider: {
         type: 'has-one',
-        doctype: 'io.cozy.accounts'
+        doctype: ACCOUNTS_DOCTYPE
       }
     }
   }

manifest.webapp Outdated
"verbs": ["GET"],
"description": "Remote-doctype required to get announcements images"
},
"announcements-uploads": {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rename this key to "assistants"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It has been renamed

@lethemanh lethemanh force-pushed the update-for-using-assistant branch from 35390de to 7bb7968 Compare January 27, 2026 10:37
@lethemanh lethemanh requested a review from zatteo January 27, 2026 10:37
@lethemanh lethemanh force-pushed the update-for-using-assistant branch 2 times, most recently from 12d5d55 to caf3557 Compare January 28, 2026 08:57
@lethemanh lethemanh force-pushed the update-for-using-assistant branch from caf3557 to ef81546 Compare February 2, 2026 09:06
@lethemanh lethemanh merged commit be6fbea into master Feb 2, 2026
5 checks passed
@lethemanh lethemanh deleted the update-for-using-assistant branch February 2, 2026 09:10
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