Code channel properties
Code channels contain structured properties that your app reads via the conversations.info API method under channel.properties and writes via the agents.conversations.setProperties API method (and related methods).
agent_session
This property is present on every code channel. It identifies the channel as an agent session and tracks its state.
| Property | Type | Description |
|---|---|---|
status | string | Session status: active, processing, suspended, or closed. Set via the agents.sessions.setStatus API method. |
encoded_agent_bot_user_ids | string[] | Bot user IDs of the agent(s) assigned to this channel. |
title | string | Display title of the session. Set via the agents.sessions.rename API method. |
origin_link | object | Where the session started: { "channel_id": "C…", "ts": "1234567890.123456" }. Present when the session was started from a message. |
Session statuses
Refer to the agents.sessions.setStatus API method page for details.
code_channel
Code-specific state for the channel. Your app sets context_bar_items and summary_message via setProperties. The remaining properties are recorded by the agents.conversations.setView API method as your app uses them.
This property is present on every code channel from the moment it is created, as {} until something writes to it. Don't use it to decide whether a channel is a code channel. Refer to recognizing a code channel.
| Property | Type | Description |
|---|---|---|
context_bar_items | object[] | Items displayed in the channel context bar. Maximum 5 items. |
summary_message | object | Records which message in the channel represents the current summary. |
summary_message
The summary_message sub-property lets your agent record which message in the code channel represents the current session summary. Clients can use the timestamps to fetch and display the summary. Set it via the agents.conversations.setProperties API method as code_channel.summary_message.
| Property | Type | Required | Description |
|---|---|---|---|
message_ts | string | Required | Timestamp of the summary message in the code channel. |
thread_ts | string | Optional | If the summary is a thread reply, the parent message timestamp. |
When the agents.conversations.archive API method is called with the summary_message_ts property, the handler persists the value as a summary_message channel property before archiving, so the summary remains discoverable after archival.
Managed properties
The following code_channel properties are maintained by Slack on behalf of your app. Yu read them, but don't set them directly via the agents.conversations.setProperties API method:
| Property | Set by | Description |
|---|---|---|
agent_session_views | setView | Unified view list spanning all view types (max 5). Each entry contains view_id, type, file_id, view_key, name, date_added, content_version. |
agent_session_views
The agent_session_views array is the canonical list of views attached to the channel. It contains all view types (html, diff, block_kit, canvas) in a single array. Each entry contains enough information for clients to render a view tab dropdown and determine which API to call for rendering:
| Property | Type | Description |
|---|---|---|
view_id | string | Encoded channel tab ID. |
type | string | View type: html, diff, block_kit, or canvas. |
file_id | string | Encoded ID of the backing file. |
view_key | string | Agent-assigned stable key. Absent for diff views. |
name | string | Display label for the view tab. |
date_added | integer | Unix timestamp of when the view was created. |
content_version | integer | Server-assigned content version. |
Context bar items
The context bar runs along the top of a code channel and holds up to 5 agent-supplied items; for example, quick orientation and quick actions for the people in the channel: repo, branch, PR, CI status, or anything else that helps users follow the session. Set them via the agents.conversations.setProperties API method as code_channel.context_bar_items. The array you send replaces the current set.
Schema
| Property | Type | Required | Description |
|---|---|---|---|
key | string | Required | Unique identifier for the item within the channel. Maximum 64 characters. |
label | string | Required | Display text. Maximum 128 characters. |
icon | string | Optional | Icon shown beside the label. Can be branch, folder, hierarchy, life-ring, link, globe, terminal, code, search, or lock. |
url | string | Optional | Makes the item a link to this URL. Maximum 2048 characters. |
item_type | string | Optional | info (default, informational) or action (interactive; clicking delivers a code_channel_action event to your app). |
A bot_user_id property also appears on items when reading them back; it is populated by the server to attribute the item to your agent and should not be set by your app.
Example
{
"channel_id": "C9876543210",
"code_channel": {
"context_bar_items": [
{
"key": "repo",
"label": "borant/billing",
"icon": "folder",
"url": "https://github.com/borant/billing"
},
{
"key": "branch",
"label": "agent/migrate-cron",
"icon": "branch",
"url": "https://github.com/borant/billing/tree/agent/migrate-cron"
},
{
"key": "pr",
"label": "PR #42 is open",
"icon": "hierarchy",
"url": "https://github.com/borant/billing/pull/42"
},
{
"key": "ci",
"label": "Tests passing",
"icon": "terminal",
"url": "https://github.com/borant/billing/actions/runs/12345"
},
{
"key": "create-pr",
"label": "Create PR",
"icon": "hierarchy",
"item_type": "action"
}
]
}
}
agent_resource
For sessions centered on an external resource, setProperties accepts an agent_resource object instead of, or alongside, code_channel:
| Property | Type | Description |
|---|---|---|
url | string | URL of the external resource. Maximum 2048 characters. |
resource_type | string | Type of the external resource. Maximum 64 characters. |
title | string | Display title of the external resource. Maximum 255 characters. |
provider | string | Provider of the external resource. Maximum 64 characters. |
record_channel
Code channels are also marked with a record_channel property block with record_type: "agent_channel".
Recognizing a code channel
record_channel.record_type === "agent_channel" is the check to use. It is set when the channel is created, is never absent from a code channel, and never appears on any other kind of channel, so it is correct for every code channel regardless of when it was created or how far along its session is:
{
"properties": {
"record_channel": {
"record_id": "AC:9819220113844:11770567636866:C0BR6NP78F5",
"record_type": "agent_channel"
}
}
}
The agent_session and code_channel properties are also present on every newly created code channel, so either can serve as a proxy. Prefer record_channel anyway: code_channel in particular is about the channel's code metadata, so an empty {} means "no metadata yet", not "not a code channel", and code channels created before that key was seeded at creation may not carry it at all until your agent writes to it.