feat(cozy-search): Automatically provision assistant - #3145
Merged
Merged
Conversation
The flag that lists the assistants to provision is now cozy.assistant.autoprovision, next to the other cozy.assistant.* flags, instead of rag.assistants.autoprovision. Apps should read it through the exported AUTOPROVISION_FLAG constant rather than the literal.
paultranvan
requested review from
JF-Cozy,
doubleface,
rezk2ll and
zatteo
as code owners
September 17, 2026 17:16
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
paultranvan
marked this pull request as draft
September 17, 2026 17:20
Until now only the host app could run setupRagIndexing and ensureProvisionedAssistants, so an instance whose app did not do it at startup never got its triggers nor its flagged assistants. autoprovisionAssistants(client) now bundles both steps behind the cozy.assistant.autoprovision flag and runs once per session: every call shares the first promise. AssistantContainer, common to AssistantView and AssistantDialog, calls it through useAssistantsAutoprovision when the assistant opens. A host app can still call it at startup, without racing the UI.
paultranvan
force-pushed
the
feat/assistant-autoprovision-flag-name
branch
from
September 18, 2026 08:19
2c26554 to
122003a
Compare
fetchPolicies.olderThan takes milliseconds: the shared policy was refetching after 86 seconds while its comment claimed 24 hours. Set it to 5 minutes explicitly.
paultranvan
marked this pull request as ready for review
September 18, 2026 08:33
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Flag rename
The flag that lists the assistants to provision is now
cozy.assistant.autoprovision, next to the othercozy.assistant.*flags, instead ofrag.assistants.autoprovision. Apps should read it through the exportedAUTOPROVISION_FLAGconstant rather than the literal.Deployment note: instances or contexts configured with
rag.assistants.autoprovisionmust be switched to the new name, otherwise nothing is provisioned and new conversations no longer start on the flagged default assistant.Provisioning on assistant open
Until now only the host app could run
setupRagIndexingandensureProvisionedAssistants, so an instance whose app did not do it at startup never got itsrag-indextriggers nor its flagged assistants.autoprovisionAssistants(client)bundles both steps behind the flag and runs once per session: every call shares the first promise, so the assistant UI and the host app's startup can both trigger it without racing.AssistantContainer, common toAssistantViewandAssistantDialog, calls it through theuseAssistantsAutoprovisionhook when the assistant opens. Both are exported for host apps that want the setup to start earlier.Verified end to end on
testpaul1.cozy.workswith the fix of #3142: provisioning creates the account and the assistant, therag-indextriggers, and the workspace on OpenRAG; the files of the knowledge base folder are indexed, and later moves, edits and deletions are reflected within seconds.