Skip to content

[pull] main from firecrawl:main - #382

Merged
pull[bot] merged 7 commits into
innFactory:mainfrom
firecrawl:main
Aug 20, 2026
Merged

pull[bot] merged 7 commits into
innFactory:mainfrom
firecrawl:main

Conversation

@pull

@pull pull Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

rakshith48 and others added 7 commits August 20, 2026 11:07
Flip the `/v2/agent` request schema default from spark-1-pro to spark-2.
The controller forwards `req.body.model` verbatim upstream, so requests
that omit `model` now run spark-2.

The status controller's model fallbacks stay on spark-1-pro: they only
fire for jobs whose stored options carry no model at all, which predate
the model option and really did run spark-1-pro. Comment added so the
divergence from the new request default doesn't read as an oversight.

README's model table claimed spark-1-mini was the default, which was
already wrong; it now lists spark-2 as the default.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
PR #4360 added spark-2 to the /v2/agent schema and made it the default,
but only touched apps/api. No SDK was updated, so spark-2 was
unreachable through the typed surface — the report that started this.

The bigger problem was the response side. GET /v2/agent/:id always
returns `model`, and it is now "spark-2" for any job that omitted one.
Two SDKs validate that field at runtime:

- Python: AgentResponse.model was a pydantic Literal, so parsing raised
  ValidationError. It is parsed by get_agent_status, which wait_agent
  and the blocking agent() wrapper both call — meaning the whole Python
  agent flow failed on the first status poll of a default-model job.
- Rust: the same shape via a serde enum with no matching variant.

Request-side `model` gains spark-2 in Python, JS, Rust, and the Elixir
validator; Java and Go already took plain strings and only needed the
docs corrected.

Response-side `model` is deliberately widened rather than extended:
Python takes a plain str and TS takes `| (string & {})`. The server
ships models without an SDK release, so an exact union here turns every
future model into a crash (Python) or a call-site type error (TS). Rust
gets the variant only — widening to String there would break consumers
matching on the enum, so it stays exhaustive and is a known recurrence
risk.

Regression tests cover a spark-2 status payload and an unreleased model
name; both fail against the previous Literal.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Addresses cubic review on #4363.

I had accepted the Rust response-side recurrence risk on the grounds that
widening `AgentStatusResponse.model` to `String` would break consumers
matching on the enum. That framed it as a binary I had not actually
tested: `#[serde(other)]` gives a catch-all without widening anything.

I had believed serde only permits `#[serde(other)]` on internally or
adjacently tagged enums. That is wrong for unit-only enums deserialized
from a string, which is exactly this case.

So `AgentModel::Unknown` is purely additive: the enum stays `Copy`,
every existing variant keeps its name and wire format, and request
construction is untouched. An agent status response naming a model this
release predates now parses to `Unknown` rather than failing the whole
`AgentStatusResponse` and taking down the status wait loop.

The one sharp edge is that `Unknown` serializes to "unknown", which the
API rejects, so the variant is documented as read-only.

Tests cover round-tripping all three known models and degrading an
unreleased name.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…test --lib

Two problems with the previous commit, both mine.

`cargo fmt --check` failed on tests/agent_model.rs. I ran cargo build and
cargo test but not the formatter, so I reported that change as verified
when I had only checked part of what CI runs.

Reading the workflow to find that out surfaced the second problem: the
Rust job runs `cargo test --lib`, which does not execute integration
tests under tests/. The regression test I had just added would have been
compiled and clippy-checked but never run — no protection at all. Moved
both cases into the existing `mod tests` in src/types.rs so they
actually execute. tests/audit_metadata.rs has the same gap, left alone
as out of scope here.

Verified against the whole workflow this time: fmt --check, build
--all-targets, clippy -D warnings, test --lib (67 passing), and build
--examples. Confirmed the moved test still fails with the Unknown
variant removed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ation-1b43f1

fix(sdks): add spark-2 to agent model types
…ark-2-agent

Revert "feat(agent): default to spark-2"
@pull pull Bot locked and limited conversation to collaborators Aug 20, 2026
@pull pull Bot added the ⤵️ pull label Aug 20, 2026
@pull
pull Bot merged commit 80e5b2a into innFactory:main Aug 20, 2026
1 of 11 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant