Repository navigation
Add a run viewer to the gateway - #50
Closed
jacobprall wants to merge 4 commits into
Closed
jacobprall wants to merge 4 commits into
jacobprall wants to merge 4 commits into
Conversation
The gateway serves a read-only viewer at /runs when FACTORY_VIEWER_PASSWORD is set: a plain HTML/CSS/JS page and two JSON routes, /api/runs and /api/runs/:traceId/events, behind HTTP Basic auth (user "factory"). - No dependencies or build step. Runs are listed newest first with keyset pagination on events.id; a run's events load when it is expanded. Every value is set with textContent, and the page is served with a strict CSP. - Styled to Render's brand foundations: semantic tokens in light and dark, square corners and hairlines, mono for metadata, purple only for links and the primary action, and green/red only for done/failed. - Migration 0002 adds the two indexes the viewer reads through and drops the unused run-claim index. - Takeover and /factory cancel record run.finished for the run they stop, since Render kills a cancelled run before it can record how it ended. - render.yaml generates FACTORY_VIEWER_PASSWORD on the gateway.
The runner's invalid_submission message now ends with the last attempt's schema problems (paths and rule names only, never submitted values), so agent.finished and the run viewer show why an agent was stopped. GitHub keeps the generic message.
Agent output schemas are now strict, so a misspelled field (relevant_paths for relevantPaths) is rejected by name in the error the model sees, instead of being dropped as an extra while the real field reads as missing. When an agent is stopped for invalid submissions, the message also lists the top-level field names it sent (names only, never values).
Collaborator
Author
|
Superseded by the Postgres removal PR: the run viewer read from Postgres, and we're keeping the template database-free. Its telemetry, rejection-reason, and strict-schema fixes carried over. |
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
When
FACTORY_VIEWER_PASSWORDis set, the gateway serves a read-only run viewer at/runs, behind HTTP Basic auth (userfactory). It lists task runs newest first; expanding one shows its events.app/gateway/viewer/) and two JSON routes,/api/runs(keyset pagination onevents.id) and/api/runs/:traceId/events. There's no build step.textContent, never parsed as HTML.script-src 'self').no-storeand can't be framed.render.yamlgenerates one.DATABASE_URL, the API answers 503 with "telemetry is off".0002: adds the two indexes the viewer reads through, and drops the run-claim index nothing queries any more./factory cancelnow recordrun.finishedfor the run they stop. Render kills a cancelled run before it can record how it ended, so those runs used to look like they never finished.Verification
npm run check: lint, typecheck, and 107 tests. New tests cover auth (off unless configured; 401 without the password, for the page and the API), pagination and input validation, the "telemetry off" response, and therun.finishedevent recorded on a stopped run's behalf.factory-dband reviewed the page in a browser, in both themes, with runs expanded into their events.