anomalyco / anomalyco/opencode

Permission persistence broken — 'allow always' lost on restart, causes apparent freezes

Open
#41,823 1 comment 0 reactions 1 assignee View on GitHub

@Brendonovich is already working on this.

Since Aug 11, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

CORRECTED DIAGNOSIS (previous SSE theory was wrong)

The app does NOT hang or freeze. It waits for unanswered permission prompts.

Evidence

Root Cause: Permission persistence is broken

The permission table has schema (project_id, action, resource) with a unique index — but is always empty. "Allow always" only lives in process memory, dies on every restart.

Example: Temp\opencode\* was allowed in two runs, then re-asked 168 times in 29 subsequent runs.

Scale

48.9% of 3270 prompts are repeats. external_directory: 1360 prompts, 125 unique values, 10.9x repeat rate. todowrite: 57 prompts for the same *. task: 103 prompts, 34x repeats.

141 duplicate prompt groups in the same second, worst case 5 identical.

What a "freeze" actually looks like
19:18:29  asking external_directory ...\logs\*
19:18:29  asking external_directory (same path again)
          <-- 12 MIN 30 SEC of ZERO backend activity
19:30:59  formatting file resumed
19:31:01  both tabs resumed within 2 seconds

Backend completely idle — not working, not retrying. Both tabs resumed immediately after prompt was answered.

What was ruled out
  • Renderer crash: no events in 49 sessions, no dumps, no native "Not Responding" dialog
  • Windows AppHang: zero events in 27 days (control: claude.exe logged correctly)
  • SSE channel breaks: backend wrote nothing during the stall
  • Tab blocking: 68.9% of stalls had neighbor sessions working
  • Network timeouts: 300s headersTimeout exists, max 312.94s, no infinite hangs
  • Memory/disk: stable
Bonus: git snapshot overhead

Two snapshots per step, 13342 files stat'd each time. p50 latency grew from 304ms to 590ms (4.3x in 3 weeks), consumed 12.85% of backend time on Aug 8.

Recommended Fixes

  1. Persist permission decisions — table exists, never written to
  2. Dedup simultaneous identical prompts — 141 duplicate groups in the same second
  3. Prompt timeout — if unanswered for N minutes, auto-deny and continue
  4. Snapshot optimization — 13% backend time on git snapshots

Version: 1.18.16, Electron 42.3.3, Windows 10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.