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

# Page Preview

> Chat with a workspace page and watch the workflow run.

Workspace pages include a top-right Preview button. Use it to chat with the page agent while the
app runs the current Procedure blocks and shows live activity beside the page.

## What it does

* Opens a right-side chat panel from the page header.
* Keeps the browser on the workspace page instead of navigating to `/chats/new`.
* Lets the user drag the Preview panel's left edge to resize the page and chat columns.
* Includes a new-thread action in the Preview header so a page test can be restarted cleanly.
* Lists prompts from the page's `## Test prompts` section.
* Sends each chat message to the direct Agents SDK Preview runner with the current Markdown page
  source. The server re-parses that Markdown into executable page nodes before running Preview.
* Saves the Preview thread to the same active AI chat list used by the sidebar when WorkOS and
  Supabase chat persistence are configured.
* Marks saved Preview chats as waiting for approval in the Chats sidebar when an approval-required
  step pauses, and lists the same request in the Approvals side panel.
* Opens saved Preview chats in the full chat route with the same visible activity feed and pending
  approval card shown in the page side panel.
* Lets the user reject a pending approval with inline feedback; Preview cancels the paused run and
  sends that feedback as the next user message in the same thread.
* Compiles inline `@` tags through the Procedure tag registry before execution.
* Treats `@read_person`, compatibility `@find_person`, `@create_person`, and
  `@create_position_sf` as supported Preview tools, asks the Agents SDK model planner to call them
  with their approved JSON schemas, and records their results in the activity trace.
* Shows a visible registry error when the Markdown contains an unknown `@tag`.
* Compiles authored `:::if` / `@condition` blocks into Classify Agent runtime nodes. The
  classifier returns a structured branch id, then the app routes deterministically.
* Returns a conversational assistant reply from the page Preview agent after the visible activity
  finishes.
* Shows an inline assistant reasoning feed for the Start input, agent steps, tool calls, Classify
  Agent decisions, database reads, and errors. The reasoning feed stays open while Preview is
  working, collapses after completion, and leaves the final assistant reply as a normal chat message.
* Keeps the raw event log boxed below the assistant reasoning feed for exact trace details and
  metadata.

## What it does not do yet

* It does not publish immutable Procedure versions.
* It does not run the full simulation library yet.
* It does not capture microphone or system audio.
* It only wires the first person-check Preview tool path, `@read_person` / `@find_person` then
  conditional `@create_person`, and one Classify Agent branch pattern for the first MVP slice.

## Requirements

Preview uses the workflow page run route, the Markdown procedure runtime compiler, the direct
Agents SDK Preview runner, and the Agents SDK Preview responder. Live model behavior needs WorkOS
AuthKit, an admitted signed-in user, and `OPENAI_API_KEY` configured on the server. The Run button also requires the connected Inngest worker and Supabase run storage.
Saved Preview threads also need the Supabase chat-thread environment used by the main chat surface.

If the key is missing, Preview fails visibly when it reaches model-backed tool planning or Classify
Agent evaluation instead of silently extracting tool arguments with deterministic parsing. When the
selected branch asks for `@create_person` or `@create_position_sf`, the model planner must call the
schema-backed tool with only schema-required fields unless the workflow Markdown asks for more.
People writes store identity facts; SuccessFactors org facts such as title, worker classification,
start date, and reporting line belong in `positions_sf`. The Preview agent response falls back to a
deterministic summary of the visible trace only after trace-backed work exists; it must not claim
hidden model reasoning or missing tool calls.

## Hosted documents and models

Hosted previews save document content and table data in the database, so edits survive
refreshes and redeployments. A new hosted environment starts with an empty workspace;
the local demo's example documents are kept separately. Saved revisions are retained
while the document exists; a revision-history interface is not yet available.

The default text agents use GPT-6 Astra. Chat offers Extra High, High and Balanced
reasoning profiles. Previously saved GPT-5.5 profile selections use the matching
Astra profile. Voice transcription uses a separate audio model.

## Runs and approvals

Run starts a background workflow. Its progress, result and approval decisions are saved, so refreshing or restarting the web app does not erase them. Open the saved chat to return to a run. An approval applies only to its specific pending request; the first decision wins and pending approvals expire after one hour.

Completed operations reuse their saved results when execution resumes. If a write is interrupted before its outcome can be confirmed, the run stops for review rather than repeating it automatically. Check the affected records before starting another run.

Hubbla is currently private. Sign in with an account provisioned by your administrator; public account creation is disabled.
