[BUG] Persistent Context Broken on Windows

## Environment

| Component | Version |

|-----------|---------|

| Antigravity | Latest (VSCode OSS base 1.107.0) |

| Commit | `4603c2a412f8c7cca552ff00db91c3ee787016ff` |

| Build Date | 2026-03-07 |

| OS | Windows 11 Pro 10.0.26200 |

| Data Dir | `~/.gemini/antigravity/` |

## Problem

The persistent context system (brain logs, Knowledge Items, context state) is non-functional on Windows. Conversations are saved, but the background processes that build cross-conversation memory never produce output for the vast majority of conversations.

### What works

- Conversation `.pb` files are saved correctly (30 conversations)

- Brain directories are created for each conversation (1:1 match with conversations)

- A small number of brain directories contain user-created artifacts (7 out of 30)

### What is broken

1. **brain/ directories are mostly empty**: 24 out of 30 brain directories contain zero files. No `.system_generated/logs/`, no `overview.txt`, no artifacts. Only 7 directories have any files, and those are user-triggered artifacts (e.g., `bug_report.md`, media files), not system-generated brain logs.

2. **`.system_generated/` is almost never created**: Only 1 conversation (`8b1d80ac`) has a `.system_generated/steps/` directory. The remaining 29 conversations have no system-generated content at all.

3. **knowledge/ is completely empty**: Only `knowledge.lock` exists. Zero Knowledge Items have ever been generated. The knowledge subagent either never runs or fails silently.

4. **context_state/ is empty**: No cross-conversation context state is maintained.

5. **implicit/ contains 7 orphaned .pb files**: All 7 files in `implicit/` have UUIDs that do NOT match any conversation in `conversations/`. Their purpose and origin are unknown.

## Filesystem Evidence

```

~/.gemini/antigravity/

├── conversations/ → 30 .pb files ✓ (conversations ARE saved)

├── brain/ → 30 subdirs + tempmediaStorage

│ ├── 24 dirs → EMPTY (0 files)

│ ├── 6 dirs → user artifacts only (media, .md files)

│ └── 1 dir → has .system_generated/steps/21/output.txt (ONLY one)

├── knowledge/ → knowledge.lock ONLY (0 Knowledge Items) ✗

├── context_state/ → EMPTY ✗

├── implicit/ → 7 .pb files (ALL orphaned — no matching conversation) ✗

├── html_artifacts/

├── playground/

├── mcp_config.json

├── onboarding.json

└── installation_id

```

### Brain directory breakdown

| Status | Count | Description |

|--------|-------|-------------|

| Empty | 24 | No files at all |

| User artifacts only | 6 | Contains media (.png) or user-created .md files, no system logs |

| Has .system_generated | 1 | Only `steps/21/output.txt` — no logs or overview |

| **Total** | **31** | (30 conversations + tempmediaStorage) |

## Impact

- Agent **cannot reference or build upon previous conversations** — the “What do you know about my past conversations?” feature returns nothing useful

- **Zero Knowledge Items** are generated, making the knowledge discovery system completely non-functional

- Conversation list/summaries appear at chat start, but the agent cannot access actual conversation content, logs, or artifacts from those sessions

- The entire “persistent context” feature described in the system prompt is broken

## Attempted Workarounds (all failed)

Based on the community thread [“Knowledge: how to make it works?”](https://discuss.ai.google.dev/t/knowledge-how-to-make-it-works/), I attempted the Windows-equivalent fixes:

1. **Permission check** — `icacls` confirms full control for user on all directories. Not a permission issue.

2. **`.antigravityignore`** — Created in project root with `node_modules/`, `.git/`, `build/`, etc. No effect.

3. **Cache clear** — Deleted `%APPDATA%\Antigravity\Cache\*` and `Code Cache\*` (~55 MB), restarted IDE. No effect.

4. **“Save to Knowledge Base” test** — Asked the agent to save a summary to KB. Agent claims success but no files appear in `knowledge/`.

None of these resolved the issue. The Linux ACL fix (`setfacl`) from the community thread is not applicable to Windows.

## Steps to Reproduce

1. Install Antigravity (latest) on Windows 11

2. Have multiple conversations across different sessions (I have 30)

3. Check `~/.gemini/antigravity/brain/` — most subdirectories are empty

4. Check `~/.gemini/antigravity/knowledge/` — only `knowledge.lock`, no KI folders

5. Start a new conversation and ask: “What do you remember from our previous conversations?”

6. Agent has no access to past conversation details

## Verification commands (PowerShell)

```powershell

# Count conversations

(Get-ChildItem “$env:USERPROFILE\.gemini\antigravity\conversations” -File).Count

# Count empty vs non-empty brain dirs

$dirs = Get-ChildItem “$env:USERPROFILE\.gemini\antigravity\brain” -Directory

$empty = ($dirs | Where-Object { (Get-ChildItem $_.FullName -Recurse -File).Count -eq 0 }).Count

Write-Host “Total: $($dirs.Count), Empty: $empty, With files: $($dirs.Count - $empty)”

# Check knowledge

Get-ChildItem “$env:USERPROFILE\.gemini\antigravity\knowledge”

# Check orphaned implicit files

$convIds = Get-ChildItem “$env:USERPROFILE\.gemini\antigravity\conversations” -File | % { $_.BaseName }

Get-ChildItem “$env:USERPROFILE\.gemini\antigravity\implicit” -File | Where-Object { $convIds -notcontains $_.BaseName }

```

## Expected Behavior

- `brain//` should contain system-generated logs, overview, and artifacts for each conversation

- `knowledge/` should contain Knowledge Items derived from conversation data

- `context_state/` should maintain cross-conversation state

- `implicit/` file IDs should correspond to actual conversations

## Notes

- This appears to be a **Windows-specific** issue, or a general backend issue that the Linux ACL workaround happens to mask on Linux

- The problem is NOT permissions — Windows NTFS permissions are correct

- The problem is NOT the indexer crashing on large files — `.antigravityignore` had no effect

- The background process responsible for writing brain logs and generating KIs appears to **never execute** or **fail silently** on Windows