8000 feat(workers): keep heavy steps to their hours and to so many at once by adeelahmad · Pull Request #634 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(workers): keep heavy steps to their hours and to so many at once - #634

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn
Oct 18, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: transcribing, reading and looking through media ran whenever a job reached them, as many at once as there were workers, which can swamp a Raspberry Pi in the evening.

After: Settings › Workers › Quiet processing can keep those heavy steps to a window such as 01:00-06:00 (in a chosen time zone, passing midnight is fine) and to so many at once across every worker. Both are off by default, so nothing changes until the owner turns them on. Light steps (analysis, summaries, reports) still run at any hour. Agents set the same workers.heavy_hours, workers.heavy_at_once, workers.heavy_steps and workers.timezone through the settings API.

How: domain/quiet.py decides whether a heavy step may start; jobs.py puts a job that reaches one outside the window (or over the limit) back on the queue with a log line saying why, and a worker does not claim it until it may run. settings.py validates the four values.

Motivation and Context

Item from the personal feature plan sheet ("process overnight, don't slow the machine").

Screenshots (if appropriate):

n/a

Steps to reproduce (if appropriate):

Settings › Workers › Quiet processing, set hours to a window that excludes now, upload a recording: its job waits at its transcribe step, its log saying "transcribe waits: heavy steps run …".

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests (tests/domain/test_quiet.py).
  • My change requires documentation updates, and I have updated docs/ accordingly (docs/architecture.md, Background work).
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md. Written as changelog.d/quiet-processing.md, per build(release): changelog fragments in changelog.d/ instead of one Unreleased section #581.

Done questions (AGENTS.md)

  • Goal: delivers what the user wanted, merged on green CI.
  • Agents: usable through the API, MCP or an assistant tool. The four workers.* settings through the settings API.
  • Zero setup: no new prerequisite, .env edit or manual step.
  • Fewest clicks and keystrokes. One field for the hours, one for how many at once, both in Settings.
  • Configurable: new settings in the web app with defaults; wizard asks only what is required. Off by default, not in the wizard.
  • Light: default install still runs on a Raspberry Pi with cloud models. This is for small machines.
  • Private and secure: data local and encrypted, passkeys, threat model updated. n/a: no new surface.
  • Cost: cheapest path, model calls in the activity ledger, budgets respected. n/a: no model calls.
  • User decides: consequential or new actions wait for the user; defaults unchanged.
  • Upgrades: existing installs upgrade safely (upgrade step for stored-data changes). New settings with defaults; no stored-data change.
  • Honest: sources cited; labelled built, in progress or planned.
  • Tests, docs and generated files updated.
  • Open standards; dependencies keep Lens MIT. n/a: no dependencies.
  • Result reported with evidence; "refine later" items written down. Refine later: two workers claiming in the same instant can briefly run one more than the limit (documented).
  • Reuse: existing Lens code and permissive libraries reused, nothing reinvented. Reuses the schedule module's time zones.

Local CI (ci/local-ci.sh): FastAPI (embedded and server), Next.js, pre-commit and PR title passed (Next.js's one failure was main's Kokoro test, fixed by #621; the settings tests pass after rebasing).


Generated by Claude Code

@adeelahmad adeelahmad self-assigned this Oct 18, 2026
@adeelahmad
adeelahmad merged commit 0313e5e into main Oct 18, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-xfmkzn branch October 18, 2026 16:33
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

0