Skip to content

Start notification-mode runs before watch discovery - #838

Open
longlho wants to merge 2 commits into
bazelbuild:mainfrom
longlho:agent/start-run-before-watch-query
Open

Start notification-mode runs before watch discovery#838
longlho wants to merge 2 commits into
bazelbuild:mainfrom
longlho:agent/start-run-before-watch-query

Conversation

@longlho

@longlho longlho commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Why

ibazel run discovers the full transitive watch graph before starting the target. In large workspaces, this can delay a notification-mode dev server by tens of seconds even though the process can stay alive while iBazel installs watchers.

What

  • inspect the target tags up front, then start ibazel_notify_changes targets before full watch discovery
  • install watchers after startup and send a synthetic graph change for a catch-up build
  • support both legacy and v1 notification protocols
  • preserve query-first behavior for restart-mode targets, builds, tests, and coverage

Verification

The notification example served before watch discovery completed, received the catch-up build without restarting, then rebuilt normally after a source edit.

@longlho
longlho marked this pull request as ready for review August 6, 2026 14:17
@longlho
longlho requested a review from achew22 as a code owner August 6, 2026 14:17
@longlho longlho changed the title Start notification runs before watch discovery Start notification-mode runs before watch discovery Aug 6, 2026
@longlho

longlho commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

this improved our cold start for web specifically by like 40%

longlho added a commit to perplexityai/bazel-watcher that referenced this pull request Aug 7, 2026
## Why

Notification-mode devservers can stay alive while iBazel discovers their
watch graph. Waiting for that query before launch puts a large,
unnecessary delay on startup.

## What changed

Port
[bazelbuild#838](bazelbuild#838)
onto the Perplexity fork:

- start notification-mode runs before watch discovery
- install watchers afterward and send a catch-up graph build
- preserve query-first behavior for restart-mode targets, builds, tests,
and coverage
- compose the upstream lifecycle change with our structured BEP output
notifications
@longlho

longlho commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

gentle ping @achew22 pls pls :)

@longlho

longlho commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

im also more than happy to help maintain this project as well

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.

1 participant