Files
LWLT-AIBOT/.project-docs/30-worklog/tasks/20260914-automation-settings-log-noise-01a0858b.md
T
2026-09-14 14:26:32 +08:00

3.0 KiB

Quiet successful automation-settings polling

Scope and gate

  • Continuation of the user's request to keep normal polling quiet and errors visible. Production logs now show GET /api/settings/automation 200 start/completion pairs, approximately one minute apart in the sample.
  • main, /Users/andy/IdeaProjects/LWLT-AIBOT, base 4194a200c17ed51b3991aa5f86a8eff862b080c0; one worktree, tracked files clean. Preserve existing untracked .idea and versioned plugin ZIP. Overlap: Clear.
  • Own control-plane/src/server.ts, control-plane/test/diagnostics.test.ts and this task record. Main-thread work only. No .env reads, DB/ERP operations, production rollout, restart or external sending.

Finding and plan

  • Administrator refreshBackgroundState calls syncAutomationSettings; the page schedules background refresh every 30 seconds and on focus/visibility. The supplied production sample alone shows a 60-second interval; deployed version/background timer behavior may differ.
  • GET reads settings only; PUT changes automation settings. The previous exact quiet allowlist omitted the GET path.
  • Add only GET/HEAD /api/settings/automation to existing suppression: hide start/successful-2xx access logs, retain failed completions and PUT mutation logs. Verify actual handlers with stubbed dependencies, then run existing checks.

Validation and result

  • Completed: added exact GET/HEAD /api/settings/automation to the existing routine-polling classifier. Only the start log and successful 2xx completion log are suppressed. PUT and all failure/completion diagnostics remain unchanged. No browser polling interval or automation behavior changed.
  • Focused diagnostics tests 10/10 PASS: actual GET/HEAD settings handlers run, successful reads produce no logs even at debug; 401/403/500 retain request-correlated status/severity/error diagnostics; PUT still invokes the settings method and records start/completion access logs. Dependencies are stubbed; no settings/database mutation occurred.
  • node --run check, node --run test:control-plane (227/227), node --run build and git diff --check: PASS. Original check:repo remains 8/10 from pre-existing .idea / .DS_Store residue. A 2617-file byte-verified source copy excluding secrets/local metadata passes check:repo 10/10 and test:legacy 319/319; existing HTTP tests use permitted loopback listeners. A test assertion's TypeScript narrowing was corrected, then typecheck/build and the full control-plane suite reran successfully.
  • Main-thread final read-only review: PASS; only the two owned source/test files and this record changed. Temporary validation output: /private/tmp/ltjt-automation-log-noise-20260914/.
  • Production has not been changed. A newly built service deployment is required for production suppression; no plugin update or database migration is needed.

Promotion candidates

  • Include administrator automation-settings polling in the established quiet successful-read logging policy; shared canonical memory remains untouched.