> ## Documentation Index
> Fetch the complete documentation index at: https://docs.overcut.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Interactive Sessions

> How interactive sessions work, comment routing behavior, and configuration options for ongoing conversations with agents.

Interactive sessions enable ongoing conversations between users and agents, maintaining context across multiple comments without restarting workflows.

> [!NOTE]
>
> For basic agent setup, see [Agent Session Action](https://docs.overcut.ai/docs/workflows/agent-session.md) and [Agent Differences](https://docs.overcut.ai/docs/workflows/agent-differences.md).

***

## How Sessions Work

> [card] Comment Routing
>
> Comments route directly to active sessions instead of creating new workflows.

> [card] Context Preservation
>
> Full conversation history maintained throughout the session.

> [card] Graceful Termination
>
> Sessions can be ended with keywords or interrupted by slash commands.

> [card] Timeout Control
>
> Configurable duration limits prevent sessions from running indefinitely.

## Session vs Standard Workflows

### **Standard Workflow**

Each mention or slash command creates a new workflow execution:

```
User: "@overcut review this"     → New workflow starts (mention trigger)
User: "What about line 45?"      → No workflow triggered (plain comment)
User: "@overcut /help"           → New workflow starts (slash command)
```

### **Interactive Session**

One workflow handles multiple comments:

```
User: "@overcut review this"     → Workflow starts, session becomes active
User: "What about line 45?"      → Routes to active session (plain comment)
User: "/done"                    → Routes to session, triggers completion signal, ends
```

***

## Comment Routing Rules

When a comment or Slack thread reply is posted, Overcut routes live conversations before it evaluates new triggers:

**1. Check for Active Run or Session**

Is there a workflow run or interactive session currently live for this PR, issue, or Slack thread?

**2. Route to the Live Conversation**

If yes, the message continues the existing run or session. It does not start a duplicate workflow.

**3. Evaluate Triggers**

If no live run or session exists, Overcut evaluates triggers normally and may start a new workflow.

> [!NOTE]
>
> Slack thread replies can be evaluated as **Trigger Event** `thread reply` only in [registered Slack channels](https://docs.overcut.ai/docs/integrations/slack) set to `Watch all messages`. An in-thread `@overcut` mention is a `mention` event, not a `thread reply` event.

***

## Session Configuration

### **Comment Handling Options**

Interactive sessions provide two key configuration options that control how they respond to user comments:

> [card] Listen to Comments
>
> Controls whether the session accepts and processes new comments from users.

> [card] Keep Session Open for Comments
>
> When enabled, session waits for user replies after agent responses before proceeding.

### **Configuration Details**

| Parameter | Description |
| - | - |
| `Listen To Comments` | Whether the session accepts new comments during execution. When false, the session will not accept new comments and will end when the agent completes its current step. |
| `Keep Session Open For Comments` | Whether to pause and wait for user input after agent completes. When true, the session will wait for an additional time for user reply. |
| `Max Duration (minutes)` | How long session stays active. When the session reaches the max duration, it will end and the flow will continue to the next step. |

## Session Termination

Sessions end when any of these conditions are met:

> [card] Time Limit
>
> `maxDurationMinutes` timeout reached

> [card] Manual Commands
>
> `/done` (ends session) or `/quit` (terminates workflow)

> [card] Slash Commands
>
> Any other slash command terminates session and starts new workflow

> [card] New Sessions
>
> Starting a new session terminates the existing one

### **Manual Termination Commands**

Two built-in commands provide direct session control:

* **`/done`**: Completes the current session step gracefully
* **`/quit`**: Terminates the entire workflow immediately

### **Slash Command Interruption**

Other slash commands provide immediate user control:

```
User: "@overcut help with this bug"  → Session starts
User: "Can you explain the error?"   → Routes to session  
User: "/review"                      → Session terminated, review starts
```

**What happens:**

1. Session receives termination signal
2. Session cleared from database (stops comment routing)
3. Agent gets 5 minutes to wrap up gracefully
4. New slash command workflow queues or starts

***

## Best Practices

> [card] Choose Appropriate Timeouts
>
> Match session duration to expected interaction length

> [card] Use Built-in Exit Commands
>
> Use `/done` to end sessions or `/quit` to terminate workflows

> [card] Design for Interruption
>
> Expect users to use slash commands to change direction

> [card] Plan Complementary Workflows
>
> Design workflows that work well together when users switch between them

### **When to Use Sessions**

**✅ Good for:**

* Interactive help and support
* Answering questions about code changes
* Collaborative problem-solving
* Expected back-and-forth conversation

**❌ Not suitable for:**

* Independent automation tasks
* One-time analysis or reviews
* Tasks that don't require follow-up

***

## FAQ

> [accordion] Can I stop a session early?
>
> Yes! Use `/done` or `/quit` commands, or any slash command to terminate gracefully.

> [accordion] What happens if other events occur during a session?
>
> * **Comment events** (including mentions): Route to the active session
> * **Slack thread replies**: Continue the live run or session first. If no run or session is live, replies in registered channels set to `Watch all messages` can match workflows with **Trigger Event** set to `thread reply`.
> * **Slash commands**: Terminate the session and start new workflow
> * **Other events** (labels, PR opened): Create new workflows that queue normally

> [accordion] Can multiple sessions be active at once?
>
> Only one active execution can be active at a time.

> [accordion] Do sessions work across all platforms?
>
> Yes! Sessions work consistently across GitHub, GitLab, Jira, Bitbucket, Azure DevOps, and registered Slack channels.

***

## Related Documentation

> [card] [Agent Session Action](https://docs.overcut.ai/docs/workflows/agent-session.md)
>
> Basic session setup and multi-agent coordination

> [card] [Advanced Trigger Execution](https://docs.overcut.ai/docs/reference/trigger-execution.md)
>
> How triggers, queuing, and slash commands work

> [card] [Agent Differences](https://docs.overcut.ai/docs/workflows/agent-differences.md)
>
> When to use different agent action types

> [card] [Slash Commands](https://docs.overcut.ai/docs/workflows/trigger-with-slash-command.md)
>
> Setting up and using slash command triggers


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.