Skip to content

feat(platform): trigger automation task runs from @-mention comments - #3071

Merged
larryro merged 2 commits into
mainfrom
feat/automation-mention-trigger
Aug 26, 2026
Merged

larryro merged 2 commits into
mainfrom
feat/automation-mention-trigger

Conversation

@larryro

@larryro larryro commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What

Tasks assigned to an automation now share the agent-task comment contract: a plain comment is just a comment, and @-mentioning the task's owning automation is what starts its workflow again — with the comment (plus the timeline since the last delivery) as feedback. The subject panel's Request changes now composes exactly that mention: it posts ONE `@ ` comment and rides the same trigger lane, so the timeline itself teaches the pattern.

How

  • Mentions grow a third actor type `automation` (id = store name). The directory adds deployed automations visible from the project (bound + org-level), with store-name + display-name handles; agent instances keep the strongest claim on colliding handles, and automation handles shadow the permissive-agent fallback.
  • Trigger (`triggerMentionedTaskAutomation` in `tasks/mutations.ts`, run from the USER comment path only — agent/workflow-authored comments never trigger, keeping the loop-safety posture): write access + not archived, the mentioned automation must OWN the task (assignee `app` → creation stamp → `task.externalSystem` against the mentioned automation's declared contract namespace), one engine per task across both lanes, then schedules the existing `startTaskWorkflowRun` (its duplicate guard backstops the pre-check). `addTaskComment` returns an optional `automationTriggered` for the panel's toast.
  • Request changes drops its separate `startTaskWorkflow` call; the board's status-verb choreography (drag In review → In progress) is unchanged.
  • The three copies of the `input.task` subject builder collapse into `taskWorkflowSubjectInput` (`tasks/helpers.ts`).
  • Frontend: the `@` autocomplete lists the board's automations (Workflow avatar, "· Automations" caption), timeline prose renders `@vat-return-desk` as an `@Swiss VAT return desk` pill, and `mentionPicker.title` + the task-automation docs page (Mentions section) are updated in en/de/fr.
  • Schema: `taskMentionTypeValidator` widens mention storage/events additively (optional field, no migration); comment authorship stays `user | agent`.

Verification

  • New `convex/tasks/automation_mention_trigger.test.ts` (11 cases): trigger + subject input, display-name handle, plain comment inert, non-owner mention inert, read-only member inert, live-run guard, ownership fallbacks (creation stamp, externalSystem), agent-assigned task ignores automation mentions, directory handle contract, project-binding isolation.
  • Existing suites green: platform typecheck, oxlint, tasks/collab/automations server tests, tasks UI tests, docs structural suite, i18n checks.
  • Live on the dev stack (Swiss VAT return desk, BTR-1): a plain comment started nothing; an `@vat-return-desk` comment kicked a revision run with the workflow's "Revision you requested" ack; the Request changes dialog posted the mention-prefixed comment and the rerun started; the composer autocomplete lists the desk.

Out of scope

  • The composer's ⚡ trigger-preview chips stay agent-only.
  • The vatplus-worker keeps portal change requests operator-gated; it can opt into auto-trigger later by @-mentioning the desk in its relayed comment (apps-repo decision).

@larryro
larryro merged commit a5fe0e9 into main Aug 26, 2026
51 checks passed
@larryro
larryro deleted the feat/automation-mention-trigger branch August 26, 2026 05:52
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