Repository navigation
feat: automatic project owner enrolment for new threads - #1
Open
matthewcosier wants to merge 1 commit into
Open
matthewcosier wants to merge 1 commit into
matthewcosier wants to merge 1 commit into
Conversation
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.
Problem
Long-lived coordinator threads manage multiple worker threads, answer their questions, and review their results. Today, starting a new thread in a project and handing it to that coordinator requires dragging the thread into the coordinator's composer and sending a manual handover message. Asking the coordinator to start the thread instead stalls quick tasks behind whatever long turn the coordinator is currently running.
Change
Adds a per-project
ownerThreadIdbinding and server-side automatic enrolment for new user-started threads:packages/contracts):ownerThreadIdtoProject,OrchestrationProjectShell,ApplicationProjectMetaUpdatedPayload, andProjectMutation'sproject.updatevariant. Deliberately omittedownerThreadIdfromProjectUpdatePayloadso MCPt3_project_updatecannot claim project ownership.managedByThreadIdtoOrchestrationV2AppThread,OrchestrationV2ThreadShell,thread.create, andthread.metadata.update, plusskipOwnerEnrolmentonthread.createandOrchestrationV2ThreadLaunchInput."managed_thread"toOrchestrationV2NotificationSource(enrolled,question,approval,run_completed,owner_assigned,owner_replaced).apps/server):120_ProjectionProjectsOwnerThreadaddsowner_thread_id(with partial index) onprojection_projects, wired throughProjectStore,ProjectCommands,ProjectMutation, andProjectService(validating that candidate owners are active, unsettled, non-delegated threads).ThreadLaunchServiceauto-enrols fresh user-started (web/mobile) threads atomically onthread.create, skipping opt-out (skipOwnerEnrolment), reused, agent/MCP, delegated, linked, workflow, imported, scheduled, and self threads.ws.tsstrips client-suppliedmanagedByThreadIdonthread.createand non-nullmanagedByThreadIdonthread.metadata.update(allowing onlynullto detach).ManagedThreadAppContextinjects reversibleappContextowner notes on turn start and steer without prompt rewriting.ProjectOwnerReactorhandles enrolment notices (first user message with link, title, first message preview, andDispatchModeLimitread-only notice when managed thread modes exceed the owner's), pendinguser_inputquestion wakes andProviderRequestKindapproval notices (with queued wake cancellation on resolution), idlerun_completednotices, owner replacement transfer of active unsettled managed threads (leaving settled/archived threads untouched), and owner retirement cleanup (thread.settled,thread.archived,thread.deleted) without waking the retired owner.Orchestratorupgradesmanaged_threadnotices to non-interrupting mid-turnsteer_activealongsidedelegated_task, and drops stale queuedmanaged_threadquestion/approval wakes once detached or resolved.packages/client-runtime,apps/web,apps/mobile):Set as owner of…thread action submenu (recent 10 projects with checkmarks plusSearch projects…opening a searchableCommandDialogpicker styled withProjectFaviconand selection badges) andDetach from {owner}action, mirrored in the Command Palette.Managed by {owner}composer banner on new drafts in owned projects so users can opt out (Start unmanaged) before sending.TimelineWorkEntryRowto label managed-thread notification linksOpen threadinstead ofOpen subagent, and updated exhaustive notification source switches inclient-runtime,web, andmobile.Screenshots
Set as owner of…submenuDetach from {owner}menu actionHit every surface
t3_project_updateexcluded; WS clientmanagedByThreadIdstripped)ThreadLaunchService,ProjectOwnerReactor,ManagedThreadAppContext,OrchestratorVerification
vp fmtandvp lintacross all changed/new files (0 errors)typecheckacross@t3tools/contracts,@t3tools/client-runtime,t3,@t3tools/web,@t3tools/desktop,@t3tools/mobilevp run knip:check:files,vp run knip:check:exports,vp run i18n:check, React Compiler coverageProjectOwnerReactor.test.ts,ProjectStore.test.ts,ProjectCommands.test.ts,ProjectService.test.ts,ProviderTurnControlService.test.ts,ProviderTurnStartService.test.ts,projectOwner.test.ts,threadActionMenu.logic.test.ts,useThreadActionMenu.test.ts,ChatView.browser.test.tsxscripts/scenarios/project-owner-auto-enrolment.e2e.ts) passing against isolated server, SQLite, web app, and dev replay providerBuilt with Gemini 4 Neon / Antigravity