Add assigned_gm field for task ownership / multi-GM event scoping#561
Open
kylecarbonneau wants to merge 4 commits into
Open
Add assigned_gm field for task ownership / multi-GM event scoping#561kylecarbonneau wants to merge 4 commits into
kylecarbonneau wants to merge 4 commits into
Conversation
Introduces an AssignedGM string on Task: a free-form slug identifying the GM (manager session) a task belongs to. Threads it through the INSERT, UPDATE, and all SELECT/scan sites, adds the schema migration, and gives ListTasks --assigned-gm / --unassigned filtering via ListTasksOptions. ty stores the slug verbatim and does no validation; the slug-to-GM mapping is the client's concern. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds --assigned-gm to `ty create` / `ty update` / `ty list` and --unassigned to `ty list`, an assigned_gm property on the taskyou_create_task MCP tool, and a TASK_ASSIGNED_GM env var passed to event hook scripts so push-channel clients can scope events per GM. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
UpdateTask now records an assigned_gm change in the emitted task.updated
event's metadata ({"old","new"}, matching the existing per-field
convention), so per-GM channels can react to a task becoming theirs,
being reassigned away, or returning to the unassigned pool. The event
only fires when the value actually changed.
runHook also exposes TASK_PREVIOUS_ASSIGNED_GM when the update carries
an assignment change, so hooks can detect the direction of the change
without parsing TASK_METADATA as JSON.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The TUI edit form and the move-to-project clone paths reconstruct a task without an assignment field, which would silently drop assigned_gm and — now that UpdateTask emits an assignment-change event — fire a spurious "unassigned" event on an unrelated edit. Carry the existing assignment through all three paths (TUI edit-save, TUI project move, CLI move-to-project), mirroring how tags is already preserved on the CLI clone. Also drop a stray unused variable in the list-filter test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Adds an
assigned_gm stringfield onTask(with migration), filter flags (ty list --assigned-gm <slug>/--unassigned),--assigned-gmonty create/ty update, anassigned_gmproperty on thetaskyou_create_taskMCP tool, and event support: aTASK_ASSIGNED_GMenv var on every task hook plus atask.updatedevent (and aTASK_PREVIOUS_ASSIGNED_GMenv var) whenever a task's assignment changes.Motivation
With multiple GM sessions running on the same daemon (each a separate Claude session driving its own delegated tasks), every GM currently sees every task event. This adds first-class ownership so per-GM filters (channel-side, kanban UI, CLI) can scope cleanly instead of relying on soft
CLAUDE.mdconventions. The assignment-change event lets a GM's channel react when a task becomes theirs, is reassigned away, or returns to the unassigned pool.tyitself only stores and exposes the field — validation / slug-to-GM mapping is the client's job (e.g. a push-channel server). A companion client-side change would consume the field for the actual filtering.What's included
AssignedGMonTask, threaded throughCreateTask/UpdateTaskand every task SELECT/scan site; migrationALTER TABLE tasks ADD COLUMN assigned_gm TEXT DEFAULT ''.ListTasksOptions.AssignedGM/Unassigned→ty list --assigned-gm <slug>and--unassigned(the latter takes precedence).--assigned-gmonty createandty update; assignment is preserved across the TUI edit and project-move flows.assigned_gmstring property ontaskyou_create_task.TASK_ASSIGNED_GMexported to all task hooks;UpdateTaskemits atask.updatedevent carrying{old, new}when the assignment actually changes, andrunHookadditionally exportsTASK_PREVIOUS_ASSIGNED_GMon those events so hooks can tell the direction of the change without parsingTASK_METADATA.Design notes
tydoes no validation of the slug — it's stored verbatim. The slug→GM mapping belongs to the client.{old, new}change-metadata convention (same shape as title/status/project changes) and only fires when the value actually changed.Testing
Unit tests cover create/get/update/clear persistence, the
--assigned-gm/--unassignedlist filters (including unassigned-overrides-slug precedence), the assignment-change event (fires on change, not on unrelated edits), and that both env vars reach hook scripts.go vet ./...and thedb/executor/events/mcp/cmd/uitest suites pass.