mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
test(voice): classify current-frame send and cancellation outcomes
Keep viewport and pointer-crop capture unchanged, but expose static reason codes for unavailable frames, invalidated turn captures and retained image sends. No image or user text in diagnostics.
This commit is contained in:
1 parent
8c02f5852f
commit
050f68ac03
2 files changed
+75
-2
No files matched your search
@@ -437,15 +437,24 @@ export class RealtimeViewport {
|
||||
const captured = await captureImage();
|
||||
const imageUrl =
|
||||
typeof captured === 'string' ? captured : captured?.dataUrl || null;
|
||||
if (!imageUrl) {
|
||||
this.debugLog?.('viewport_context.skipped', {
|
||||
reason: 'capture-unavailable',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (
|
||||
!imageUrl ||
|
||||
generation !== this.generation ||
|
||||
request !== this.captureSeq ||
|
||||
this.dc !== channel ||
|
||||
channel.readyState !== 'open' ||
|
||||
(typeof frame.valid === 'function' && !frame.valid())
|
||||
)
|
||||
) {
|
||||
this.debugLog?.('viewport_context.skipped', {
|
||||
reason: 'capture-invalidated',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
// Keep at most one viewport screenshot in context. Images are the single
|
||||
// most expensive item (re-billed every turn they linger), so we proactively
|
||||
@@ -506,6 +515,9 @@ export class RealtimeViewport {
|
||||
cameraKey: this.readCameraKey(),
|
||||
}
|
||||
: null;
|
||||
this.debugLog?.('viewport_context.result', {
|
||||
reason: sent ? 'sent' : 'data-channel-send-failed',
|
||||
});
|
||||
return sent;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user