Skip to content

fix: handle snapshot initialization on big repos#9778

Open
catrielmuller wants to merge 4 commits intomainfrom
catrielmuller/fix-big-repos
Open

fix: handle snapshot initialization on big repos#9778
catrielmuller wants to merge 4 commits intomainfrom
catrielmuller/fix-big-repos

Conversation

@catrielmuller
Copy link
Copy Markdown
Contributor

@catrielmuller catrielmuller commented May 1, 2026

Summary

On huge repos (e.g. 270k+ untracked files) the initial Snapshot.track() can take tens of seconds and wedge the turn before the LLM is even called. This wraps track() with a 10s timeout (configurable via KILO_SNAPSHOT_TRACK_TIMEOUT_MS) and prompts the user to keep waiting or disable snapshots for the project; choosing disable writes "snapshot": false to .kilo/kilo.json directly so the live instance isn't torn down. While the snapshot is running, a synthetic "Initializing snapshot…" text part is injected into the live assistant message so there's a visible reason for the wait — the part is removed when the snapshot finishes, which required plumbing message.part.removed through the SDK → extension → webview.

Also repositions the VS Code standalone question dock above the prompt input (was floating mid-scroll on short conversations) so the slow-repo prompt docks in the expected place.

Pasted image
2026-05-01_20-20-41.mp4

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented May 1, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/opencode/src/snapshot/index.ts
  • packages/ui/src/components/message-part.tsx

Reviewed by gpt-5.5-20260423 · 688,961 tokens

@imanolmzd-svg
Copy link
Copy Markdown
Contributor

imanolmzd-svg commented May 2, 2026

From a newcomer's perspective, I would appreciate a link to an article that explains what snapshots are, and the consequences of enabling/disabling them

@lambertjosh @catrielmuller

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants