Repository navigation
fix(tracking): stop submitting Grok tasks while Cloro returns 500 for all of them - #734
Merged
Merged
Conversation
… all of them Every Grok task Cloro accepts has been answering 500 since 2026-08-18. A run that still lists the platform submits one paid task per prompt per region, holds the drain open waiting for callbacks that never arrive, and records nothing — so Grok is dropped before submission rather than failing task by task. The filter lives in the tracking worker and nowhere else. Removing Grok from the engine picker would also remove it from ALL_SCRAPERS, which filterByPlan and alignPromptsToPlanForOrg use as the allow-set when writing prompts: every prompt edit and every plan change would then quietly strip the stored id, and bringing Grok back would need a data repair instead of a revert. Prompts keep their selection; only the submission is skipped. The existing shopping filter moves into the same helper, since both answer one question — which stored platform ids should this run actually pay for — and both have to be decided at run time rather than trusted from the saved array. Emptying UNAVAILABLE_PLATFORMS restores Grok on the next run.
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.
Summary
Cloro is returning 500 for every Grok task. Until that clears, a nightly run that still lists the platform submits one paid task per prompt per region, holds the drain loop open waiting for callbacks that never arrive, and stores nothing for the trouble. This drops Grok before submission instead of letting each task fail on its own.
The filter is a single list:
Emptying it restores Grok on the very next run. Nothing else has to change, and no prompt has to be touched — which is the point of doing it this way.
Why the engine picker is deliberately untouched
The obvious companion change — removing Grok from
SCRAPER_GROUPSso nobody can select it — is the one thing that must not happen here.ALL_SCRAPERSis derived from that list, and two write paths use it as the allow-set:filterByPlaninweb/src/lib/actions/prompt.tsfiltersplatformson every prompt writealignPromptsToPlanForOrginweb/src/lib/plan-engines.tsrewritesprompts.platformson plan changesDrop Grok from the list and both start silently stripping the stored id. Every prompt edit and every upgrade, downgrade or cancellation would erase the selection, and restoring Grok would then need a data repair across every affected org rather than deleting one array entry.
So prompts keep their Grok selection; only the submission is skipped. The trade-off is that the picker still offers an engine that produces nothing for now — the same outcome the customer gets today from the 500s, minus the spend.
Also here
The existing
chatgpt-shoppingfilter moves into the same helper. Both answer one question — which of a prompt's stored platform ids should this run actually pay for — and both exist because the saved array cannot be trusted at run time: a brand may have turned Shopping off since, a platform may be down. Keeping them in one place means a future outage is a one-line list edit, not a new branch in the middle of the run loop.runnablePlatformsis exported and unit-tested, matching how the other run-loop predicates in this file are already covered.Related issue
None — operational response to a live provider outage.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
grok-weband confirm no Grok task is submitted to Cloro, while every other platform still is.platformsstill containsgrok-webafter the run.chatgpt-shopping, and one with it enabled still runs it.UNAVAILABLE_PLATFORMSlocally and confirm Grok tasks are submitted again with no other change.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromserver/)yarn format:checkpasses (run fromserver/)Server test suite passes: 281 tests, including 5 new ones for
runnablePlatforms. Noweb/files are touched.