-
Notifications
You must be signed in to change notification settings - Fork 88
feat: recording gate observability + user feedback #7425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,6 +140,18 @@ export class ComputerUseSession { | |
| this.targetAppName = targetAppName; | ||
| this.targetAppBundleId = targetAppBundleId; | ||
| this.requiresRecording = requiresRecording ?? false; | ||
|
|
||
| log.info( | ||
| { | ||
| sessionId, | ||
| qaMode: !!requiresRecording, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 The new constructor log at line 147 computes Root CauseIn Impact: Incorrect Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
| requiresRecording: this.requiresRecording, | ||
| targetAppName, | ||
| targetAppBundleId, | ||
| recordingGateStatus: this.recordingGateStatus, | ||
| }, | ||
| 'CU session initialized', | ||
| ); | ||
| } | ||
|
|
||
| // --------------------------------------------------------------------------- | ||
|
|
@@ -197,11 +209,19 @@ export class ComputerUseSession { | |
| this.recordingHandshakeTimer = setTimeout(() => { | ||
| if (this.recordingGateStatus === 'pending') { | ||
| log.error( | ||
| { sessionId: this.sessionId, timeoutMs: RECORDING_HANDSHAKE_TIMEOUT_MS }, | ||
| { | ||
| sessionId: this.sessionId, | ||
| timeoutMs: RECORDING_HANDSHAKE_TIMEOUT_MS, | ||
| recordingGateStatus: this.recordingGateStatus, | ||
| requiresRecording: this.requiresRecording, | ||
| targetAppName: this.targetAppName, | ||
| targetAppBundleId: this.targetAppBundleId, | ||
| stepCount: this.stepCount, | ||
| }, | ||
| 'Recording handshake timeout — recording never started', | ||
| ); | ||
| this.abortWithError( | ||
| 'Recording handshake timed out: recording did not start within 8 seconds. Session aborted to prevent unrecorded actions.', | ||
| `Recording handshake timed out after ${RECORDING_HANDSHAKE_TIMEOUT_MS / 1000} seconds. The screen recording did not start. Session aborted because recording is required for QA sessions. Check screen recording permissions in System Settings > Privacy & Security.`, | ||
| ); | ||
| } | ||
| }, RECORDING_HANDSHAKE_TIMEOUT_MS); | ||
|
|
@@ -692,16 +712,22 @@ export class ComputerUseSession { | |
| if (this.requiresRecording && this.recordingGateStatus !== 'started') { | ||
| if (this.recordingGateStatus === 'failed') { | ||
| const reason = this.recordingFailureReason ?? 'unknown'; | ||
| this.abortWithError(`Recording failed: ${reason}. Session cannot proceed without recording.`); | ||
| this.abortWithError(`Recording failed to start: ${reason}. Session aborted because recording is required for QA sessions.`); | ||
| return { | ||
| content: `Recording failed: ${reason}. Session aborted.`, | ||
| isError: true, | ||
| }; | ||
| } | ||
| if (this.recordingGateStatus === 'pending' && DESTRUCTIVE_TOOLS.has(toolName)) { | ||
| log.warn( | ||
| { sessionId: this.sessionId, toolName, recordingGateStatus: this.recordingGateStatus }, | ||
| 'Blocked destructive action — recording has not started yet', | ||
| { | ||
| sessionId: this.sessionId, | ||
| toolName, | ||
| recordingGateStatus: this.recordingGateStatus, | ||
| requiresRecording: this.requiresRecording, | ||
| stepCount: this.stepCount, | ||
| }, | ||
| 'Blocked destructive action — recording not started', | ||
| ); | ||
| return { | ||
| content: 'Recording has not started yet. Waiting for recording confirmation before executing destructive actions. Use computer_use_wait to wait, or computer_use_done/computer_use_respond if the task can be completed without interaction.', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new initialization log sets
qaModeto!!requiresRecording, but QA sessions are not always recording-gated (for example,requiresRecordingis only set whenconfig.qaRecording.enforceStartBeforeActionsis enabled inassistant/src/daemon/handlers/shared.ts:277-299). When that flag is off, real QA sessions will now be logged asqaMode: false, which undermines the observability this commit is trying to improve and makes QA incident triage misleading.Useful? React with 👍 / 👎.