preview.url opened in a browser shows the Console, not your app. It is
scoped to a caller holding a token, and an anonymous request is not refused —
it falls through to app.gobare.dev and answers 200 with the Console’s own
page. So a reader who copies that address out of a session, pastes it into a
tab and sees something that is plainly not what the agent built concludes the
agent built nothing.
published_url is the one to hand to anyone else, and it is null until you
publish. That is the next section.
Requirements
Publishing exposes a port. The agent must have started a server on it and told the workspace about it — in the agent’s own words,preview(3000).
Ask for it in the same sentence as the work:
port is the signal. Until it is set there is nothing to publish, and asking
anyway is refused rather than answered with an address that returns errors —
you would hand that address to someone before discovering it was empty.
Publishing
Sleeping and waking
Publishing grants a stable route, not a permanently running computer. An idle workspace is still paused on the usual schedule; the first public request wakes it. A visitor waits a few seconds, and then sees the site. So a published preview is not a hosting product, and it is not billed like one. It is the agent’s work, left reachable.Unpublishing
200 too, with the same
body. A teardown that runs twice, or one racing a person doing it in the
Console, has already got what it asked for — and the two answers are
indistinguishable, which is what makes the retry safe. A session id that does
not exist is still not_found; that refusal means something.
Deleting the session removes the address too — see
design-decisions.md on why DELETE destroys the
workspace rather than archiving it.
Errors
Republishing to the address you already hold is not a conflict — it answers
200 with the same URL, because that is what a retry looks like. Unpublishing
twice works the same way, for the same reason.
Both routes honour Idempotency-Key like every other write — see
idempotency.md.
Every refusal on this page arrives in the shape described in
errors.md; if you have a symptom rather than a code, start at
troubleshooting.md.
Next
- input.md — asking the agent to serve something
- sessions.md — giving the session a repository to build from
- guides/an-agent-behind-your-api.md — running this from your own backend