You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(analytics): record the task summary alongside the declared category
name_session now attaches the PII-scrubbed task summary to the
agent_session_task_declared event so the summary is available for product
analytics, not only local audit search. The analytics catalog gains its
first free-text property: task_summary is optional (the declaration still
sends without it) and length-bounded defensively at the boundary, with the
scrub and cap already applied upstream. Update the tool description to note
the summary powers search and is recorded for analytics.
constNAME_SESSION_DESCRIPTION:&str = "Name this browser session at the start of a task: a small lowercase 2-3 word label for what it is doing, e.g. \"invoice processing\", a `category` for the kind of task, and a short `summary`. Tabs are grouped as <client>/<name>; the label and summary stay on this machine (the summary makes the session findable in audit search), and only the category is used for anonymous aggregate analytics. Call again to update.";
49
+
constNAME_SESSION_DESCRIPTION:&str = "Name this browser session at the start of a task: a small lowercase 2-3 word label for what it is doing, e.g. \"invoice processing\", a `category` for the kind of task, and a short `summary`. Tabs are grouped as <client>/<name>; the label stays on this machine, the summary powers audit search and is also recorded for analytics, and the category is used for anonymous aggregate analytics. Call again to update.";
50
50
constNAME_SESSION_CATEGORY_DESCRIPTION:&str = "The kind of task, for anonymous aggregate analytics only; the free-form name is never sent. Pick the closest fit from the list.";
51
51
constNAME_SESSION_SUMMARY_DESCRIPTION:&str = "One or two short lines saying what this task is, phrased so you can find it again by searching later. No names, emails, URLs, file paths, or account numbers.";
52
52
constSUMMARY_MAX_LEN:usize = 200;
@@ -146,6 +146,14 @@ impl ClawMcpService {
146
146
.into_call_tool_result();
147
147
}
148
148
};
149
+
// Scrub structural PII from any provided summary before it is stored, indexed for
150
+
// search, or recorded on the task-declared analytics event. Last write wins locally.
151
+
let scrubbed_summary = raw_args
152
+
.get("summary")
153
+
.and_then(Value::as_str)
154
+
.map(str::trim)
155
+
.filter(|summary| !summary.is_empty())
156
+
.map(scrub_summary);
149
157
ifletSome(category) = raw_args
150
158
.get("category")
151
159
.and_then(Value::as_str)
@@ -155,23 +163,24 @@ impl ClawMcpService {
155
163
// At most once per session: a later name_session rename must not
156
164
// re-declare and overcount the category mix or the declaration rate.
157
165
if started.session.try_mark_task_declared(){
166
+
letmut properties = json!({
167
+
"task_category": category,
168
+
"client_name": started.session.client_name(),
169
+
});
170
+
// The scrubbed summary rides along with the category declaration; the
171
+
// analytics layer bounds it defensively before it leaves the machine.
"Name this browser session at the start of a task: a small lowercase 2-3 word label for what it is doing, e.g. \"invoice processing\", a `category` for the kind of task, and a short `summary`. Tabs are grouped as <client>/<name>; the label and summary stay on this machine (the summary makes the session findable in audit search), and only the category is used for anonymous aggregate analytics. Call again to update."
490
+
"Name this browser session at the start of a task: a small lowercase 2-3 word label for what it is doing, e.g. \"invoice processing\", a `category` for the kind of task, and a short `summary`. Tabs are grouped as <client>/<name>; the label stays on this machine, the summary powers audit search and is also recorded for analytics, and the category is used for anonymous aggregate analytics. Call again to update."
0 commit comments