Skip to content

Add assigned_gm field for task ownership / multi-GM event scoping#561

Open
kylecarbonneau wants to merge 4 commits into
bborn:mainfrom
kylecarbonneau:assigned-gm-field
Open

Add assigned_gm field for task ownership / multi-GM event scoping#561
kylecarbonneau wants to merge 4 commits into
bborn:mainfrom
kylecarbonneau:assigned-gm-field

Conversation

@kylecarbonneau
Copy link
Copy Markdown

Adds an assigned_gm string field on Task (with migration), filter flags (ty list --assigned-gm <slug> / --unassigned), --assigned-gm on ty create / ty update, an assigned_gm property on the taskyou_create_task MCP tool, and event support: a TASK_ASSIGNED_GM env var on every task hook plus a task.updated event (and a TASK_PREVIOUS_ASSIGNED_GM env 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.md conventions. The assignment-change event lets a GM's channel react when a task becomes theirs, is reassigned away, or returns to the unassigned pool.

ty itself 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

  • DB: AssignedGM on Task, threaded through CreateTask / UpdateTask and every task SELECT/scan site; migration ALTER TABLE tasks ADD COLUMN assigned_gm TEXT DEFAULT ''.
  • Filtering: ListTasksOptions.AssignedGM / Unassignedty list --assigned-gm <slug> and --unassigned (the latter takes precedence).
  • CLI: --assigned-gm on ty create and ty update; assignment is preserved across the TUI edit and project-move flows.
  • MCP: free-form assigned_gm string property on taskyou_create_task.
  • Events: TASK_ASSIGNED_GM exported to all task hooks; UpdateTask emits a task.updated event carrying {old, new} when the assignment actually changes, and runHook additionally exports TASK_PREVIOUS_ASSIGNED_GM on those events so hooks can tell the direction of the change without parsing TASK_METADATA.

Design notes

  • ty does no validation of the slug — it's stored verbatim. The slug→GM mapping belongs to the client.
  • The assignment-change event reuses the existing per-field {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 / --unassigned list 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 the db / executor / events / mcp / cmd / ui test suites pass.

kylecarbonneau and others added 4 commits June 6, 2026 12:15
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>
@kylecarbonneau kylecarbonneau marked this pull request as ready for review June 7, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant