Add Reference section for PandaScript - #78
Open
cdebled wants to merge 3 commits into
Open
Conversation
…ventions and errors
…new reference for exhaustive detail
This was referenced Aug 5, 2026
arrufat
reviewed
Aug 6, 2026
arrufat
left a comment
Collaborator
There was a problem hiding this comment.
Really nice work on this one. I checked everything against browser main (f55aa1a66): the error strings, positional orders, extract forms, wait semantics and return strings all match the source, and both skill.zig bugs you flagged are real and still unfixed. Two small drifts from changes merged after your snapshot, plus one broken anchor, in the inline comments below.
…tForScript's state-dependent timeout, fix broken #primitives anchor
arrufat
approved these changes
Aug 7, 2026
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
reference/pandascriptpage documenting the primitives, calling conventions, extraction schema and full error list of the PandaScript runtime, sourced from the browser'ssrc/script/Runtime.zig(execution semantics and error strings),src/script/Schema.zig(positional argument order),src/browser/tools.zig(recorded tool list, return values, timeout defaults) andsrc/Config.zig(thewaitForStatestates)usage/pandascript.mdxdown to a practical guide (execution model, worked examples), linking to the new reference for exhaustive detailbrowser@33763f70(origin/main):awaitandgotoare asynchronous, not synchronousreturnstatement, not its last bare expressiongoto's resolve/reject behaviorpress's target-element behaviorpage handle is no longer validdoesn't actually happen on every same-object re-goto; a successful re-goto rebinds the handle and keeps working. The real trigger is a re-goto that fails or times out: the old frame is torn down before the new navigation's outcome is known, so a rejected navigation leaves the handle bound to an already-removed frame<tool> failed: <ZigErrorName>fallback error, arguably the most common one in practice (e.g.click failed: NodeNotFoundfor a bad selector)browser, not in these docs — both insrc/script/skill.zig(the LLM-facing prompt used by/save), worth fixing upstream:skill.zig:195's.gotonote claims "a timeout does NOT reject";Runtime.zig'ssettlePending(.timed_outbranch) rejects with"navigation timed out". The opposite is true.skill.zig:313's "Common errors" table has the same wrongpage handle is no longer validexplanation described above.This PR is part of a series splitting the new Reference section (CLI, MCP tools, HTTP API, PandaScript) into smaller pieces so each can be reviewed and merged on its own: #76 (CLI reference), #77 (MCP tools reference).
Two related cross-references belong to #76's files —
reference/cli/agent.mdx's/savecommand row andusage/agent.mdx's extraction-schema link, both pointing at/reference/pandascript— and aren't included here to keep this PR scoped to its own files. Add them to #76 once this PR merges.