Repository navigation
[pull] main from firecrawl:main - #382
Merged
Merged
Conversation
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>
This reverts commit cf1d31b.
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"
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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 : )