# Live preview

A live preview runs the application a session works on, from the session's own code, and shows it
inside the session page. You can check the agent's work in the browser before you read a line of
the diff, and ask the agent to change the running application while you watch. A **Live** session
is built around the preview: no plan up front, just changes you ask for, one at a time. To show
the running application to someone outside your workspace, such as a customer, turn on its public
link: they open it in their browser, without a Productmind account, and can comment on it.

<Availability
  permission="Sessions: Update to start and stop a preview, to send changes and to share the preview through a public link." plan="A preview in
  the cloud draws on your plan's cloud allowance, and your plan can leave out a sandbox size or cap
  its hours each month. A preview on your machine is free. See Plans and limits." />

## Key concepts

**Preview.** The session's applications, started in development mode from the session's working
branch. Which applications start, and how, comes from the session's sandbox and its
applications. See [Sandboxes](/user-guide/engineering/sandboxes) and
[Applications](/user-guide/engineering/applications).

**Endpoint.** One address of the running preview, for example the web client or the API. A
preview can have several.

**Live editing.** Messages you send while a preview runs. The agent changes the code the preview
serves, and the application reloads with the change.

**Live session.** A session whose [category](/user-guide/sessions/overview#key-concepts) is
**Live**. It has no plan to approve: you start the preview first and shape the change as you go.
When you're happy, you open a pull request, and the agent writes a summary of what changed into the
session's plan.

**Review mode.** A mode of the preview in which you comment on what you see in the running
application, then send the comments to the agent. See
[Review mode on the live preview](/user-guide/sessions/live-preview-review).

**Public link.** A link to the session's live preview that anyone can open, signed in or not.
Each session has one, off until someone who can edit the session turns it on. It keeps working
while the preview stops and starts again, until it is turned off, regenerated or expires.

**Outside viewer.** Someone who opens a public link. They see the running application and can
comment on it, but nothing of the session, its agent or your workspace.

## The preview at a glance

The session's document opens with a row of tabs. **Plan** shows the session itself: its
repositories, tasks and pull requests, and its engineering plan. Each endpoint you open gets a tab of its
own, named after the endpoint. An open endpoint keeps running while you look at another tab, so
switching between tabs never reloads the application. The preview control sits right after the
last tab:

| You see | Means |
| --- | --- |
| **Start preview** | No preview is running. Choose it to start one. |
| **Launching...** | The preview is starting. Its progress shows in a **Starting preview...** tab. |
| **N endpoints**, and the time left | The preview is running. Choose it to open an endpoint in a tab of its own. The time left shows only for a preview in the cloud. |
| **Preview failed** | The preview couldn't start. Choose it to see why, and to start it again. |

While a preview is running, **Stop preview** (a square) sits right after the preview control. It
stops the preview, and the agent's current step if it is working: point at it to see which. At the
end of the row, **Open in new tab**, **Reload preview**, **Share this preview**, **Review** and
**Focus mode** act on the endpoint tab you are looking at. **Share this preview** shows only to
people who can edit the session.

While the preview has a public link that works, a **Public** badge shows after the preview control
and in the session's header, for everyone who can see the session.

## Using a live preview

### To start a live preview

1. Open the session.
2. Choose **Start preview** at the top of the document.

A **Starting preview...** tab shows the progress. When the preview is up, that tab becomes the
application's main endpoint. You can go back to **Plan** while the preview starts:
the endpoint then opens in its own tab without taking you away from the plan.

A preview in the cloud runs on the session's runner, which serves only that session. When the
session has no runner yet, the tab says **Waiting for a runner. Your run starts as soon as one is
free.**, then **Starting a runner. This can take a few minutes.** See
[Working in a session](/user-guide/sessions/working-in-a-session#how-a-running-session-behaves).

In a Plan or Bug fix session, **Start preview** is available once the session is in review: the
agent has implemented the plan and opened its pull request. Until then the code is still changing,
so the button is grayed out. After that it stays available, except while the agent works on the
session again, for example on review comments or on a message you sent; it comes back when the
agent finishes. A preview that is already running keeps running, and **Stop preview** always
works. In a Live session, choose **Start live preview** in the document.

### To open another endpoint

1. Choose the preview control (**N endpoints**).
2. Choose the endpoint to open it in a tab of its own, or copy its address. An endpoint that is
   already open is marked **Open**, and choosing it switches to its tab.

To close an endpoint, choose **x** on its tab.

### To focus on the preview

1. Open the endpoint's tab.
2. Choose **Focus mode** at the end of the row of tabs.

The main menu and the session header hide, and the preview fills the screen. The row of tabs moves
up into a slim bar at the top, where **Focus mode** becomes **Exit focus mode**, and
**Support center**, **Notifications**, **Integrations** and **PM agent** stay on the right of the
bar, smaller. The icons down the right side stay too, also smaller, and so does an open panel, so
you can keep asking the agent for changes while you watch. You can still switch between endpoint
tabs and open another endpoint. The preview doesn't reload when focus mode starts or ends.

To leave focus mode, choose **Exit focus mode**, or press Esc. Esc does nothing while you're typing,
for example in **PM agent**, or while the keyboard is in the preview: choose
**Exit focus mode** instead. Choosing **Plan** also leaves focus mode.

Focus mode ends by itself when the preview stops or starts again, when you open another session,
leave the session or reload the page, and when the window gets narrower than 1024 pixels.
**Focus mode** shows only in a window at least 1024 pixels wide.

### To ask for a change while you watch

1. With the preview running, open **PM agent**.
2. Describe the change, for example "Make the save button green", and send it.

The agent changes the code, and the preview reloads with the change. While the agent works you
can queue your next message. See
[Working in a session](/user-guide/sessions/working-in-a-session#sending-messages-to-the-agent).

You can also point at what should change: **Review** lets you comment on what you see in the running
application, then send the comments to the agent. See
[Review mode on the live preview](/user-guide/sessions/live-preview-review).

### To bring the session up to date with the base branch

1. Open **PM agent**.
2. Ask the agent to pull the latest from the base branch, for example "Pull the latest from
   development", and send it.

The agent merges the base branch's new commits into the session's branch, resolving any conflicts
in the same turn, and the preview reloads with the result. See
[Pull requests and reviews](/user-guide/sessions/pull-requests#to-bring-a-branch-up-to-date-before-a-pull-request-is-open).

### To finish a Live session

1. When you're happy with the changes, choose **Open PR** at the top of the **PM agent**
   panel.

The agent first runs the checks your repositories run on every pull request, such as type checks,
linting, tests and builds, and fixes what its changes broke. Then it commits and pushes the changes,
opens a pull request, and writes a summary of the session into its plan. The pull request's
description lists the checks the agent ran, and any it couldn't run or get to pass: the pull request
opens either way. While the agent works, the button reads **Opening PR...** and can't be pressed. If a pull
request couldn't be opened for one of the session's repositories, **Open PR** stays, so you can try
again.

Once the pull request is open, **Open PR** is no longer shown. Every change the agent finishes after
that is added to the open pull request and updates its description, and a repository the agent
changes for the first time gets a pull request of its own. When the agent is done, the session goes
back to waiting for your review, and **Merge** is available in the **Pull Requests** panel. See
[To merge a pull request](/user-guide/sessions/pull-requests#to-merge-a-pull-request).

**Open PR** is available once the agent has committed at least one change. It can't be pressed
while the agent is working.

### To stop the preview

1. Choose **Stop preview**, right after the preview control. In focus mode, it is in the bar at the
   top of the page.

Until the preview has stopped, the button spins and reads **Stopping the preview...**. The agent
stops its current step, if it is working, and the preview stops. The endpoint tabs close, focus
mode ends, and the document shows **Plan** again. The session stays open. To carry on, choose
**Start preview**.

Stopping the preview never loses the agent's work. Work from the steps the agent finished is on
the working branch already. The unfinished changes of a step you stop with the preview are pushed
to the working branch before it goes, and so are the changes of a step you stopped earlier with
**Stop turn**. While they are pushed, the button reads **Saving your changes, then stopping the
preview...**. An open pull request gets them; without one, **Stop preview** never opens a pull
request. See
[Stopping and restarting a run](/user-guide/sessions/stopping-and-restarting#to-stop-the-current-step-and-correct-the-agent).

A preview you stop stays stopped. It is never shown as failed: when you come back to the
session, it opens on **Plan**, and **Start preview** brings the preview back. Stopping a preview
while it is still starting closes its **Starting preview...** tab the same way.

To end the session instead, choose **Cancel session** in the page header. See
[Stopping and restarting a run](/user-guide/sessions/stopping-and-restarting#to-cancel-the-session).

## Sharing a live preview publicly

A public link lets people outside your workspace open the session's running application in their
browser, without a Productmind account, and comment on it. Anyone with the link can see the
application's pages, its API and the files its development server serves, but not the session,
the agent or any workspace data. Share it only with people you would show the work in progress
to: through a development server, they can see more than the finished application would show,
such as its source files and the data the preview runs on.

### To turn on a public link

1. Open the session, and open an endpoint's tab of its running preview.
2. Choose **Share this preview** at the end of the row of tabs, after **Reload preview**.
3. Read what the link shares, under **Public link**, then turn on the **Public link** switch.

Productmind issues a new link and shows it, with **Copy**, and the **Public** badge appears. The
link works for 7 days unless you choose otherwise. On a session's first link, comments are on and
AI replies are off; you can change both.

### To copy the link

1. Choose **Share this preview**.
2. Choose **Copy** beside the link.

The link is copied, ready to send. Only people who can edit the session see the link.

### To change how long the link works

1. Choose **Share this preview**.
2. In **Expires after**, choose **1 day**, **7 days**, **30 days** or **No expiry**.

The link now works for that long from now. Beside the choice, **Until** and a date says when it
stops, or **Never expires**.

### To choose the app the link opens

When the preview runs several applications, the link opens one of them first, and its viewers
can switch to the others.

1. Choose **Share this preview**.
2. In **Opens**, choose the application.

### To regenerate the link

Regenerate the link when it went to someone it shouldn't have, or to start its time again.

1. Choose **Share this preview**.
2. Choose **Regenerate link**.
3. Choose **Regenerate** to confirm.

Productmind issues a new link, and its time starts again. The old link stops working within
seconds: anyone you shared it with needs the new one.

### To turn comments or AI replies on or off

1. Choose **Share this preview**.
2. Turn **Viewers can comment** on or off.
3. Turn **AI replies to comments** on or off.
4. With **AI replies to comments** on, choose the research that guides the replies in
   **Research**. **General** is the default.

With comments off, viewers can still see the application, but not comment. With AI replies on,
an AI assistant answers each comment, asks follow-up questions, and saves the conversation as an
interview in the research you chose. Its replies use your organization's AI credits. See
[What people with the link see](#what-people-with-the-link-see).

### To turn off the public link

1. Choose **Share this preview**.
2. Turn off the **Public link** switch.

The link stops working within seconds, and the **Public** badge goes away. The link's choices are
kept. Turning the switch on again issues a new link: the old one never works again.

## What people with the link see

A public link opens a Productmind preview page, not the session. Along the top is a slim bar with
the Productmind mark, **Live preview** and **Public link · view only**, then a tab for each
application the preview runs, **Open in new tab**, **Reload preview**, **Comment** and **Your
comments**. The application fills the rest of the page and updates as the agent changes it. The
page shows no session name, workspace, conversation or agent.

| The page shows | When |
| --- | --- |
| The application | The preview is running. |
| **Starting...** | The preview is starting. The application appears by itself once it is up. |
| **This preview isn't running right now** | The link works, but the preview has stopped. The application appears by itself once someone starts the preview again. |
| **This link is no longer available** | The link was turned off, regenerated or expired, the session ended, or your workspace turned off public preview links. The page doesn't say which. |

**Commenting.** A viewer chooses **Comment**, then points at a part of the application or drags
over an area, as in [Review mode](/user-guide/sessions/live-preview-review). The comment keeps a
picture of what they picked. Before their first comment, the page asks for their name and email,
under **Before you comment**. Their browser remembers them; in another browser, they are asked
again.

**Their own comments only.** **Your comments** lists the viewer's comments, with the replies your
team and the AI assistant write in them. A viewer never sees another viewer's comments, or your
team's own preview comments. They can reply in their own comments until your team resolves them.

**AI replies.** With **AI replies to comments** on, the AI assistant answers each comment as it
is left, and asks follow-up questions, guided by the research you chose. If your organization's
AI credits can't cover a reply, the viewer reads "Thanks, we received your message. The team will
follow up with you." instead, and their comment is still saved.

**Small windows.** In a window narrower than 1024 pixels, the page shows the application only:
**Comment** and **Your comments** are hidden.

## How live previews behave

**Where changes go.** Every change the agent finishes during live editing is committed and pushed
to the session's working branch, so it isn't lost when the preview stops. A change you stop before
the agent finishes it stays in the preview, and is pushed when the preview stops or with your next
message.

| Session | A change you ask for |
| --- | --- |
| **Live** with no pull request yet | is pushed to the working branch. The pull request waits until you choose **Open PR**. |
| Any session with an open pull request | is added to the open pull request. |
| **Plan** or **Bug fix** with no pull request yet | is pushed to the working branch, without opening a pull request. |

**Previews stop on their own.** A preview in the cloud stops 30 minutes after the session's last
message, or after the time your workspace sets in
[Settings > Live previews](/user-guide/settings/workspace-settings/coding-sessions#live-preview-lifetime).
Each message starts the time again, and so does starting the preview. The preview control shows
the time left once five minutes have passed since the last message, and hides it while the agent
works. A preview runs for 8 hours at most, however often you send a message.

Five minutes before a preview stops, a notice under the tabs says so, and what happens to your
changes. Send a message to keep it running. Before it stops, the preview saves your work:

| Session | Before the preview stops |
| --- | --- |
| **Live** with no pull request yet | your changes are pushed and the pull request is opened, as **Open PR** would, without running the checks first. The pull request's own checks still run. |
| Any session with an open pull request | unsaved changes are pushed to the pull request, and the session goes back to waiting for your review. |
| **Plan** or **Bug fix** with no pull request yet | unsaved changes are pushed to the working branch, without opening a pull request. |

While it saves, the preview control reads **Saving changes...**. When the preview has stopped, the
session's conversation says where the changes were pushed, or what refused the push.

A preview on your machine has no time limit: it keeps running while the Productmind agent is
online.

**Builds keep working.** The agent can build and update pull requests while a preview is running,
and the running application picks up the changes.

**A running preview keeps its applications.** A preview runs the applications the session had when
it started. When you add a repository to the session while it runs, the preview says so, for example
**web was added after this preview started. Restart the preview to include it.** Choose **Stop
preview**, then **Start preview**, to include its applications. A repository you remove from the
session while the preview serves it stays on the preview's machine until the preview stops or
restarts, and is removed after that. Its changes are saved to its working branch first. See
[Changing a session's scope](/user-guide/sessions/changing-a-sessions-scope).

**A public link stops working within seconds.** Turning it off, regenerating it, its expiry, the
session ending and your workspace turning off public preview links each stop it, for the pages
already open on it too. A viewer then reads **This link is no longer available**.

**A session has one public link.** It keeps working while the preview stops and starts again.
Outside viewers never keep a preview running: it stops on its usual schedule, and the link then
shows **This preview isn't running right now**. A preview on your machine can be shared as well as
one in the cloud.

**Comments from outside reach your team, and the agent only when you send them.** Teammates see
them in Review mode, labelled **Outside viewer** and the viewer's name. **Send N to PM** never
takes them: each has its own **Send to PM**. See
[Review mode on the live preview](/user-guide/sessions/live-preview-review#comments-from-outside-your-team).

**Your team hears of new comments.** A new comment from an outside viewer, or their reply, notifies
the person who first turned on the link, the person who started the session, its assignees and the
person whose machine runs it, in the app, at most once an hour for each comment.

**AI conversations become interviews.** With AI replies on, each comment's conversation is saved as
an interview in the link's research. It ends when your team resolves the comment, when the link or
its AI replies are turned off, or after 24 hours without a new message. Productmind then summarizes
it, and turns what the viewer asked for into feature requests and bug reports. See
[Agentic interviews](/user-guide/feedback/agentic-interviews#how-agentic-interviews-behave).

**Every change to a link is recorded.** Turning it on or off, regenerating it and changing its
settings each appear in your organization's audit log, with who made the change.

**Where it runs.** A preview runs where the session builds: in the cloud, or on your machine with
the Productmind agent. The first preview of a Live session runs on your machine if your
Productmind agent is online, and in the cloud otherwise. See
[Productmind CLI](/user-guide/tools/productmind-cli). If your workspace has turned off Productmind
cloud sessions, a preview starts only on your Productmind agent, and a preview that was already
running in the cloud keeps running but takes no new change and opens no pull request. See
[Settings > Coding sessions](/user-guide/settings/workspace-settings/coding-sessions).

**A cloud preview runs at its sandbox's size.** A preview in the cloud runs on the size of the
session's sandbox, **Small**, **Medium** or **Large**, or **Medium** when the session has no
sandbox. It keeps that size until it stops: changing the sandbox's size applies to the
next preview. While it runs, the session's builds and changes run at the same size. See
[Sandboxes](/user-guide/engineering/sandboxes).

## Permissions

| To | You need |
| --- | --- |
| See a running preview, and the **Public** badge | **Sessions: Read** |
| Start or stop a preview, send changes, open the pull request of a Live session | **Sessions: Update** |
| Turn a public link on or off, copy it, regenerate it and change its settings | **Sessions: Update** |
| Allow or forbid public links in the workspace | The **Owner** or **Admin** role, in [Settings > Live previews](/user-guide/settings/workspace-settings/coding-sessions#public-preview-links) |

A public link changes only from the app, signed in as yourself: an AI assistant or an API key
can't turn one on, regenerate it or change it. Outside viewers need no Productmind account.

To comment on the preview in Review mode, and to send the comments to the agent, see
[Review mode on the live preview](/user-guide/sessions/live-preview-review#permissions).

## Limits

A preview in the cloud counts hours at its sandbox's size, measured by the second, so a 6-minute
preview uses 0.1 hours, and it draws on your plan's **Included cloud allowance** at that size's
price per hour: at €0.50 an hour, a 6-minute preview uses €0.05 of it. Every size shares the
allowance. Past it, with overage on, you pay for the seconds a preview ran at its size's price per
hour, never a whole hour for a short preview. The time a preview waits for a runner isn't counted.
Hosted coding sessions count the same hours and draw on the same allowance.

Your plan can also cap a size, or leave it out, with its **Sandbox hours limit**. The limit and the
allowance are checked when a preview starts, and a preview that is already running keeps running. A preview run by the Productmind agent on your
machine is free: it isn't counted and never charged. See
[Plans and limits](/user-guide/reference/plans-and-limits).

A Live session the Productmind agent runs on your machine is a user-hosted session. Starting its
preview is free. If your plan charges for sessions on your own machine, the session is charged
once, at your plan's per-session rate, when you send it its first change, and never again for that
session, however many changes and previews follow. A Live session that only previews is never
charged.

A public link's viewers can each leave up to 30 comments and replies an hour, and one link takes
up to 300 a day. The AI assistant answers up to 20 of a viewer's comments and replies an hour, and
up to 200 a day on one link; past that, the comments are saved without a reply. A comment's
picture can be up to 2 MB. A viewer who goes past a limit reads "You've sent a lot in a short time.
Try again in" and how long to wait.

## Troubleshooting

### Share this preview is missing

**Share this preview** shows only to people with **Sessions: Update**, and only while an endpoint's
tab of a running preview is open. Open one of the preview's endpoints instead of **Plan**.

### The Public link switch can't be turned on

The popover says why under the switch:
- "Public preview links are turned off for this workspace (Settings > Live previews).": an Owner or Admin
  turned them off. See
  [Settings > Live previews](/user-guide/settings/workspace-settings/coding-sessions#public-preview-links).
- "This session has ended.": a completed or rolled-back session can't be shared. A link left on
  can still be turned off.
- "Public links are not available on this deployment yet.": public links aren't available to your
  workspace yet.
- "Local previews cannot be shared.": the preview runs through a local setup that Productmind
  can't share.

### "This link expired. Turn it on again or regenerate it."

The link's time ran out, so it no longer opens for anyone. Choose **Regenerate link**, or turn the
**Public link** switch off and on again, to get a new link, then send it again.

### Someone says the link shows "This link is no longer available"

The link was turned off, regenerated or expired, the session ended, or your workspace turned off
public preview links. Open **Share this preview** to see the link's state, and send them the
current link.

### Start preview is grayed out

Point at it to see why:
- "Add a plan before starting a live preview.": draft the plan first, or use a Live session.
- "Available once the plan is implemented and the session is in review.": the agent has not
  finished implementing the plan yet. The button comes on by itself when the session reaches
  **PR Ready for Review**; you don't need to reload the page.
- "Available again once the agent finishes its current run.": the agent is working on the session
  again, for example on review comments or on a message you sent. The button comes back when it
  finishes.
- "Productmind agent ... is offline": the session builds on your machine. Start the Productmind
  agent, or move the session to the cloud. See
  [Starting a session](/user-guide/sessions/starting-a-session#to-choose-where-the-session-builds).
- "Cloud sessions are turned off for this workspace. Connect your Productmind agent to run it
  here.": your workspace runs previews only on Productmind agents, and none of yours is online.
  Choose **Connect your Productmind agent** for the steps.

### "Productmind cloud sessions are turned off for this workspace, so this cloud preview cannot continue live editing"

The preview was started in the cloud before your workspace turned off Productmind cloud sessions.
It keeps running, but takes no new change, and can't open the pull request either. Choose **Stop
preview**, then **Start preview**: it starts on your Productmind agent. See
[Settings > Coding sessions](/user-guide/settings/workspace-settings/coding-sessions).

### The preview isn't responding

When the application doesn't load, its tab says **The preview isn't responding**. Choose
**Reload preview**, or **Restart preview** to start it again. The dev server may still be
starting, or have stopped after a change: ask the agent to check it.

### The preview failed to start

The **Starting preview...** tab shows the error, with the end of the application's output, and
**Try again**. The preview control shows it too. Check the application's install and dev
commands. See [Applications](/user-guide/engineering/applications).

### "No application is attached to this session's sandbox"

None of the session's applications is in the preview. Attach the application to the session's
sandbox (see [Sandboxes](/user-guide/engineering/sandboxes#to-attach-applications)), or
add the application's repository to the session. An application that is attached to no
sandbox still previews with a session that carries its repository, but one attached to a
different sandbox only previews in that sandbox.

### The preview stops with "No runner became available for this session in time"

Productmind's cloud had no runner free for the session within 15 minutes, so the preview didn't
start and nothing was counted. Choose **Try again** in a few minutes, or run the preview on your
own machine: build the session with the Productmind agent. See
[Starting a session](/user-guide/sessions/starting-a-session#to-choose-where-the-session-builds).

### "Medium sandboxes are not included in your plan"

The message names the size of the session's sandbox. Your plan doesn't include that size in
the cloud: its **Sandbox hours limit** is zero, or your plan sets no price for it while it has a
cloud allowance. Choose another size for the sandbox (see
[Sandboxes](/user-guide/engineering/sandboxes#to-change-the-size)), or run the preview on
your own machine: build the session with the Productmind agent. The preview is free there, though
your plan may charge its per-session fee for the session once you send it a change. See
[Starting a session](/user-guide/sessions/starting-a-session#to-choose-where-the-session-builds).
Or move to a plan that includes the size.

### "Monthly limit of Medium sandbox hours reached"

Your organization has used that size's **Sandbox hours limit** for this billing period, and overage
doesn't lift it. Choose another size, run the preview on your own machine with the Productmind
agent, wait for the next billing period, or move to a plan with a higher limit. See
[Plans and limits](/user-guide/reference/plans-and-limits#reaching-a-limit).

### "Overage is off for cloud usage and your cloud allowance is used up"

Your organization has used its **Included cloud allowance** for this billing period, and its
overage switch is off. An Owner or Admin can turn overage on for the allowance on the **Usage**
tab: new previews of every size are then charged at each size's price per hour. "Pay-as-you-go
spending is paused for cloud usage" means your plan includes none of the allowance and its spending
is paused: an Owner or Admin can turn it back on there. See
[Usage](/user-guide/settings/billing-and-payments/usage#to-turn-overage-on-or-off).

## Related topics

- [Review mode on the live preview](/user-guide/sessions/live-preview-review)
- [Agentic interviews](/user-guide/feedback/agentic-interviews)
- [Settings > Live previews](/user-guide/settings/workspace-settings/coding-sessions#the-live-previews-tab)
- [Working in a session](/user-guide/sessions/working-in-a-session)
- [Pull requests and reviews](/user-guide/sessions/pull-requests)
- [Applications](/user-guide/engineering/applications)
- [Sandboxes](/user-guide/engineering/sandboxes)
- [Productmind CLI](/user-guide/tools/productmind-cli)
