docs(agent): document source-data retrieval, in-flight following, and agent errors - #1324
Draft
hmishra2250 wants to merge 4 commits into
Draft
docs(agent): document source-data retrieval, in-flight following, and agent errors#1324hmishra2250 wants to merge 4 commits into
hmishra2250 wants to merge 4 commits into
Conversation
… agent errors Adds a "Getting the agent's source data" recipe (artifact.updated -> snapshot fetch), a "Following a run in progress" section stating plainly that delivery is polling plus webhooks, and an Agent section in the error catalog with messages read verbatim from the v2 agent controllers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Review follow-up. The snapshot endpoint returns markdown, html, and text artifacts as the content itself and only JSON-encodes json artifacts, so the artifact recipes no longer decode every kind. The poll examples now keep polling past terminal status until the trace goes quiet, and the cURL one dedupes on eventId instead of reprinting the whole trace. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… files
Both messages are returned by the upstream snapshot route and proxied
verbatim by GET /v2/agent/{jobId}/snapshots/{snapshotId}, so callers see
them as-is. The cURL poll example now keeps its scratch files in a
mktemp directory it removes on exit instead of writing to the cwd.
Co-Authored-By: Claude Fable 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.
Summary
Closes the three biggest transparency gaps on the agent docs: how to get the raw content a run produced, how to follow a run while it's in flight, and what the agent endpoints return when they fail.
agent.idbefore sorting onproducerSequence) and "Getting the agent's source data" (artifact.updatedtoGET /agent/{jobId}/snapshots/{snapshotId}, decoding onlyjsonsnapshots and usingmarkdown/html/textsnapshots as-is). Cross-links the new error section from the traces note, and rewords the ~150-200 row ceiling to observed behavior only.## Agentsection: 10 error rows in ascending HTTP order, each message verbatim from the v2 agent controllers, the upstream snapshot route, or the shipped OpenAPI, plus a subsection mapping the fiveAgentTraceError.codevalues to one-sentence remedies and notingretryable.eventsresponse description, which told callers to order globally byproducerSequence.No localized files touched.
Verified, but deliberately left out
kindvalues and the snapshot handoff, but nothing in the API repo establishes that every scraped page's markdown becomes an artifact: the split between artifacts andtool_call.finishedresultpayloads is decided inside the agent service. The section is therefore written as "how to retrieve the artifacts a run produces", with an explicit caveat that artifacts are the run's output rather than a page-by-page archive. Needs confirmation from the agent-service owner before we can promise more.modeldefault fix. The task listed"default": "spark-1-pro"onGET /agent/{jobId}, but it is already"default": "spark-2"onmain(both the request enum and the status response), fixed by docs: overhaul agent endpoint reference, spark-2 default, trace/snapshot endpoints #1319. Nothing to change; theproducerSequencedescription correction took its place as the mechanical fix.example. Skipped. A 10-event example would have to inventtoolNamevalues andresultshapes that no schema onmainpins down, so field-level accuracy isn't something I can guarantee.toolNamevocabulary. Both are visible in code (statusexpiresAtiscreated_at + 24h) but belong to the agent service's contract, so they're held pending confirmation from its owner.jsonartifacts. The shipped snapshot reference states that thesnapshotfield is the artifact content as a string and that onlyjsonartifacts are JSON-encoded, and both SDKs hand the field back as a raw string without decoding it. The recipes now decodejsononly and use the string directly formarkdown/html/text. That is correct forjsonunder either encoding and matches the documented behavior for the text kinds, but the encoding is owned upstream, so the text-kind half is documented-not-tested.Invalid snapshot ID/Snapshot not found. Raised in review and now verified, so both rows are in the table. The snapshot route returns400 {"error": "Invalid snapshot ID"}for a non-UUID id and404 {"error": "Snapshot not found"}when no such snapshot exists, at https://github.com/firecrawl/extract-v3/blob/bf55aeae869d9c22ec8d87115c63bbc1b07eb687/src/routers/internal_extract.ts#L240-L251, on the route thatGET /v2/agent/{jobId}/snapshots/{snapshotId}proxies verbatim. Those bodies carry nosuccessfield, which is also what the section's shape caveat now documents.POST /agent. Real and verified, but they're an org-policy behavior shared with/scrapeand/crawlrather than agent-specific, so they belong in a threat-protection row, not the Agent section.🤖 Generated with Claude Code