Skip to content

CM-68342: sweep all IDEs' session context and dedup reports#493

Merged
Ilanlido merged 4 commits into
mainfrom
CM-68342-session-context-sweep
Jul 12, 2026
Merged

CM-68342: sweep all IDEs' session context and dedup reports#493
Ilanlido merged 4 commits into
mainfrom
CM-68342-session-context-sweep

Conversation

@Ilanlido

Copy link
Copy Markdown
Collaborator

Session start now reports the device context unconditionally (previously a machine with no MCPs in the triggering IDE never created a device entity) and collects MCP configs from every registered IDE, not just the triggering one, sent as the config_files list. Unchanged payloads are skipped via a sha256 cache (~/.cycode/.session-context-cache, tenant-aware, 7-day TTL, written only after a successful send) so the common session start makes one API call instead of two.

Also: resolve plugins of git/github-sourced marketplaces through ~/.claude/plugins/cache (previously only directory-type marketplaces resolved, so their MCPs were silently missing), normalize plugin MCP content to the canonical {"mcpServers": ...} shape, and drop the legacy global_config_file field (the backend keeps its fallback for older CLIs).

Session start now reports the device context unconditionally (previously a
machine with no MCPs in the triggering IDE never created a device entity)
and collects MCP configs from every registered IDE, not just the triggering
one, sent as the config_files list. Unchanged payloads are skipped via a
sha256 cache (~/.cycode/.session-context-cache, tenant-aware, 7-day TTL,
written only after a successful send) so the common session start makes one
API call instead of two.

Also: resolve plugins of git/github-sourced marketplaces through
~/.claude/plugins/cache (previously only directory-type marketplaces
resolved, so their MCPs were silently missing), normalize plugin MCP
content to the canonical {"mcpServers": ...} shape, and drop the legacy
global_config_file field (the backend keeps its fallback for older CLIs).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@omer-roth

Copy link
Copy Markdown
Collaborator
  1. Cache format & compatibility: Cache stored at ~/.cycode/.session-context-cache with tenant-aware TTL. If format changes, old cache entries become harmless misses (no corruption risk).

  2. Tenant ID dependency: Cache keyed by tenant_id from auth_info. If tenant ID is None/missing, caching still works but keys all nulls together. Tests verify this.

  3. Plugin marketplace assumption: Assumes git/github plugins are cached at ~/.claude/plugins/cache/ (or ~/.codex/plugins/cache/). If Claude/Codex changes cache layout, plugins silently become unreachable (non-breaking, but incomplete).

  4. Deterministic payload ordering: digest uses json.dumps(sort_keys=True) but config_files is constructed from dict.values() (insertion order of IDES). If IDES registration order changes (or if different Python versions/packaging cause different ordering), identical inventories could produce different digests and cause unnecessary resends or missed skips. Make the ordering explicit/deterministic before hashing (e.g., sort config_files by 'path' or include IDE name in each entry and sort by that).

  5. Determinism in resolve_cached_plugin_dir: max(candidates, key=lambda d: d.stat().st_mtime) uses mtime. That is fine but could be brittle if two entries have same mtime. Acceptable, but consider stable tie-breaker (e.g., max by (mtime, name)).

Ilanlido and others added 2 commits July 12, 2026 15:52
Sort config_files by path so the dedup digest doesn't depend on IDE
registry order, and break mtime ties by name when resolving cached plugin
dirs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Ilanlido Ilanlido merged commit 49c9e40 into main Jul 12, 2026
28 checks passed
@Ilanlido Ilanlido deleted the CM-68342-session-context-sweep branch July 12, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants