fix(editor): Polish with AI explains itself to a company without AI, and sends nothing - #410
Merged
Merged
Conversation
…and sends nothing The editor offered the Polish with AI switch to every signed-in user. A tester whose company has no AI — no AI in the plan, or the owner never switched it on — could turn it on, and every Stop sent the recorded steps to the server only to be refused with "Couldn't polish — raw steps kept"; the switch stayed on. The editor now reads the company's AI status from the project info it already loads (company-settings.ai_enabled / ai_hidden). With AI off — anything but true, since prod answers null for a company with no subscription — the switch stays in view but off, and a click explains that AI needs a plan with AI switched on by the company owner; nothing is sent. With no AI on the instance at all the switch is not shown. A refusal at Stop (422, or an "AI is disabled" answer) explains the same way and turns the switch off. An older server with no status behaves as before. The 422 sentence path never worked in a browser: the error reaches the editor with the server's sentence as plain text, not JSON. serverMessage() reads both. The manifest goes to 0.2.2, so this ships in the release the store gets. Mutations through RECFMT_SRC and RECSESS_SRC: 23 of 23 caught. Real Chromium against a stubbed server: off, null, hidden, on, and a 422 / "AI is disabled" refusal each behave as above; the previous build turns the switch on and sends. Read-only on prod: project-for-testing answers ai_enabled true, qa_core_framework (no AI) answers null. Closes #409 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #409