Repository navigation
Serve the new AX Studio UX from the web app and connect live AX flows - #4
Merged
Merged
Conversation
Serves ux/ at / from ax-studio (embedded in the binary, or from disk with
--ux-dir for development; when dist/ is also built, the previous React pages
stay at /classic/ for comparison). In a plain static server (python3 -m
http.server in ux/), ux/env.js leaves window.AX_STUDIO null so the demo and
review routes continue to run unchanged.
Connected to the Go server (/api/* and /api/events SSE) and verified against a
live ax-local Kind + Agent Substrate + gVisor cluster:
- First-run setup (Set up AX on this computer) with real preflight checks,
custom server and task-runner image digests, streamed setup progress, and
Start / Stop / Remove lifecycle controls (including a checkpoint guard that
offers to pause running tasks before ax local stop).
- Where agents run: AX on this computer plus every cluster in the kubeconfig,
with Spring-to-Lake Aqueduct visual and per-cluster reachability, version
mismatch, and missing-install diagnostics. Studio remembers the selected
cluster locally without mutating the user's kubeconfig.
- Home: live task list grouped by multi-turn session, 4-stage pipeline bar,
quick-goal launcher, starter ideas, and Axel in the Clear Spring pool.
- New task and multi-turn follow-up: Antigravity, Claude Code, and Your own
image templates, prompt-clarity helper pills, 4-step readiness card with
Axel, visual Guardrails gateMap, editable ax.io/v1alpha1 Gateway + Workspace
+ Task YAML, Secret creation outside the sandbox, and automatic goal.text to
goal.spec fallback for older ax-server images.
- Task page: Pause (SuspendTask), Resume (ResumeTask), Delete, Send a
follow-up, Run on another cluster (ax promote --preflight-only then promote),
uncommitted sandbox Changes with per-file diffs, per-file Discard, Apply to a
local folder, Push to a branch, in-page interactive Terminal (ax ssh over
/api/sessions/* and SSE), and Sandbox & network gateMap.
- Live Command Palette (Cmd/Ctrl+K), keyboard shortcuts (?), and "Why an
axolotl?" story dialog.
Server fixes and additions:
- internal/studio/tasks.go: GET /api/tasks, GET /api/tasks/get, POST
/api/tasks/{suspend,resume,delete,apply-yaml}.
- internal/studio/sandbox.go & server.go: POST /api/tasks/discard-file and
git status --untracked-files=all so new files inside new directories show up
in Changes.
- internal/studio/guest.go: per-cluster mutex around EnsureGuestEndpoint so
concurrent requests share a single port-forward tunnel.
- internal/studio/env.go: container runtime check distinguishes "not installed"
from "daemon not running" on Linux; local-up retries once after a 2s warm-up
on transient kube-apiserver RBAC 403 ("nodes is forbidden") right after
docker start, and clears stale failed local-up state once ax-local is healthy.
- internal/kube/exec.go & local.go: BinDir() honors AX_HOME when AX_BIN_DIR is
unset, and InspectLocalCluster falls back to kind-<name> context if needed.
… Settings - Environment (Where agents run): tool discovery, local health states with Update/Repair, stage durations, cancelable operations with exit codes, AX image persistence, read-only remote cluster checks, install/upgrade/ uninstall flows, and collapsible cluster guide disclosures. - Tasks & resources: searchable/filterable All tasks view (#/tasks), worker Logs tab with agent-exit error detection, Workspaces/Gateways/Models listing and unused cleanup, multi-shell sandbox terminal with history/ANSI colors/Ctrl keys, and Studio-managed task move fallback (/api/tasks/move) when ax lacks promote. - New task, Home, Settings & navigation: prototype four-step New task layout with Customize workspace and More options, user greeting on Home, cluster switcher in the sidebar footer card, deep links, browser notifications, and consolidated Settings tabs.
Collaborator
|
@Raji14 feel free to merge and I will play around with it. I will do some clean up on the golang code and pin the latest ax lib on top of your change |
Contributor
|
Nice work, the loopback/Host/Origin checks and CSRF handling look solid. One thing before merge: the go.mod pin (Nov 14) misreads tasks from a current ax-server, since google/ax#605 renumbered the Task fields (state is read from the old attempt slot, goal collides with the old config field, and move's CreateTask sends old numbers). Bumping github.com/google/ax to main compiles; only the tests need Delete*Response → Empty and Goal{Spec} → Goal{Text}. Follow-up: internal/kube/tunnel.go duplicates the CLI's tunnel logic, github.com/google/ax/client (google/ax#640) now covers it. |
YoyinZyc
added a commit
that referenced
this pull request
Nov 19, 2026
* Add the baseline for ax studio web app- #3 AX Studio was an Electron app whose main process ran `ax` for the UI. It is now one Go binary, ax-studio, that serves the React UI and a small API on 127.0.0.1:8080 and opens it in the browser. The server stays thin: `ax` remains the source of truth, and the server only does what a browser cannot. - Run an allow-list of `ax` subcommands for the UI (version, ctx, get, apply, delete, suspend, resume, promote). - Stream the output of `ax local start|stop|delete` and `ax install` to the page. - Show, discard, apply locally, and push the uncommitted Git changes in a debug task's sandbox, over `ax ssh`. - Store an API key as a cluster Secret labelled ax.io/credential, read from stdin, for a Gateway to inject. - Bridge `ax ssh` sessions to the in-page terminal. The UI is updated for the v1alpha1 API: goal, sessionId, profile, workspace setup, and Gateways with egress allow-lists. Promotion runs `ax promote`. The server binds only to loopback, rejects other Host and Origin values, and requires a per-process session cookie plus a CSRF token for every change. From AX it imports only github.com/google/ax/pkg/apis/v1alpha1. * Serve the new AX Studio UX from the web app and connect live AX flows (#4) * Serve the new AX Studio UX from the web app and connect live AX flows Serves ux/ at / from ax-studio (embedded in the binary, or from disk with --ux-dir for development; when dist/ is also built, the previous React pages stay at /classic/ for comparison). In a plain static server (python3 -m http.server in ux/), ux/env.js leaves window.AX_STUDIO null so the demo and review routes continue to run unchanged. Connected to the Go server (/api/* and /api/events SSE) and verified against a live ax-local Kind + Agent Substrate + gVisor cluster: - First-run setup (Set up AX on this computer) with real preflight checks, custom server and task-runner image digests, streamed setup progress, and Start / Stop / Remove lifecycle controls (including a checkpoint guard that offers to pause running tasks before ax local stop). - Where agents run: AX on this computer plus every cluster in the kubeconfig, with Spring-to-Lake Aqueduct visual and per-cluster reachability, version mismatch, and missing-install diagnostics. Studio remembers the selected cluster locally without mutating the user's kubeconfig. - Home: live task list grouped by multi-turn session, 4-stage pipeline bar, quick-goal launcher, starter ideas, and Axel in the Clear Spring pool. - New task and multi-turn follow-up: Antigravity, Claude Code, and Your own image templates, prompt-clarity helper pills, 4-step readiness card with Axel, visual Guardrails gateMap, editable ax.io/v1alpha1 Gateway + Workspace + Task YAML, Secret creation outside the sandbox, and automatic goal.text to goal.spec fallback for older ax-server images. - Task page: Pause (SuspendTask), Resume (ResumeTask), Delete, Send a follow-up, Run on another cluster (ax promote --preflight-only then promote), uncommitted sandbox Changes with per-file diffs, per-file Discard, Apply to a local folder, Push to a branch, in-page interactive Terminal (ax ssh over /api/sessions/* and SSE), and Sandbox & network gateMap. - Live Command Palette (Cmd/Ctrl+K), keyboard shortcuts (?), and "Why an axolotl?" story dialog. Server fixes and additions: - internal/studio/tasks.go: GET /api/tasks, GET /api/tasks/get, POST /api/tasks/{suspend,resume,delete,apply-yaml}. - internal/studio/sandbox.go & server.go: POST /api/tasks/discard-file and git status --untracked-files=all so new files inside new directories show up in Changes. - internal/studio/guest.go: per-cluster mutex around EnsureGuestEndpoint so concurrent requests share a single port-forward tunnel. - internal/studio/env.go: container runtime check distinguishes "not installed" from "daemon not running" on Linux; local-up retries once after a 2s warm-up on transient kube-apiserver RBAC 403 ("nodes is forbidden") right after docker start, and clears stale failed local-up state once ax-local is healthy. - internal/kube/exec.go & local.go: BinDir() honors AX_HOME when AX_BIN_DIR is unset, and InspectLocalCluster falls back to kind-<name> context if needed. * Complete live AX Studio UX parity, task move fallback, All tasks, and Settings - Environment (Where agents run): tool discovery, local health states with Update/Repair, stage durations, cancelable operations with exit codes, AX image persistence, read-only remote cluster checks, install/upgrade/ uninstall flows, and collapsible cluster guide disclosures. - Tasks & resources: searchable/filterable All tasks view (#/tasks), worker Logs tab with agent-exit error detection, Workspaces/Gateways/Models listing and unused cleanup, multi-shell sandbox terminal with history/ANSI colors/Ctrl keys, and Studio-managed task move fallback (/api/tasks/move) when ax lacks promote. - New task, Home, Settings & navigation: prototype four-step New task layout with Customize workspace and More options, user greeting on Home, cluster switcher in the sidebar footer card, deep links, browser notifications, and consolidated Settings tabs. * Remove default task image setting (#9) * Remove the default task image from Studio AX is dropping the default task image: a task that names no image will be rejected. Studio no longer asks for one at setup or install, passes --default-task-image to `ax local start` and `ax install`, or reads AX_DEFAULT_TASK_IMAGE to show it in Settings and suggest it on New task. The AX server image and the runner volume image stay. * Show this computer and the kubeconfig before the first cluster answers The page drew nothing until the task list came back, so with a cluster that can't be reached it stayed on "Checking…" for over a minute. Render as soon as the environment is read. * Add a tag-triggered release workflow (#8) * Add a tag-triggered release workflow Pushing a vX.Y.Z[-PRERELEASE] tag tests ax-studio, builds it for Linux and macOS (amd64 and arm64) with `make dist`, and publishes the four archives and checksums.txt to a GitHub release for the tag. The binary reports the tag as its version, and a tag with a "-" is published as a prerelease. A manual run builds the archives and keeps them as workflow artifacts without publishing. The build runs npm packages, so the checkout leaves no token in the git config and only the publishing step is given one. * remove clobber * Refresh ax server dependency(go.mod) and use the shared ax client (#7) * Use the ax client package and ax promote, and build against current AX Studio now builds against AX main, where the proto field numbers, the goal field (goal.text) and the Delete RPCs' responses changed. - Connect through github.com/google/ax/client (ServerURL, Dial, CurrentContext, ListContexts) and drop Studio's own copy of the tunnel and kubeconfig code. Every handler passes its request context, so a request that is cancelled stops waiting for a port-forward. - Read the local cluster from `ax local status -o json` instead of probing the container engine and kind. - Running a task on another cluster is `ax promote` only. Studio's own move (POST /api/tasks/move) and its UI are removed. * Say what the buttons for AX on this computer do when you point at them Set up, Start, Update, Repair, Stop and Remove each get a tooltip that names the ax command it runs and what happens to your tasks. --------- Co-authored-by: Rajitha Leonhard <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings the new AX Studio Sanctuary UX (
ux/) onto the Go local web server (cmd/ax-studio) and wires every live workflow end-to-end against AX (axCLI, gRPC guest/API tunnels, and Kubernetes/Agent Substrate inspection), achieving feature parity withmain's desktop app while following the Sanctuary visual style, progressive disclosure, and WCAG 2.2 AA accessibility patterns./by default:ax-studioembedsux/in the binary (or serves directly from disk with--ux-dir uxduring development). If the legacy Vite bundle (dist/) is also present, it remains reachable at/classic/.ux/runs without a bundler. When opened via a plain static server (python3 -m http.server 8789),window.AX_STUDIOinux/env.jsstays unset and all seeded demo journeys/scenarios continue to work unchanged.--context,-a) on every call —~/.kube/configis never mutated.What's Included by Screen
1. Home (
#/) & All Tasks (#/tasks)git config user.name(internal/studio/user.go, customizable in Settings — never guessed from a username/LDAP), paired with Axel in the Clear Spring pool and a quick-goal launcher (Set up task).ListTasksup to 500) are grouped bysessionId(keeping multi-turn follow-ups together) into Needs you, Running, Paused, and Done sections with jump tiles, cluster/atespace scope controls next to Your tasks, and live relative refresh timestamps.Failedworkspace setup errors (lastSetupError), listing Models read-only, and offering one-click cleanup of unused Workspaces and Gateways.#/tasks): Searchable, filterable flat table (Task, Status, Template, Workspace, Where, Resources, Created) with live state counts, linked from the sidebar (See all), Home, and the Command Palette.2. Where Agents Run (
#/places) & First-Run Setup (#/setup)ax-local):os_arch,container_enginedistinguishing missing binary vs. stopped daemon,disk_space) and tool discovery (ax,kubectl,kindversions, paths, and supported CLI flags).Running,Starting or degraded,Not in your kubeconfig,Not answering,Stopped,Not set up) with per-layer status and elapsed stage durations (kind,substrate,workers,ax).Set up/Start/Update/Repair(ax local start),Stop(offering to pause/checkpointWorkingtasks first so gVisor state is saved), andRemove(ax local delete).serverImage,defaultTaskImage, and conditionalrunnerVolumeImage) validated as you type and saved inlocalStorage.~/.kube/config):GET /api/env/check) verifying Kubernetes version, node architecture/kernel,ClusterTrustBundle&PodCertificateRequestAPIs, defaultStorageClass, Agent Substrate deployments +WorkerPoolreadiness, andax-serverdeployment/image, with actionable next-step guidance and pre-filledgcloud container clusters get-credentialshints.ax install/ax uninstall), plus collapsible A cluster for AX needs and To set one up disclosures.POST /api/env/cancel), exit-code badges on failures, and a streaming Output panel at the bottom of the page.3. New Task & Multi-Turn Follow-Up (
#/new)@sha256:…digest validation), with out-of-sandbox API key storage (POST /api/secrets/credential->Gatewayheader replacement so raw keys never enter the sandbox).~/.kube/config(locked to the session's cluster on follow-ups).Failedworkspaces), or Empty workspace; debug access toggle (on by default locally, off on shared clusters); and Customize workspace for extra Git repos, setup commands (npm ci,pip install,go mod download,uv syncpills), inline files (AGENTS.mdquick-add), and MCP servers (whose hosts are added to the Gateway automatically).How to check it's done,Where to start,What not to change).Balancedvs.Locked down), resource limits (Small/Medium/Large/CustomCPU & memory), custom container command (shell-style quoting), plain-textNAME=valueenv vars, task name, andax.io/v1alpha1multi-doc YAML preview, raw editor,.yamldownload, and local file loader (with automaticgoal.text->goal.specfallback for olderax-serverbuilds).4. Task Detail (
#/task/<name>)Working), task outcome/output, and collapsible Details (sandbox actor & UID, previous attempt failure, labels, and raw conditions table).GET /api/tasks/logs) tailing Agent Substrate worker pods for the task's actor, visually separating agent output, runner lines, lifecycle events, and optional gVisor startup lines.git status+ unified diffs inside/workspace, per-file Discard…, Apply to a folder on this computer…, and Push to a branch….Workingtasks): Up to 4 tabbedax sshshell sessions with Up/Down command history, ANSI SGR colors, andCtrl-C/Ctrl-D/Ctrl-Lsupport.Promote/Move): Runsax promote --preflight-only+ax promotewhen available, and automatically falls back to Studio's API-driven move (POST /api/tasks/move) when the installedaxbinary lackspromote— supporting dry-run preflight plans, Gateway/Workspace/Task copying, optional/workspacefile streaming overax ssh, target atespace selection,--no-resume,--replace, and keeping/pausing/deleting the source task.ws-*/gw-*resources created for that task.5. Settings (
#/settings) & Navigationaxversions, loopback origin, kubeconfig, namespace, atespace switcher, image summary, and secret-redacted Diagnostics), Keyboard & commands (Command Palette, shortcuts, andaxCLI equivalents), Notifications (opt-in background browser notifications for tasks needing attention and completed operations), Accessibility (single-key shortcuts and reduced motion), and Appearance & story (System/Light/Dark theme, Home greeting name, compact list density, and Axel & the Clear Spring).?context=…&atespace=…) and Copy link preserve cluster/atespace context.Backend Changes (
cmd/ax-studio,internal/studio,internal/kube)cmd/ax-studio/main.go,ux/embed.go,internal/studio/server.goux/at/, add--ux-dirflag for live reload, inject/env.jsconfig, serve legacydist/at/classic/when presentinternal/studio/env.go,internal/studio/envcheck.goax,kubectl,kind),axflag probing, local cluster access & stage-duration tracking,GET /api/env/check,POST /api/env/{uninstall,cancel}, exit codes onEnvOpSnapshot, Linux Docker daemon check & warm-up retryinternal/studio/tasks.go,internal/studio/resources.goGET /api/tasks(limit 500),GET /api/tasks/get,GET /api/gateways/get,POST /api/tasks/{suspend,resume,delete},GET /api/{workspaces,gateways,models},POST /api/{workspaces,gateways}/deleteinternal/studio/logs.goGET /api/tasks/logsfilteringkubectl logs -l ate.dev/worker-poolJSON records for the task's actor and detecting non-zero agent exitsinternal/studio/move.goPOST /api/tasks/move(dryRunpreflight + backgroundtask-moveoperation copying Gateway/Workspace/Task via gRPC and optional/workspacetar pipe overax ssh)internal/studio/sandbox.go,internal/studio/guest.go,internal/kube/POST /api/tasks/discard-file,--untracked-files=allin sandbox status, per-cluster mutex aroundEnsureGuestEndpoint,AX_HOMEfallback inBinDir(), user display-name lookup (internal/studio/user.go)Known Upstream AX Constraints
ax sshdoes not allocate a PTY/TTY yet, so full-screen curses apps (vim,top) cannot run regardless of frontend terminal library; Studio provides multi-tab line shells with history, ANSI colors, and signals until guest PTY support lands.#/guardrailsexplains why) until AX exposes cluster/org-level guardrail policy APIs beyond per-taskGatewayresources.Verification
go vet ./...andgo test -race -count=1 ./...pass acrossinternal/kubeandinternal/studio(including new unit tests inenv_test.go,envcheck_test.go,tasks_test.go,logs_test.go,move_test.go,resources_test.go,user_test.go,server_test.go).node ux/tests/smoke_live.cjs— 96/96 checks passnode ux/tests/smoke_cuj2.cjs— 30/30 checks passnode ux/tests/smoke_cuj3.cjs— 20/20 checks passnode ux/tests/smoke_cuj45.cjs— 43/43 checks passnode ux/tests/smoke_general.cjs— all checks passax-localKind + Agent Substrate + gVisor (systrap) cluster on Linux and a multi-cluster stand-in setup covering first-run setup, remote cluster checks, task creation, Logs, Changes, multi-shell Terminal, task move dry-run & execution, All tasks filtering, and Settings.