Skip to content

測試隔離:%TEMP% 對 CodexSandboxUsers 有寫入權限時,test-pmctl-context.sh 的 telemetry 案例被 ACL 守衛拒絕 #782

Closed

Description

@chenriien-ai

現象

原生 Windows 上執行 bash tests/shell/test-pmctl-context.sh,有 7 個案例失敗,涵蓋 context query、pack、reuse-scan 的事件相關檢查(context.queried、context.packed、context.reuse_scanned)。

錯誤訊息:

state-writer: unsafe state root rejected: /tmp/tmp.XXXX/state-... (ACL grants write to a non-owner principal)

已驗證的原因

測試機器的 %TEMP% ACL 含 CodexSandboxUsers:(OI)(CI)(M)(icacls 確認)。測試的 state root 建在 TEMP 底下並繼承這個授權,runtime/lib/state-writer.sh 的 ACL 守衛 fail-closed 拒絕,telemetry 寫不進去。

未驗證

影響

安裝過 Codex sandbox 的原生 Windows 機器上,這些案例失敗,會讓真正的 telemetry 迴歸被這 7 個失敗蓋掉(BACKLOG 第 3 步也記過同類遮蔽)。

建議方向

測試改用不繼承外部授權的 state root,或偵測這個條件時明確 SKIP 並說明原因;不放寬守衛。

證據與限制

  • revision 469f377,Windows 11、Git Bash 5.3.15。
  • test-pmctl-context.sh 在我的執行被 900 秒上限中止,已完成的 87 個案例是 80 通過、7 失敗;後面的案例是否還有同類失敗未確認。

Activity

  1. screenleon commented on Nov 5, 2026

    @screenleon
    Owner

    已在 #786(main e91e969)修好。

    test-pmctl-context.sh 的 state root 建在 %TEMP% 底下,繼承 CodexSandboxUsers:(M),守衛拒絕是對的;測試現在呼叫既有的 th_secure_state_root "$tmp_root"(test-pmctl-gate.sh 早已這樣做),沒有放寬守衛。

    驗證(原生 Windows,%TEMP% 實際含 CodexSandboxUsers:(OI)(CI)(M)):本單列的 7 個案例(context.queried 2、reuse-scan 2、pack 3)在 main 上失敗、改後通過。

    沒有解決、也與 ACL 無關(main 上同樣失敗):兩個 no-arg ... external git repo 案例(隔離守衛 exit 99)和 marker round-trip reports stale then fresh。整個 test-pmctl-context.sh 超過 900 秒上限,我沒有完整跑,所以「後面的案例是否還有同類失敗」仍未確認。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions