fix(core): respect v2 default agents (#30969)
This commit is contained in:
parent
fff36b70bc
commit
02a5ae6585
11 changed files with 155 additions and 18 deletions
|
|
@ -58,6 +58,8 @@ export const Plugin = PluginV2.define({
|
|||
|
||||
yield* agent.update((editor) => {
|
||||
const global = documents.flatMap((document) => document.info.permissions ?? [])
|
||||
const configuredDefault = documents.findLast((document) => document.info.default_agent !== undefined)?.info.default_agent
|
||||
if (configuredDefault !== undefined) editor.default(AgentV2.ID.make(configuredDefault))
|
||||
for (const current of editor.list()) {
|
||||
editor.update(current.id, (agent) => agent.permissions.push(...global))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue