feat: configurable Drive corpora org setting (TKAI-49)#53
Merged
Conversation
…hread Child session idle/completion events were delivered to the orchestrator's main thread instead of the thread that spawned the child. The root cause was that parentThreadId was only stored in the child DO's transient SQL state, which is lost if the DO is re-initialized. - Persist parent_thread_id in D1 sessions table as durable fallback - Fall back to D1 value in notifyParentEvent when DO state is empty - Add hydration to handleSystemMessage's direct dispatch path so thread channels resolve the correct OpenCode session (was missing, unlike handlePrompt and sendNextQueuedPrompt which already hydrate) - Extract ensureThreadOcSessionHydrated helper to deduplicate the hydration pattern across dispatch paths - Add diagnostic logging at spawn, notify, and receive points
Drive files.list calls default corpora to 'user', hiding org-shared docs. Add a driveCorpora org setting (user/domain/allDrives) that flows through guardConfig to the Google Workspace plugin, letting admins control file discovery scope from the admin UI.
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.
Summary
driveCorporaorg setting (user|domain|allDrives) that controls the Google Drive APIcorporaparameter on allfiles.listcallsguardConfigpipeline: org settings DB -> SessionAgentDO (60s cache) -> ActionContext -> pluginuser(no behavior change without admin action)Resolves TKAI-49
Changes
0009_add_drive_domain_corpora.sqldrive_corpora TEXT NOT NULL DEFAULT 'user'lib/schema/org.tsshared/types/index.tsdriveCorporaonOrgSettingslib/db/org.tssession-agent.tsguardConfigroutes/admin.tsdrive-actions.tsresolveCorpora(ctx)helper, all 6files.listcallsresolve-corpora.test.tsadmin.tsxTest plan
corpora=userdomainin admin UI, confirm Drive list/search actions return org-shared docsallDrives, confirm shared drive files appearuser, confirm scoped down againpnpm typecheck(passes)cd packages/plugin-google-workspace && pnpm test(7/7 resolveCorpora tests pass)