Skip to content

feat(cozy-search): Automatically provision assistant - #3145

Merged
paultranvan merged 3 commits into
masterfrom
feat/assistant-autoprovision-flag-name
Sep 18, 2026
Merged

paultranvan merged 3 commits into
masterfrom
feat/assistant-autoprovision-flag-name

Conversation

@paultranvan

@paultranvan paultranvan commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Flag rename

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.

Deployment note: instances or contexts configured with rag.assistants.autoprovision must 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 setupRagIndexing and ensureProvisionedAssistants, so an instance whose app did not do it at startup never got its rag-index triggers 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 to AssistantView and AssistantDialog, calls it through the useAssistantsAutoprovision hook when the assistant opens. Both are exported for host apps that want the setup to start earlier.

Verified end to end on testpaul1.cozy.works with the fix of #3142: provisioning creates the account and the assistant, the rag-index triggers, and the workspace on OpenRAG; the files of the knowledge base folder are indexed, and later moves, edits and deletions are reflected within seconds.

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.
@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 5f392cad-c8b5-4265-842a-e80e45f61332


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.

@paultranvan
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
paultranvan force-pushed the feat/assistant-autoprovision-flag-name branch from 2c26554 to 122003a Compare September 18, 2026 08:19
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 paultranvan changed the title feat(cozy-search): Rename the autoprovision flag to cozy.assistant.* feat(cozy-search): Automatically provision assistant Sep 18, 2026
@paultranvan
paultranvan marked this pull request as ready for review September 18, 2026 08:33
@paultranvan
paultranvan merged commit b4b5139 into master Sep 18, 2026
3 checks passed
@paultranvan
paultranvan deleted the feat/assistant-autoprovision-flag-name branch September 18, 2026 08:41
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.

1 participant