---
title: From a channel message to a merged pull request
description: Ask a service agent in a Venom Chat channel to build something. The request becomes a Tasks issue handed to the agent, and the thread shows its progress, its pull request with the diff, and the merge.
section: cloud
order: 173
audience: [user, operator, builder, agent]
sources: [services/nodejs-cloud/lib/chat/work.ts, services/nodejs-cloud/lib/chat/work-model.ts, services/nodejs-cloud/components/chat/WorkCards.tsx, services/nodejs-cloud/app/chat/api/messages, services/nodejs-cloud/migrations/0308_chat_work.sql, services/nodejs-cloud/lib/tasks/github/index.ts]
features: [cloud.chat]
---

You can ask a coding agent for a change without leaving the channel, and read what came of it in the same thread:

1. You mention the agent with a request.
2. The agent proposes to take it on. You press **Confirm**.
3. A Venom Tasks issue is created from your message and handed to the agent.
4. The thread shows one status message that changes as the agent reports progress.
5. When the agent opens a pull request for the issue, the thread gets a card for it. You can read the changed files and
   the diff on the card.
6. When the pull request merges, the card says so and the thread gets one line.

## What you need

| | |
|---|---|
| Venom Chat and Venom Tasks | both add-ons |
| A service agent | A Tasks agent bound to a team key ([Venom Tasks for agents](/docs/cloud/tasks-mcp.md)). It is the program that does the coding: a coding agent that follows its delegated issues over MCP, or an agent that [uses a computer](/docs/computers/agents-on-computers.md). |
| The agent in the channel | A channel owner adds it under **Service agents** in the channel's details and ticks **Start work on a Venom Tasks issue** ([Agents in Venom Chat](/docs/cloud/chat-agents.md)). |
| GitHub connected to Tasks | The webhook from [Link GitHub pull requests](/docs/cloud/tasks-github.md), with the Pull requests event. Add Check suites and Pull request reviews for checks and review state. |
| A GitHub token (optional) | The token on the same settings page. With it the card can show the files and the diff. Without it the card shows the summary and links to GitHub. |

## Ask

Write the request and mention the agent: `@Build Bot add a CSV export to the reports page`. The agent replies in the
thread with what it proposes:

> create an issue in ENG from your message ("add a CSV export to the reports page"), hand it to this agent and follow it in this thread

Only you can press **Confirm**. Nothing exists in Tasks until you do.

To use an issue that already exists, link it in your message with `[[ENG-12]]` (the link picker inserts it). The agent
then proposes to take that issue instead of creating one, and your message is added to it as a comment.

When the organisation has more than one Tasks team you can see, say which one ("in ENG"). If the agent cannot tell, it
asks.

## What goes to Tasks

The issue's title and description are the words of your message, with the agent's mention taken out. Nothing else from
the channel is copied: not the earlier conversation, and not the model's wording. The issue is created as you, so it
lands only in a team you can file in, and it gets a link back to the thread.

In a private channel the start always waits for your **Confirm**, even when the channel owner let the tool run
without asking. Your message is leaving the channel for Tasks, where other people can read it, and the
proposal shows you that before it happens. A private channel's name is not written to the issue either; the link is
titled "Chat thread".

In a public channel a channel owner can tick **Run without asking the person first** for this tool. The work then
starts at once, still as the person who asked.

## Progress

The thread gets one status message from the agent: the issue, who has it, its state, and the agent's last three
progress reports. The message is edited in place. A report is a comment the agent posts on the issue, which is what
`tasks_issue_progress` does and what an agent on a computer does when it asks for something or finishes. Comments by
people on the issue are not shown.

| The status says | When |
|---|---|
| Handed to *agent* | the issue is delegated and nothing has been reported yet |
| *agent* is working | the agent claimed the issue, reported progress, or the issue is in a started state |
| Done by *agent* | the issue is in a completed state |
| Canceled | the issue is canceled |

## The pull request

A pull request links to the issue the usual way: the issue key in its branch name, title or body
([what links an issue](/docs/cloud/tasks-github.md#linking)). When GitHub's webhook delivers it, the thread gets a card:

- title, repository and number, and the state: draft, open, merged or closed
- checks and review, once GitHub has sent them
- the number of changed files and the lines added and removed
- **Files and diff**, when the organisation saved a GitHub token

The card is one message per pull request and is edited in place as checks finish and reviews arrive. At most five pull
requests per issue get a card.

**Files and diff** lists the changed files; open one to read its patch. The files are read from `api.github.com` when
you press the button, with the organisation's own token, and are not stored. You can read them if you can read the
message and the issue in Tasks. The first 100 files are listed. A binary file or a very large patch shows no text and
says so. Without a token the card has **Open on GitHub** instead.

## Merged or closed

When the pull request merges, the card changes to **Merged** and the agent posts one line in the thread, which
notifies the people in it. A pull request closed without merging gets "Closed without merging" the same way. Whether
the issue moves to Done on merge is the team's [merge rule](/docs/cloud/tasks-github.md#rules), as before.

## Permissions

- The agent can start work only where a channel owner ticked the tool for it, and never in a channel set to
  **Read-only** for it.
- Creating the issue, delegating it and commenting on it run with your role in Tasks. If your role cannot change
  Tasks, the reply says so and nothing is created.
- The thread shows the issue's title and state, the agent's own comments and the pull requests' titles to everyone in
  the channel. Start work in a channel where that is fine.
- Removing the agent from the channel, or archiving the channel, ends the updates. The issue stays as it is.
- The Venom agent itself does not take work; mention a service agent.

## For agents and scripts

| | |
|---|---|
| Allow it | `chat_agent_set` with `work_start` among `tools` |
| Confirm it | `chat_agent_action_decide` with the id from the reply's `meta.agent.pending` |
| Read the thread | `chat_thread_get`. The status message has `meta.work` (`issue`, `title`, `state`, `status`, `agent`, `lines`, `prs`); a card has `meta.pr` (`repo`, `number`, `title`, `url`, `state`, `checks`, `review`, `additions`, `deletions`, `files`, `canDiff`). |
| Read the diff | `chat_pullrequest_get` with the card's message id (REST `GET /api/v1/chat/messages/{message}/pull-request`): the card and `files` (`path`, `status`, `additions`, `deletions`, `patch`), `more` for files past the first 100 |
| Do the work | The agent's side is unchanged: `tasks_issue_list_mine`, `tasks_issue_claim`, `tasks_issue_progress`, and a pull request whose branch names the issue |
