Skip to content

fix(action-center): give Check now its own rate bucket, its own words for each task it can't check, and show it only where the API checks - #1683

Merged
gkhngyk merged 7 commits into
ansvisor:mainfrom
cihan-gyk:fix/task-check-now-reasons
Oct 28, 2026
Merged

gkhngyk merged 7 commits into
ansvisor:mainfrom
cihan-gyk:fix/task-check-now-reasons

Conversation

@cihan-gyk

@cihan-gyk cihan-gyk commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Follow-up C from #1565's round 37 (round 36's item 8): Check now gets its own rate bucket, its own words for each task it can't check, and shows only where the API checks.

Stacked on #1682: both change runTaskCheck's first lines. This PR's own commit is be4b544.

  • Check now shared pageReadLimiter with Quality's page read, which is an AI-cost route, so clicks here used up the editor's reads. It now has its own taskCheckLimiter: 30 per 15 minutes, keyed by user (or IP).

  • "not_checkable" used to say "a Site Audit fix is checked by your next audit" for every task without a check. runTaskCheck now names why:

    • no_address: no URL, or one that isn't a page's address;
    • no_change_text: a written task with no new text to look for;
    • from_bot_logs: a crawler fix raised from the bot logs, which robots.txt can't show done;
    • not_checkable: a library task checked elsewhere, as before.

    Each has its own line in checkNot.

  • The drawer showed Check now on every open Automatic task with a URL. It now shows it only where the API checks (pageCheckable): a library task in its CHECKS, or a written task with its new text.

  • PAGE_CHECKED_TASKS copies the CHECKS keys. A test reads the server file and fails if the two lists drift.

Server and web change together here, so they should deploy together. An older web would show the new reasons' keys as raw text.

Where people see it: Action Center › a task's drawer: the Check now button, and the line under it when a task can't be checked.

Related issue

Follow-up from #1565 (round 37, item C).

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. cd server && npx vitest run src/lib/action-center/task-checks.test.js
  2. cd web && npx vitest run src/lib/action-center/task-details.test.ts

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Full checks were run in one tree with this batch's eight follow-up branches merged (after the review fixes):

  • server format, lint and npm test (no SUPABASE_* env, as in CI): 249 files, 3,365 tests passed;
  • web format, lint (0 errors; 7 warnings already on main), typecheck, vitest (445 files, 4,353 tests) and build: all pass.

Browser check (local, 1024 px): Prompts › Topics › Add Topic stops at 100 characters; the Action Center drawer opens without errors, and Check now doesn't show on tasks the API doesn't check.

A pre-push review was run on all eight branches of this batch, and its before-merge findings are fixed.

🤖 Generated with Claude Code

cihan-gyk and others added 2 commits October 28, 2026 08:38
…, cap each brand's night, and check after the task writer

Follow-ups C (round 36's items 6, 7 and 11) from ansvisor#1565's round 37.

Item 6: tasks the sweep can't check stayed at the head of its queue.
Nothing was written when no address could be made (a URL typed as
`acme.example pricing`, a path on a brand with no domain) or when reading
threw, so those rows kept a null or old triedAt and came first every
night. runTaskCheck now writes triedAt first, as a claim on the task as
it was read (the bot-log crawler case's own write goes, the claim keeps
its try); the result is written on the claim. A run that read the task
before another claimed it gets 'changed' and reads nothing, so two runs
never check one task.

Item 7: one brand could take the night, and the checks didn't wait for the
task writer.
- The sweep checks at most SWEEP_PER_BRAND (20) of one brand's tasks a
  night, and reads up to 5 pages of 1,000 rows (ordered by triedAt, then
  id) to fill its 200.
- server.js starts the checks once sweepActionTasks settles: the writer
  can delete a task a check just completed.

Item 11: the sweep's query (the `or` with a JSON path, the order on
details->autoCheck->>triedAt, the range) ran against the dev DB, over a
seeded demo-brand task with a stub page: claimed, checked, completed,
one History line; the temp action and task were deleted after.

The guide's Automatic line says 20 of one brand's, least recently tried
first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… for each task it can't check, and show it only where the API checks

Follow-up C (round 36's item 8) from ansvisor#1565's round 37. Stacked on
fix/task-check-sweep-queue: both change runTaskCheck's first lines.

- Check now shared pageReadLimiter with Quality's page read, an AI-cost
  route, so clicks here used up the editor's reads. It has its own
  taskCheckLimiter (30 per 15 minutes).
- "not_checkable" said "a Site Audit fix is checked by your next audit"
  for every task without a check. runTaskCheck now names why:
  no_address (no URL, or one that isn't a page's address),
  no_change_text (a written task with no new text to look for),
  from_bot_logs (a crawler fix raised from the bot logs, which robots.txt
  can't show done), and not_checkable for a library task checked
  elsewhere, as before. Each has its line in checkNot.
- The drawer showed Check now on every open Automatic task with a URL.
  It shows it where the API checks (pageCheckable): a library task in its
  CHECKS, or a written task with its new text. PAGE_CHECKED_TASKS copies
  the CHECKS keys; a test reads the server file and fails if they drift.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	server/src/lib/action-center/task-checks.js
The drawer's pageCheckable allowed only a library task it checks on its
page or a written task with new text, so the shopping links task (no task
key, no new text) lost Check now. Pass the action's kind and allow a
shopping_links action's task.

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good with 948fe01: pageCheckable(task, action.kind) keeps Check now on a shopping links action's task, with a test; merged on top of #1682 with main's early shopping-links return kept before the claim.

@gkhngyk
gkhngyk merged commit 58b313c into ansvisor:main Oct 28, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants