Skip to content

Restore ACP usage telemetry / 恢复 ACP 用量遥测 - #10

Merged
SivanCola merged 1 commit into
mainfrom
fix/acp-usage-telemetry
Aug 3, 2026
Merged

Restore ACP usage telemetry / 恢复 ACP 用量遥测#10
SivanCola merged 1 commit into
mainfrom
fix/acp-usage-telemetry

Conversation

@SivanCola

Copy link
Copy Markdown
Owner

Problem

Usage cards and the status-bar cache rate remained empty with current Reasonix ACP releases. The extension only consumed the legacy session/update: usage shape and ignored the namespaced status notifications advertised by Reasonix 1.19+.

Reasonix 1.17.21 did not publish usage over ACP at all, so relaxing the legacy validator could not fix the reported version combination.

Fix

  • Discover _reasonix.io/session/status and _reasonix.io/session/status_update through agentCapabilities._meta.
  • Validate schema v1 snapshots and matching update envelopes before using them.
  • Request an initial status snapshot for new and resumed sessions.
  • Map turn and cumulative usage into the existing usage card and status-bar model.
  • Reject duplicate or stale sequences so older async updates cannot regress the UI.
  • Preserve the legacy session/update: usage path for older compatible backends.
  • Extend unit, Extension Host, real-ACP smoke, and VSIX coverage.
  • Refresh four transitive development dependencies required by the high-severity audit gate.

Compatibility

Input Behavior Result
Reasonix 1.19+ schema v1 capability Initial snapshot plus live updates are consumed Usage and cache telemetry display automatically
Legacy backend with session/update: usage Existing parser and UI path remain unchanged Backward compatible
Backend without either telemetry surface No extra request is sent Existing no-telemetry behavior is preserved
Unknown status schema Capability and payload are ignored Fails closed without corrupting UI state
Duplicate or stale sequence Update is discarded Newer usage remains visible
Persisted extension data No schema or storage changes No migration required

Verification

  • npm audit --audit-level=high
  • npm run lint
  • npm test (51 tests)
  • npm run test:vscode
  • npm run smoke:acp against Reasonix 1.19.1 with status schema v1
  • npm run package:vsix
  • npm run verify:vsix-contents

Closes #4

Problem:
The extension only consumed legacy usage updates, while current Reasonix ACP versions publish usage through advertised namespaced status methods. Usage cards and cache telemetry therefore stayed empty.

Root cause:
Non-session/update notifications were ignored, and no client path discovered, validated, or synchronized the Reasonix status schema.

Fix:
Discover schema v1 status capabilities, validate initial and streaming snapshots, reject stale sequences, and map turn/cumulative telemetry into the existing usage UI. Preserve legacy usage compatibility and refresh patched transitive development dependencies required by the audit gate.

Verification:
npm audit --audit-level=high; npm run lint; npm test (51 tests); npm run test:vscode; npm run smoke:acp against Reasonix v1.19.1; npm run package:vsix; npm run verify:vsix-contents.
@SivanCola
SivanCola merged commit 040aa4c into main Aug 3, 2026
1 check passed
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.

Usage stats card not displaying — isUsage not displaying

1 participant