Repository navigation
Commit 24207bc
feat(tracking): keep the searches the OpenAI API model ran as its query fan-out (#1756)
* feat(tracking): sample ChatGPT's query fan-out one day a week through Cloro's legacy interface
ChatGPT's default (mobile-web) interface has carried no query text since
2026-09-30, so its tasks stopped asking for fan-out (#1119). Cloro's legacy
desktop interface (`legacy: true`) still returns `searchQueries`, at the
add-on's +2 credits a task.
- CLORO_CHATGPT_FANOUT = off | sample | all (default sample). On sample a
prompt's ChatGPT task asks one UTC weekday a week, picked from a hash of
the prompt id (no stored state, spread across the week). That day's answer
is the tracked one; no extra request.
- The tracking worker decides per task and passes `legacy` to
submitScraperTask / buildRequestBody, which stays pure. A legacy task
Cloro refuses is submitted again without it.
- Health report: on sample, ChatGPT is judged over the last 7 days (flagged
when none of its answers carried fan-out) instead of day against days
before, which swings by design; on all it is expected daily; on off it
is not judged.
- Docs: env var in self-host docs and .env.example; Prompts guide explains
the weekly sample.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(tracking): retry failed legacy ChatGPT tasks and keep fan-out to nightly runs
Review follow-ups for the sampled ChatGPT fan-out.
- A legacy ChatGPT task that Cloro takes and then fails goes once more
without legacy, in both paths: the webhook reads it from the new
cloro_pending_tasks.legacy column (00378) and swaps in the new task's
pending row; polling uses the submission's own record.
- A refused submission is sent again without legacy only on 400/422.
submitScraperTask errors now carry the HTTP status; a network error,
timeout, 429, 5xx, 401 or 402 is never resubmitted, since the first task
may exist and be billed.
- Only the nightly run's first attempt asks (source 'cron', attempt 1):
manual runs, analyze-new, retries and recovered runs don't.
- CLORO_CHATGPT_FANOUT unset: sample on the cloud, off on self-host. An
unknown value is off and logged once.
- Health report: sampled ChatGPT needs 7 x FANOUT_MIN_ANSWERS answers before
a silent week or a silent day is flagged; if the extra days can't be read,
only ChatGPT goes unjudged.
- Web: ChatGPT is neither "shares" nor "not shared" on the Query Fan-out
page, and its copy says ChatGPT's searches are sampled on some days.
- Docs: per-location cost, nightly-only, and the UTC-midnight caveat; the
probe notes the legacy sources/footnote check still to run.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* feat(tracking): keep the searches the OpenAI API model ran as its query fan-out
ChatGPT's fan-out has come only once a week through Cloro since
2026-09-30. The OpenAI API model's answers carry theirs already: the
Responses web_search calls hold the queries they ran. They were dropped.
- openai-tracker.js: searchQueriesOf reads each web_search_call's search
action (`query`, and `queries` when given; open_page and find_in_page
aren't searches) into the fan-out shape [{ query, source_platform:
'chatgpt' }], trimmed and once each. From the same response: no other
call, no extra cost.
- tracking-worker.js: the model path's insertResult keeps search_queries,
as the scraper path does (Claude's gives none: an empty list).
- The Query Fan-out page counts `chatgpt` (the API model) among the
engines that share their searches (fanout-platforms.ts), and the daily
health report expects it (FANOUT_EXPECTED), its warning pointing at
OpenAI rather than Cloro.
On Cloud, API-model tracking is off on every plan (allowedModels []), so
this shows where an OpenAI model is tracked: self-host, or an Enterprise
plan_overrides. ChatGPT's own interface (chatgpt-web) is unchanged here.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(tracking): judge the OpenAI API model's fan-out on a drop only
Review follow-ups for the API model's query fan-out.
- Health report: `chatgpt` leaves FANOUT_EXPECTED. gpt-5-chat-latest may
run web_search rarely or not at all, so a silent day is no news; a fall
from the days before still is, and points at OpenAI.
- Web: `chatgpt` is neither "shares" nor "not shared" on the Query Fan-out
page; fanout-platforms.test.ts checks fanoutSharing's answers rather than
the lists.
- searchQueriesOf reads the action's `queries` first (`query` is
deprecated) and skips web_search calls whose status is `failed`.
- Copy: the Prompts guide calls it "ChatGPT API" as the page does and says
Claude and Gemini models' searches aren't captured yet; the empty state
and coverage tooltip mention the API model.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Cihan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Gökhan Geyik <[email protected]>1 parent 144e8a2 commit 24207bc
9 files changed
Lines changed: 211 additions & 16 deletions
File tree
- docs/guides
- server/src
- lib
- health
- workers
- web
- messages
- src/config
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
178 | 182 | | |
179 | 183 | | |
180 | 184 | | |
| |||
399 | 403 | | |
400 | 404 | | |
401 | 405 | | |
| 406 | + | |
| 407 | + | |
402 | 408 | | |
403 | 409 | | |
404 | 410 | | |
405 | | - | |
| 411 | + | |
406 | 412 | | |
407 | | - | |
| 413 | + | |
408 | 414 | | |
409 | 415 | | |
410 | 416 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
267 | 283 | | |
268 | 284 | | |
269 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
24 | 59 | | |
25 | 60 | | |
26 | 61 | | |
27 | 62 | | |
28 | 63 | | |
29 | 64 | | |
30 | 65 | | |
31 | | - | |
| 66 | + | |
32 | 67 | | |
33 | 68 | | |
34 | 69 | | |
| |||
68 | 103 | | |
69 | 104 | | |
70 | 105 | | |
71 | | - | |
| 106 | + | |
72 | 107 | | |
73 | 108 | | |
74 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
945 | 945 | | |
946 | 946 | | |
947 | 947 | | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
948 | 952 | | |
949 | 953 | | |
950 | 954 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8191 | 8191 | | |
8192 | 8192 | | |
8193 | 8193 | | |
8194 | | - | |
8195 | | - | |
| 8194 | + | |
| 8195 | + | |
8196 | 8196 | | |
8197 | 8197 | | |
8198 | 8198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
31 | | - | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
0 commit comments