Repository navigation
fix(sync): safely refresh Workers AI reasoning from search - #7453
Conversation
Action items
|
fb56436 to
063ff37
Compare
|
Addressed the three findings in the review:
Validation: 15 existing OpenRouter tests and 11 temporary Workers AI regression tests pass (154 assertions total), covering null preservation, new and gained toggle headers, preservation of authored notes, and repeated syncs. The temporary tests are outside the repository, keeping this PR to one provider file. |
Action items
|
063ff37 to
d550122
Compare
|
Follow-up to this review:
|
Action items
|
d550122 to
7198b28
Compare
|
Follow-up to the latest review:
|
Action items
|
7198b28 to
d0cdd3f
Compare
|
Re-evaluated each item against the catalogue-safety contract:
Pushed as the single squashed commit |
Action items
|
d0cdd3f to
78d5d51
Compare
|
Addressed the concrete partial-metadata gap in 78d5d51:
|
Action items
|
78d5d51 to
1be8e8c
Compare
|
Addressed the actionable findings in the latest revision:
The companion catalogue review also identified a concrete single mandatory effort as no caller choice. The mapper now emits |
1be8e8c to
8c14393
Compare
Action items
|
8c14393 to
61c0559
Compare
|
Rechecked both sources and clarified the explicit rule in 61c0559.
The PR description now includes the fresh payload and links to the separate catalogue/schema corrections so the evidence is available in the review input itself. |
Action items
|
|
Evaluated each item against the current source contract:
No code was changed solely to satisfy these conflicting scope requests. The two outstanding review tradeoffs are persistent test coverage and preserving curated prose until the companion catalogue correction merges; they need a maintainer's scope decision rather than another speculative code change. |
# Conflicts: # packages/core/src/sync/providers/cloudflare-workers-ai.ts
Action items
|
Refresh Workers AI reasoning from Search while keeping the catalogue safe. Changes are confined to the Workers AI provider.
Before: authored reasoning options always won, even when Search advertised corrected controls. After: valid model controls update the catalogue; invalid reasoning does not prevent other usable properties from updating. A concrete single mandatory effort means no effort choice (
[]);supported_efforts: nullnever expands to an enum. Reasoning budgets require explicitsupports_max_tokens: true.Verified GLM-4.7 exception: a fresh September 19 Search response for
@cf/zai-org/glm-4.7-flashcontains exactly:{"reasoning":{"mandatory":false,"default_enabled":true}}Its per-model ConfigAPI record matches. The verified Workers control is
chat_template_kwargs.enable_thinking, consistent with the creator's template, which switches the assistant prefix usingenable_thinking. The code requires this exact model ID plus explicitmandatory: falsewhen efforts and budget support are absent. Missing reasoning,{}, null/empty efforts, or an absent mandatory flag still preserve the catalogue. A future concrete Search effort list remains authoritative.The old catalogue header and published input schema still contain a shared low/medium/high enum. Those are the stale inputs being corrected: catalogue PR #7454 updates the header and controls; docs PR #33541 corrects the schema. They are separate from this provider-only change.
Curated headers are preserved. Unknown toggle wires retain existing reasoning; unreadable headers skip only that model. New reasoners without verified controls use the existing manual-authoring issue flow.
Validation: 19 temporary regression tests / 220 assertions pass, covering the preserve/update matrix, fixed mandatory effort, explicit GLM shape, header preservation/failures, unknown wires, retries and partial pages. All 15 existing OpenRouter tests pass. The PR author explicitly requested no tracked test file; that scope remains unchanged. The fresh GLM Search payload was replayed and produces toggle-only controls.