Repository navigation
feat: inspect endpoint, a screenshot and a render report for agents - #38
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mits Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Renders behind GET /api/v1/inspect now go through a small semaphore created once from the inspectConcurrency config key (default 1, env INSPECT_CONCURRENCY). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
POST requests to declaredErrorUrl are answered by capture with 204 and never sent, their message is reported under declaredErrors and makes the verdict errors. Data-fair applications declare their configuration errors this way, a render must not write them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/inspect checked secretKeys.capture, so enabling it locked /screenshot and /print, that browsers and other services call without a secret. It now requires secretKeys.inspect and is disabled without it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Add
GET /api/v1/inspect, an internal endpoint that renders a page with the caller's cookies and returns{ image, text, report }: a PNG screenshot, a text report in the format of Playwright MCP, and the same report structured.triggered,idle,timeout), plus a verdict (ok,errors,timeout,unauthenticated).declaredErrorUrl(same host astarget): the page's POST requests to this URL are answered with 204 by capture and never sent, and theirmessageis reported underdeclaredErrors. This is how data-fair applications declare their configuration errors.mobile,fullPage(clipped at 3000px),width/height,lang,timezone.INSPECT_CONCURRENCY(default 1) caps simultaneous renders. A render is skipped when the client left while queued. A main frame that navigates away from the target host makes the verdicterrors.SECRET_INSPECT. The endpoint is disabled without it, and enabling it doesn't lock/screenshotand/print, which keepSECRET_CAPTURE.Why: data-fair's
preview_applicationand portals'preview_portal_pageagent tools let autonomous agents see what they configured. An agent needs the picture and a textual diagnosis it can read, not just a screenshot.Heads-up:
/screenshotand/printgo through the sameopenInPageandwaitForPage, which now return the readiness and accept the inspect options. Without those options their behavior is unchanged, but this shared path is the part to review hardest.SECRET_INSPECTon capture to theSECRET_CAPTUREvalue of data-fair and portals, and leave capture'sSECRET_CAPTUREunset while browsers and other services call/screenshotand/printdirectly. Callers must reach capture through its internal service URL:/inspectrefuses requests carryingx-forwarded-host.