feat(dev): show a cached (N ready) hint on the lab AFK menu #79
No reviewers
Labels
No labels
bug
enhancement
in-progress
needs-info
needs-triage
p0
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/nixos!79
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/66"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Surfaces how many ready-for-agent issues a project has on the per-project ⋯ menu's Start AFK run control, using only the auto scheduler's in-memory cache so the per-poll render never blocks on
tea.What changed
scheduleAFKRunsalready lists each auto-on project's ready queue every sweep but kept only a boolean; it now recordslen(ReadyIssues)in a new project-name-keyed, mutex-guarded map on theServer(afkReady), captured before the launch gate so the hint updates whether or not a run launches.projectState/the store JSON): it re-derives within one sweep after a restart, where a stale value carried across would mislead.snapshotpopulatesprojectGroup.ReadyCount/ReadyKnownfrom the cache via a locked map read — notea/Tracker call is added to the per-poll render.afkStartHint(autoEnabled, count, known) -> {suffix, greyed}(mirroringshouldLaunchAuto/classifyAFKRun) maps the three states: unknown → plain "Start AFK run"; cached N>0 → "Start AFK run (N ready)"; cached zero → "(0 ready)" greyed.coloronly, nopointer-events/disabled) yet stays a real submit button, so a stale zero never blocks the authoritative click — submitting an empty queue still flashes the existing "No ready-for-agent issues to start." notice (ADR-0007). The count shows only while the auto toggle is on, so cold auto-off projects show no count.Tests
TestAFKStartHint— table-driven over unknown / N>0 / zero / auto-off.TestScheduleAFKRuns_cachesReadyCountand...EvenWhenNoLaunch— the sweep caches the count, including on a tick that launches nothing.TestScheduleAFKRuns_readyCountNotPersisted— restart simulation proves the count is in-memory only while the persisted auto toggle survives.TestLivePartial_afkStartReadyHint— renders the three states + auto-off gate through the template, asserting the zero state is greyed yet still a submit button (not the disabled span).go build ./...,go vet ./..., andgo test ./...all pass in the lab module; the repo pre-commit hook (eval-only) passed on commit.Closes #66