Repository navigation
refactor(explorer): remove the task runner's embedded-host mode, which never runs outside Scale's hub - #24
Merged
Conversation
earakely-scale
approved these changes
Sep 30, 2026
polakamtejas
force-pushed
the
tejas/explorer-ui-remove-embed-mode
branch
from
September 30, 2026 21:32
c277968 to
1c4928c
Compare
…h never runs outside Scale's hub The explorer UI was forked from the hosted AgentEnvHub frontend, whose task runner ran inside an iframe in a host pipeline. There the parent page owned the task definition. The runner created the task from the parent's config (POST /api/v1/tasks), re-created it when that config drifted, rotated it to "start over", graded attempts the parent handed down, and reported runs, stars and materialized fields back to the parent. In this repository the host hook is a stub that always reports "not embedded", and the step editor that saved through POST /api/v1/tasks was never reachable. So none of that code runs, and the explorer has no POST /api/v1/tasks route for it to call. Removed: - lib/external-app - every window.parent check: the runner, the Universes Hub picker, the instance viewer's hidden context tab, the app shell's hidden sidebar - the runner's create-from-config, drift tracking, apply-before-run, start-over, grade-attempts, preferred-run, model-picker, run-cap, runs-per-click and parent-reporting code - the unreachable step editor Every removed branch was gated on a value only the host could set, so a top-level explorer page renders and behaves as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The runner's run flow (the request a run sends, a refused launch, picking up the started run from the instance poll, when polling stops, cancel) lived inside the page component, where the UI's node-only smoke runner cannot reach it. It now lives in lib/task-runner-run.ts, unchanged, and task-runner-run.smoke.ts drives it with a fake fetch: a run starts and surfaces its workflow id, a refused launch throws the backend's detail instead of leaving the page on "Starting…", the started run is selected once it appears, polling continues until it does, and cancel encodes both ids. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
polakamtejas
force-pushed
the
tejas/explorer-ui-remove-embed-mode
branch
from
October 1, 2026 05:55
1c4928c to
6770c09
Compare
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.
The explorer UI was forked from the hosted AgentEnvHub frontend. Its task runner was built to run inside an iframe in a host pipeline, and the parent page owned the task definition. So the runner:
POST /api/v1/tasks)None of that runs here. The host hook,
lib/external-app, is a stub that always reports "not embedded". The step editor that saved throughPOST /api/v1/taskswas already unreachable (its own comment said so). And the explorer backend has noPOST /api/v1/tasksroute.Removed
lib/external-app/and both uses (task-runner-page.tsx,universes-page.tsx).window.parent !== windowcheck:showRunContextprop)createTaskand bothPOST /api/v1/taskscallstask_configstartup branch,applyLatestConfig, the drift hash and bannergradeAllAttempts, the preferred-run stars, the model picker, the run cap, runs-per-click andauto_runsendResult/sendResultsand the trajectory/step warming that fed themWhy behavior doesn't change
receivedInputs,receivedOutput,window.parent !== window, orediting, which was never set true. Each was evaluated as the standalone value and simplified./task-runner/<id>, runs it, cancels a pending or running run, polls, and shows each instance. It still initialises once per mount, as before.handleRunloses itscountfan-out, which onlyruns_per_clickused. A single run launches, fails and reports exactly as before.Lines removed:
task-runner-page.tsx−1779/+77 (2403 → 701 lines),universes-page.tsx−125/+2,task-instance-viewer.tsx−25/+5,lib/external-app/index.ts−61,[[...slug]].tsx−10 (+89/−99 as shown, because the sidebar block dedents one level).Testing
New
ui/src/lib/task-runner-run.smoke.ts(31 checks) covers the run lifecycle, which the second commit moves unchanged from the page component intolib/task-runner-run.tsso the node-only smoke runner can reach it:detailinstead of leaving the page on "Starting…"Breaking the "keep polling while a started run hasn't appeared" rule, or dropping the backend
detail, each fails it.npx tsc --noEmit,npm run test:smoke(12 passed; the 2 skips need trajectory fixtures) andnpm run build:staticpass. NouseExternalApp,isEmbedded,window.parent,sendResult,parentTaskConfigorapi/v1/tasksPOST left insrc/.Browser, against
agent-env up:/task-runner/hello-flat, clicked Run: a new instance appeared, completed at 100%, and was auto-selected.Not changed here, noted for follow-ups:
handleEvaluatorSaved) and itsonEditEvaluator/onRerunFromStepprops were already unreachable before this PR.?projectId=is still forwarded on Run when present in the page URL.🤖 Generated with Claude Code
This PR appears safe to merge; no outstanding issue was identified in its changes.
What we checked:
Summary
The Explorer drops iframe-host task flows that depended on parent-page configuration, while keeping the standalone task-run lifecycle. It also removes iframe-only page controls and moves run-request and polling logic into a helper with smoke coverage.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Open task runner] --> B[Load task] B --> C[Start run] C --> D[Poll instances] D --> E[Select new instance] C --> F[Show launch error] D --> G[Cancel run]Reviews (4) · Last reviewed commit: "test(explorer): cover the task runner's ..."