feat(core): pass auth data to workspace (#22897)

This commit is contained in:
James Long
2026-04-16 16:30:11 -04:00
committed by GitHub
parent 9b77430d0d
commit a8d8a35cd3
4 changed files with 14 additions and 8 deletions
@@ -5,6 +5,7 @@ import { Database, asc, eq, inArray } from "@/storage"
import { Project } from "@/project"
import { BusEvent } from "@/bus/bus-event"
import { GlobalBus } from "@/bus/global"
import { Auth } from "@/auth"
import { SyncEvent } from "@/sync"
import { EventTable } from "@/sync/event.sql"
import { Flag } from "@/flag/flag"
@@ -112,7 +113,12 @@ export namespace Workspace {
.run()
})
await adaptor.create(config)
const env = {
OPENCODE_AUTH_CONTENT: JSON.stringify(await AppRuntime.runPromise(Auth.Service.use((auth) => auth.all()))),
OPENCODE_WORKSPACE_ID: config.id,
OPENCODE_EXPERIMENTAL_WORKSPACES: "true"
}
await adaptor.create(config, env)
startSync(info)