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
Replace the fixed session_count_* columns on the ephemeral workspace_agent_stats table with a normalized child table keyed by app name, and report session counts from the agent as a dynamic proto map, so new IDEs flow end-to-end with zero schema, proto, or server changes.
Scope
New workspace_agent_session_counts (workspace_agent_stats_id, app_name, count) child table with ON DELETE CASCADE; clean-cut migration copies the ~1 day ephemeral buffer, drops the four columns, and trims the insights covering index
Proto Stats.session_counts map (field 13, Agent API v2.11); fields 8–11 stay deprecated and the server converts them, so old agents keep reporting without changes
Agent: dynamic per-app counters; extractMagicSessionType normalizes instead of classifying against a fixed set; JetBrains process detection and SSH metric labels grouped by family
New coderd/idemetadata leaf package: Normalize() (strip null bytes, truncate to 64 runes, lowercase, fold - to _ so reconnecting-pty stays canonical as reconnecting_pty, empty becomes unknown) plus the family map used for grouping
Bounded input: a stats report is capped at 64 distinct normalized names, overflow summed into unknown; workspace usage API and coder ssh --usage-app accept arbitrary app names
Read paths: latest-row queries aggregate the child table via LEFT JOIN LATERAL; rollup and template insights use plain hash joins (benchmarks in the PR description)
Phase 1 of the Scalable Approach for Adding New IDE Session Types RFC. Adding an IDE session type (Cursor, Windsurf, ...) currently requires changing 15+ files across migrations, proto, server, SDK, and UI.
Replace the fixed
session_count_*columns on the ephemeralworkspace_agent_statstable with a normalized child table keyed by app name, and report session counts from the agent as a dynamic proto map, so new IDEs flow end-to-end with zero schema, proto, or server changes.Scope
workspace_agent_session_counts (workspace_agent_stats_id, app_name, count)child table withON DELETE CASCADE; clean-cut migration copies the ~1 day ephemeral buffer, drops the four columns, and trims the insights covering indexStats.session_countsmap (field 13, Agent API v2.11); fields 8–11 stay deprecated and the server converts them, so old agents keep reporting without changesextractMagicSessionTypenormalizes instead of classifying against a fixed set; JetBrains process detection and SSH metric labels grouped by familycoderd/idemetadataleaf package:Normalize()(strip null bytes, truncate to 64 runes, lowercase, fold-to_soreconnecting-ptystays canonical asreconnecting_pty, empty becomesunknown) plus the family map used for groupingunknown; workspace usage API andcoder ssh --usage-appaccept arbitrary app namesLEFT JOIN LATERAL; rollup and template insights use plain hash joins (benchmarks in the PR description)Done when
All phases
connection_logs.typeENUM → TEXTtemplate_usage_stats*_mins→app_usage_minsJSONB🤖 Created by Coder Agents on behalf of @EhabY.