Agent: document partial results on credit-limit stops - #1506
Merged
Merged
Conversation
Document the stopReason, partial, partialSchemaValid and message fields that failed Agent runs may carry when they hit maxCredits, on the status endpoint, thread runs and the agent.failed webhook. Add a "Handling credit-limit stops" section with Python, Node and cURL samples that check stopReason, use the partial with care, and continue the thread to finish the work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
This branch was successfully deployed
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.
Source PRs:
agent.failedwebhooksWhat changed
features/agent.mdx): new "Handling credit-limit stops" section. It explains that a run that hitsmaxCreditsreportsstatus: "failed"withstopReason: "credit_limit_reached".datais still only set on completed runs. The run may carry a best-effortpartial,partialSchemaValid(only when a schema was sent) andmessage. Users should checkstopReasonrather than the error text, treatpartialwith care, and continue the thread with a follow-up to finish the work. Includes Python, Node and cURL samples, an example response, and short notes on the thread endpoint and the webhook. Thefailedstate row and themaxCreditsparameter row now point to this section.GET /agent/{jobId}inv2-openapi.jsongainspartial,partialSchemaValid,stopReasonandmessage. Theagent.faileddata entry inwebhooks-openapi.jsongains the same four fields.The docs say these fields "may be present". Credit-limit recovery is behind a server flag that starts off, so not every credit stop returns a
partial.Checks
scripts/check-extraction-hostile-markdown.shpasses.scripts/check-locale-api-literals.shhas the same 15 findings asmain, so this PR adds none. A JSON code example for the webhook was left out on purpose, because it would have added findings to every localizedwebhooks/events.mdxuntil the next translation sync.swagger-cli validate.🤖 Generated with Claude Code