fix(sdk): hide ACP usage updates from transcripts (#8790)

* test(sdk): reproduce visible usage updates

* fix(sdk): hide ACP usage updates from transcripts
This commit is contained in:
carffuca 2026-08-09 17:57:32 +08:00 committed by GitHub
parent 3e731cda8b
commit f3ba99f545
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 0 deletions

View file

@ -839,6 +839,7 @@ function normalizeSessionUpdate(
case 'plan':
return [normalizePlanUpdate(update, base)];
case 'current_mode_update':
case 'usage_update':
return [];
default:
return [

View file

@ -2509,6 +2509,19 @@ describe('daemon UI normalizer — Wave 3/4 event coverage (PR-A)', () => {
]);
});
it('does not surface usage_update as a debug transcript event', () => {
const events = normalizeDaemonEvent(
envelopeOf('session_update', {
update: {
sessionUpdate: 'usage_update',
used: 46_351,
size: 1_000_000,
},
}),
);
expect(events).toEqual([]);
});
it('normalizes memory_changed with closed-enum scope + mode', () => {
const events = normalizeDaemonEvent(
envelopeOf('memory_changed', {