Skip to content

Commit 8bea1e5

Browse files
authored
fix(settings): name Agent Files and Codex in the ActivityWatch 'What is sent' text (#1387) (#1395)
Name Agent Files and Codex, and scope what is counted, in the ActivityWatch 'What is sent' text. Fixes #1387.
1 parent 6598983 commit 8bea1e5

5 files changed

Lines changed: 34 additions & 8 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ What changes for you in each release of Switchboard. How to write an entry: [doc
2121
- Forking a Claude session requests the tab’s allocated id and gives its transcript 10 seconds to appear before considering another file. The fallback also handles copied compacted history beyond 8 MiB, within a bounded search; identical foreign forks remain ambiguous after the grace period. (#1350)
2222
- Moving a session to the background after choosing **Stop the old job** now waits for evidence that the old job ended. If the worker is still running at the deadline, the session stays in the foreground; if its end cannot be confirmed, Switchboard explains that uncertainty. (#1340)
2323
- Double-clicking an ended job in Agents now offers **Respawn** when available and **Open transcript** when a transcript exists, instead of silently doing nothing. If an action becomes unavailable before you click, the notice explains why. (#1023)
24+
- Settings → Activity Reporting's **What is sent** now says that Codex sessions are counted in what ran and that remote sessions, and background jobs neither started by a schedule nor open in a terminal, are not, and names Agent Files, Stats and the Agents view among the views that stop your attention time; it used to name a Memory tab and only Claude sessions. (#1387)
2425
- Turning ActivityWatch reporting on or off in Settings no longer leaves Switchboard reporting in a state the setting did not save: when the choice cannot be saved, the switch goes back and reporting stays as it was. (#1386)
2526
- On Windows, a project you deleted no longer reappears in the sidebar when its sessions recorded its folder under a short spelling such as `C:\Users\JEAN-B~1\...`, and adding it back with **Add project** under that spelling shows it again. (#1304)
2627

‎docs/activitywatch.md‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,19 @@ so they go to separate buckets:
2929
|---|---|---|
3030
| Bucket | `aw-watcher-switchboard_<hostname>` | `aw-watcher-switchboard-running_<hostname>` |
3131
| Type | `app.editor.activity` | `app.session.running` |
32-
| Holds | the session whose terminal is on screen | every Claude or Codex session, from start to exit |
32+
| Holds | the session whose terminal is on screen | every Claude or Codex session open in a Switchboard terminal, and every scheduled run |
3333
| Shown in | ActivityWatch's **Editor** view, by project and by session | queries and custom views; sessions overlap there, as they did |
3434

3535
**Attention** counts a session while its terminal is on screen, the window has
3636
focus, and there has been input in the last 3 minutes. It stops while Settings,
37-
Agent Files, Stats or a transcript viewer replaces the terminals.
38-
39-
**What ran** counts every Claude or Codex session launched by Switchboard, scheduled runs
40-
included (named `Scheduled: <schedule name>`), whether or not you looked at it.
37+
Agent Files, Stats, the Agents view or a transcript viewer replaces the terminals.
38+
39+
**What ran** counts every Claude or Codex session Switchboard opens in a
40+
terminal on this machine, while that terminal runs, and the scheduled runs
41+
Switchboard starts (named `Scheduled: <schedule name>`), while it launches, runs
42+
and supervises them, whether or not you looked at it. A background scheduled
43+
run can be counted before its job starts and after it ends.
44+
Other background jobs are counted only while open in a terminal.
4145
Each running session is written when it starts, every minute, and when it ends,
4246
so a crash loses at most its last minute. Plain terminals and panel shells are
4347
not counted, nor are sessions on remote hosts.

‎docs/settings.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,12 @@ project has been indexed. See [Remote hosts](remote-hosts.md).
187187
|---|---|---|---|
188188
| Send session activity to ActivityWatch | `activityReporting` | off | *Live.* Reports session time to a local ActivityWatch — see [ActivityWatch](activitywatch.md) |
189189

190-
The **What is sent** explanation expands when selected.
190+
The **What is sent** explanation expands when selected. It names the two
191+
buckets: your attention, which stops while Settings, Agent Files, Stats, the
192+
Agents view or another full-page view replaces the terminals; and what ran,
193+
every Claude or Codex session Switchboard opens in a terminal on this machine
194+
and the scheduled runs it starts, without remote sessions or other background
195+
jobs not open in a terminal. See [ActivityWatch](activitywatch.md#two-buckets).
191196

192197
### Archived
193198

‎public/settings-panel.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,8 @@
507507
<span class="settings-label">What is sent</span>
508508
<div class="settings-description">
509509
Two separate buckets, so that the time you spent on a session is never added to the time it ran on its own.<br>
510-
<strong>Your attention</strong> — <code>${escapeHtml((reportingState.buckets && reportingState.buckets.attention) || '')}</code>: the session whose terminal is on screen, while the window has focus and you are at the keyboard, with its id, its project and its name. It stops after 3 minutes without input, and while Settings, Memory or another full-page view replaces the terminals. It appears in ActivityWatch's Editor view.<br>
511-
<strong>What ran</strong> — <code>${escapeHtml((reportingState.buckets && reportingState.buckets.running) || '')}</code>: every Claude session from start to exit, scheduled runs included, whether or not you were looking at it, with its id, its project and its name. Sessions overlap there, as they did. Each one is updated every minute while it runs, so a crash loses at most the last minute of it. Shells are not counted: a shell sitting open is not work running.<br>
510+
<strong>Your attention</strong> — <code>${escapeHtml((reportingState.buckets && reportingState.buckets.attention) || '')}</code>: the session whose terminal is on screen, while the window has focus and you are at the keyboard, with its id, its project and its name. It stops after 3 minutes without input, and while Settings, Agent Files, Stats, the Agents view or another full-page view replaces the terminals. It appears in ActivityWatch's Editor view.<br>
511+
<strong>What ran</strong> — <code>${escapeHtml((reportingState.buckets && reportingState.buckets.running) || '')}</code>: every Claude or Codex session Switchboard opens in a terminal on this machine, while that terminal runs, and the scheduled runs Switchboard starts, while it launches, runs and supervises them, whether or not you were looking at it, with its id, its project and its name. A background scheduled run can be counted before its job starts and after it ends. Other background jobs are counted only while open in a terminal, and remote sessions are not counted. Sessions overlap there, as they did. Each one is updated every minute while it runs, so a crash loses at most the last minute of it. Shells are not counted: a shell sitting open is not work running.<br>
512512
A session's name is the one you gave it, or the title generated for it; a session with neither is sent under its id. Its first prompt — which the sidebar shows for such a session — is never sent, nor is any other prompt, command or transcript content.
513513
</div>
514514
</div>

‎test/dom-settings-nav.test.js‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,22 @@ test('filter ignores dynamic values and statuses but keeps descriptive prose sea
276276
for (const [selector, text] of texts) assert.equal(h.q(selector).textContent, text);
277277
});
278278

279+
test('What is sent names the current full-page views and both CLI runtimes', async t => {
280+
const h = setup(t);
281+
await h.open();
282+
const summary = [...h.w.document.querySelectorAll('.settings-details summary')].find(el => el.textContent === 'What is sent');
283+
assert.ok(summary, 'the What is sent explanation is rendered');
284+
const text = summary.closest('.settings-details').querySelector('.settings-description').textContent;
285+
const agentFilesTab = h.q('.sidebar-tab[data-tab="memory"]').title;
286+
assert.ok(text.includes(`while Settings, ${agentFilesTab}, Stats, the Agents view or another full-page view replaces the terminals`), text);
287+
assert.ok(text.includes('every Claude or Codex session Switchboard opens in a terminal on this machine, while that terminal runs, and the scheduled runs Switchboard starts, while it launches, runs and supervises them'), text);
288+
assert.ok(text.includes('A background scheduled run can be counted before its job starts and after it ends.'), text);
289+
assert.doesNotMatch(text, /every scheduled run|finished following/);
290+
assert.ok(text.includes('Other background jobs are counted only while open in a terminal, and remote sessions are not counted.'), text);
291+
assert.doesNotMatch(text, /from start to exit/);
292+
assert.doesNotMatch(text, /\bMemory\b/);
293+
});
294+
279295
test('filter beta leaves only its row under General and dims every other navigation item', async t => {
280296
const h = setup(t);
281297
await h.open();

0 commit comments

Comments
 (0)