agnes-the-ai-analyst/services
minasarustamyan f53e98d5a3
fix(usage): extract <command-name> slash invocations (release 0.54.12) (#303)
UsageProcessor missed every user-typed slash invocation because the
SLASH_RE regex (^\s*/<name>) expected a raw "/foo" prefix that Claude
Code never writes. Real session jsonls wrap slash commands in a
<command-name>/foo</command-name> XML tag inside user message content.
Result on production: usage_events.command_name and
usage_session_summary.slash_commands stayed NULL/0 for /clear, /exit,
plugin commands like /plugin:name — verified on 17 dev-VM jsonls
holding 25 <command-name> tags / 0 extracted rows.

Replaces SLASH_RE with COMMAND_NAME_RE that searches for the tag
anywhere in the user text (the tag sits after a <command-message>
sibling). USAGE_PROCESSOR_VERSION bumps 2 → 3; operators wanting to
rewrite historical rows under the new logic call
POST /api/admin/usage/reprocess (agnes admin telemetry reprocess).

Fixtures slash_command.jsonl, mixed.jsonl, skill_curated.jsonl
rewritten from the unrealistic "/foo args" string format to the real
<command-name> tag wrapper — existing assertions stay green against
the new format, which is the regression baseline going forward. Adds
TestCommandNameTagExtraction (4 unit tests on iter_events) covering
string content, list-of-text-blocks content, mid-text tag position,
and plain-prose "/x" non-match.

Implicit Skill tool_use extraction (LLM-decided invocations)
unchanged.

Co-authored-by: Minas Arustamyan <arustamyan.minas@gmail.com>
2026-05-14 13:33:57 +00:00
..
corporate_memory fix(corporate-memory): CLI catches fail-fast ValueError, exits 1 with clean message (Devin Review on #179) 2026-05-05 06:45:10 +02:00
scheduler Activity Center: audit log + telemetry + sessions + agnes_* tables (#278) 2026-05-12 22:41:19 +02:00
session_collector release: 0.47.4 — Docker collector skip + FIFO session-pipeline check (#229) 2026-05-08 09:38:21 +02:00
session_pipeline Extract session-pipeline framework + UsageProcessor skeleton (#232) 2026-05-08 19:47:46 +02:00
session_processors fix(usage): extract <command-name> slash invocations (release 0.54.12) (#303) 2026-05-14 13:33:57 +00:00
telegram_bot release: 0.45.0 — easy-wins bundle (#84 #164 #177 #178 #203 #204) 2026-05-07 11:43:16 +02:00
verification_detector Extract session-pipeline framework + UsageProcessor skeleton (#232) 2026-05-08 19:47:46 +02:00
ws_gateway feat(observability): request_id end-to-end + dev debug toolbar + centralized logging (#136) 2026-04-29 22:54:21 +02:00
__init__.py Move standalone services from server/ to services/ 2026-03-09 12:54:30 +01:00