feat(agent): add onTermsRequired to firecrawl_agent and keep terms fields in status - #445
Draft
rakshith48 wants to merge 3 commits into
Draft
rakshith48 wants to merge 3 commits into
rakshith48 wants to merge 3 commits into
Conversation
The agent service now only calls Alexandria providers whose data terms the
team has accepted, and reports the rest. Let MCP callers choose what
happens ("skip", "ask" or "fail"), forwarded as exchange.onTermsRequired.
Describe exchange.skippedProviders and exchange.requiresAction in the tool
description, and tell calling agents they must get the user's explicit
consent before calling terms/accept. Keep exchange, pendingApproval and
message in firecrawl_agent_status structured content so Codex-style
clients that read structuredContent do not lose them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Matches the extract-v3#182 scope cut: onTermsRequired is skip or ask, and exchange.error is gone. Describe each requiresAction provider digest as string | null and always present. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r sends Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been 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.
Why
Agent runs now call only the Alexandria providers whose data terms the team has accepted. Gated providers are skipped and reported back (firecrawl/extract-v3#182). MCP callers had no way to choose what happens, and the status tool's structured content dropped the fields that say what was skipped.
What changes
firecrawl_agenttakes an optionalonTermsRequired: "skip" | "ask", forwarded asexchange.onTermsRequired. If it's omitted, noexchangeis sent and the server default ("skip") applies. Any other value fails parameter validation, including"fail"(cut from v1 in the extract-v3#182 scope cut). There is no auto-accept mode.firecrawl_agentdescription now explainsexchange.skippedProvidersandexchange.requiresAction, and describes each provider'sdigestasstring | null, always present, withterms/showsupplying it when it is null. It tells calling agents: "Never call terms/accept without the user's explicit consent to that provider's terms; a data request is not consent." After consent, they run the accept call throughfirecrawl_scrapeand startfirecrawl_agentagain. The description stays under the 2,048-character cap (the budget test passes).agentStatusOutputSchemanow namesexchange,pendingApprovalandmessage. Without that, fastmcp drops them fromstructuredContent, and Codex-style clients never seeskippedProvidersorrequiresAction.onTermsRequiredargument and the consent rule) and CHANGELOG[Unreleased].Scope note: the MCP agent tool doesn't expose
threadIdorexchange.approvetoday, so an MCP caller can't use theaskmode'sapprovalIdcontinuation. The documented MCP flow is: get consent, callterms/accept, then run the agent again. The new run sees the acceptance. Exposing thread continuation on the MCP tool would be a separate change.Tests
tests/mcp-smoke.test.mjs, new case. The tool schema lists the enum, and the description carries the consent sentence.onTermsRequired: "ask"is forwarded asexchange: { onTermsRequired: "ask" }. Omitting it sends noexchange, and"fail"is rejected.firecrawl_agent_statusstructured content keepsexchange.skippedProviders,exchange.requiresAction,pendingApproval.kindandmessage.npm testgives 123 pass, 0 fail.tsc --noEmitis clean.npm run lintreports one error insrc/alexandria.ts:97(expandunused). It's already onmainand isn't touched here.Related PRs and deploy order
exchange.onTermsRequired; this PR must not release before it deploys, oronTermsRequiredcalls get a 400)NEXT_PUBLIC_AGENT_TERMS_OFFER)🤖 Generated with Claude Code