chore: promote staging to staging-promote/57d7b541-24389081893 (2026-04-14 10:27 UTC)#2453
Conversation
#2366) * fix(security): harden approval thread safety (TOCTOU + error handling) Consolidates two security fixes for the approval processing flow in thread_ops.rs: **TOCTOU race (#1486):** Hold session lock for the entire take-verify sequence in process_approval() so pending approval cannot be lost if a concurrent operation modifies the thread between take and restore. Previously, the lock was dropped after take_pending_approval() and re-acquired for request_id verification, creating a window where the approval could be permanently lost. **Silent error fallback (#1487):** Replace 10 silent `if let Some(thread)` patterns with explicit `match` arms. Critical paths (state transitions, deferred approval setup) return errors when threads disappear. Non-critical paths (tool result recording, auth mode, rejection) log debug messages but continue. Regression tests: - test_approval_request_id_mismatch_restores_pending - test_approval_on_missing_thread_should_error Supersedes #1591 (branch had no merge base with current staging). Closes #1486, Closes #1487 https://claude.ai/code/session_01X86EZxqXEFiU9VetyhPKjM * fix(security): prevent orphaned SSE events for dead threads Address review feedback: - handle_auth_intercept: return early when thread is gone instead of emitting auth-required SSE to a dead thread - process_auth_token: skip emit_auth_required_status when thread disappeared (both Ok retry and Err retry paths) Clients will no longer see auth prompts that can never resolve when the underlying thread has been deleted. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
Code reviewFound 2 issues:
In
Positive findings✓ TOCTOU race fix is architecturally sound — atomically restores pending approval on request_id mismatch under single lock |
Auto-promotion from staging CI
Batch range:
a53eac5c2dec6b6cd5c08189086093fde64aa9cb..7425dc0f4a1575189a3d44a30e3bed883d3cdf69Promotion branch:
staging-promote/7425dc0f-24393986437Base:
staging-promote/57d7b541-24389081893Triggered by: Staging CI batch at 2026-04-14 10:27 UTC
Commits in this batch (24):
ironclaw profile listsubcommand (feat(cli): addironclaw profile listsubcommand #2288)Current commits in this promotion (1)
Current base:
staging-promote/57d7b541-24389081893Current head:
staging-promote/7425dc0f-24393986437Current range:
origin/staging-promote/57d7b541-24389081893..origin/staging-promote/7425dc0f-24393986437Auto-updated by staging promotion metadata workflow
Waiting for gates:
Auto-created by staging-ci workflow