Skip to content

File watcher fires parallel HTTP requests for every file an agent writes #21854

@Dredok

Description

@Dredok

Description

When an agent writes N files in quick succession, the file watcher calls loadFile / refreshDir synchronously for each event. This fires N parallel HTTP requests within milliseconds, saturating the browser connection pool and causing UI stalls.

Steps to reproduce

  1. Start a session and ask the agent to create or modify 10+ files at once
  2. Watch the Network tab — one request per file fires immediately
  3. With enough files the browser connection pool backs up and the UI freezes briefly

OpenCode version

v1.4.1

Operating System

Linux (Ubuntu 24.04), also reproducible on macOS

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)perfIndicates a performance issue or need for optimization

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions