
Key takeaways
- Window title changes from unread badges, live clocks, running builds or playing videos never prove a human is present — resetting idle timers on them breaks idle detection.
- TIMO360 separates Presence Signals (keyboard/mouse input, app switches, unlock/wake) from Context Signals (WINDOW_CHANGED) so titles split sessions without resetting idle.
- Idle starts are backdated to when hardware input actually stopped and flanked by a 1-minute server sweep plus a 2-hour unreachable reclassification job.
- Redis device locks serialize concurrent event batches so retries and crash restarts never produce duplicate overlapping timeline rows.
If you leave a work laptop open with a Slack unread counter in the title bar, a live build running in a terminal or a browser tab updating a dashboard clock, the active window's title changes automatically every few seconds — even while nobody is in the room.
In naive time trackers that treat every polled window-title update as user activity, that single quirk breaks idle detection completely: an employee can step away for an hour and appear "Active" the entire time. Fixing that cleanly requires separating presence from context across both the desktop agent and the backend session engine.
Presence Signals vs. Context Signals
In TIMO360's session engine (session-aggregator.ts) and desktop agent, signals fall into distinct categories with strict rules:
- Presence signals (
PRESENCE_SIGNALS): HardwareKEYBOARD_ACTIVITYandMOUSE_ACTIVITYheartbeats, foregroundAPPLICATION_CHANGEDswitches (which require a click or Alt-Tab rather than a self-updating title), plusSYSTEM_UNLOCKandSYSTEM_WAKE. Only presence signals reset the idle clock. - Context signals (
CONTEXT_SIGNALS):WINDOW_CHANGEDsplits the active timeline row so reports reflect what was in front, without ever refreshinglastActivityAtor marking an idle person active. - Suspend signals (
SUSPEND_SIGNALS):SYSTEM_LOCK,SYSTEM_SLEEPandIDLE_STARTunambiguously close or transition the active working span.
The desktop agent enforces the same rule locally: its lastSignalAt clock refreshes strictly on measured HUMAN_INPUT_SIGNALS (keyboard, mouse, unlock, wake), never on polled title diffs.
Backdating Idle Start and Reconciling Silent Machines
Counting idle time accurately also depends on when a session turns idle. If an employee stops typing at 2:00 PM and returns at 3:30 PM, waiting until 3:30 PM to log idle would make an afternoon away look active for 90 minutes on the live dashboard.
- Backdated
IDLE_STARTfrom the agent: The Rust poller checks OS-wide idle duration every 5 seconds. Once silence crosses the organization's configured threshold (5 minutes by default, synced from/agent/settings), the agent stampsIDLE_STARTat the moment input actually ceased and flushes immediately instead of waiting for the next 20-second tick. - One-minute server idle split: If an agent stops sending batches abruptly,
SchedulerService.closeIdleOpenSessionssweeps openACTIVEsessions every minute and splits silent ones into an active span plus an openIDLEsession so the dashboard and timeline agree. - Two-hour unreachable reclassification: If a device disappears completely for over two hours (hardware replacement, uninstall or dead battery),
closeUnreachableDeviceSessionsflips the openIDLEsession toOFFLINEso dead machines stop inflating daily idle totals. - Midnight auto punch-out: Every five minutes,
autoClosePastMidnightSessionscloses sessions left open past local midnight in the organization's timezone.
Preventing overlapping timeline rows with Redis locks
If an agent crashes mid-flight or a slow request retries after a timeout, two overlapping batches for the same device could read the same open session concurrently.
ActivityIngestionServicewraps each device's continuation inside a 15-second Redis lock (session-lock:<deviceId>) so batches apply strictly in order.
Inferring Browser Domains From Window Titles Without Full URLs
Because TIMO360 never captures full page URLs or query strings, our backend uses a conservative lookup (infer-domain.ts) when summarizing website activity from browser window titles. It strips trailing browser suffixes (such as - Google Chrome or - Microsoft Edge), matches explicit domains or well-known site names (like github.com or figma.com), filters out generic tabs like New Tab or Settings, and returns null rather than guessing on ambiguous titles.
Combined with metered breaks that pause tracking and marked meetings that count as active without window-title spying, every hour on a report maps back to real, defensible signals. Explore Activity Level Tracking or see how Breaks and Meetings stay fair.