feat(agent): continue a thread from firecrawl_agent - #446
Merged
Merged
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>
…ecrawl_agent
firecrawl_agent now takes threadId, mode and an exchange object that mirrors
the gateway's agentExchangeSchema (enabled, toolkits, maxCalls,
requireApproval, approve, decline, onTermsRequired). After an ask-mode terms
offer and the user's explicit consent to terms/accept, a caller continues the
same thread with exchange.approve: {approvalId} (or decline) instead of
starting over.
MCP-side guards: approve/decline need threadId, cannot be sent together, and
the top-level onTermsRequired cannot disagree with exchange.onTermsRequired.
Status structured content also keeps suggestions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the top-level onTermsRequired shorthand and its merge logic; callers set exchange.onTermsRequired, exactly as the gateway's agentExchangeSchema defines it. Nothing has been released with the shorthand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rakshith48
force-pushed
the
rak/agent-thread-continue
branch
from
September 26, 2026 15:42
cdc04ca to
402264f
Compare
rakshith48
changed the base branch from
rak/agent-on-terms-required
to
main
September 26, 2026 15:43
rakshith48
marked this pull request as ready for review
September 26, 2026 15:44
- On a follow-up, send `urls: []` and `schema: null` (or `{}`) so they clear
what the thread inherits. POST /v2/agent directly because the SDK's
startAgent drops a null schema; errors are reported the same way.
- `exchange.toolkits` takes at most 5 slugs, the agent service's limit.
- `exchange.requireApproval` needs `mode: "chat"` on the same request: the
agent service checks the request's mode, not the inherited one, and the
gateway turns its 400 into a 500.
- README lists effort, maxCredits (API default 2,500) and
strictConstrainToURLs; the description-length test uses
CLAUDE_CODE_TEXT_CAP.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…clears The SDK drops a null schema, so clearing inherited urls/schema can't go through it. Keep today's behaviour: empty or null values are dropped and the thread's values are inherited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
0 issues found across 4 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Adds thread continuation and approve/decline/onTermsRequired handling to firecrawl_agent, widening the public MCP tool contract and adding terms/paid-call approval flows; the contract and approval-policy choices are the decisive factors.
Re-trigger cubic
Move the exchange options, approve/decline checks, terms-flow text and the pendingApproval/exchange status fields to a stacked PR. This PR keeps threadId and mode on firecrawl_agent (forwarded through the SDK), message and suggestions in the status output, the README arguments for effort, maxCredits and strictConstrainToURLs, and the CLAUDE_CODE_TEXT_CAP test fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 5 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
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
The Firecrawl Agent supports threads (
threadId,mode), butfirecrawl_agentcouldn't continue one. Every call started a new thread.What changed
firecrawl_agentaccepts:threadId(uuid): continue an existing thread.mode:"extract"or"chat".startAgent; firecrawl 4.40.0 forwardsthreadIdandmode. On a follow-up, omittedmode,urlsandschemacarry over from the previous turn.modelparameter. The gateway runs every request on spark-2, which threads need.CLAUDE_CODE_TEXT_CAP.firecrawl_agent_statusstructured content keepsmessage(the reply to a follow-up in chat mode) andsuggestions, next to the existingthreadId,threadTurnandmode.threadId/modearguments and a follow-up example.effort,maxCredits(API default 2,500) andstrictConstrainToURLsbullets.Tests
firecrawl_agent continues a thread. It covers:modelsent.threadId/modevalues, with a check that nothing is sent.CLAUDE_CODE_TEXT_CAP.npm test124/124 pass,tscclean, eslint clean on the changed files.npm run lintstill reports one error insrc/alexandria.ts:97; it's already onmainand not touched here.Known limitation
A follow-up can't clear an inherited
urlsorschema. The agent service clears them withurls: []orschema: null, but MCP drops empty and null values, and the SDK drops a nullschema. Left out for now to stay on the SDK.🤖 Generated with Claude Code