Skip to content

perf(web): critical-path XHR cuts + route code-splitting#1135

Merged
buremba merged 4 commits into
mainfrom
feat/app-bootstrap
May 28, 2026
Merged

perf(web): critical-path XHR cuts + route code-splitting#1135
buremba merged 4 commits into
mainfrom
feat/app-bootstrap

Conversation

@buremba
Copy link
Copy Markdown
Member

@buremba buremba commented May 28, 2026

Bundles two independent web perf wins behind one owletto pointer bump.

1. Kill 3 critical-path XHRs on every page load (owletto#242)

The shell's isReady was blocking on BetterAuth org hooks (get-full-organization ×2, list) plus /api/auth-config fired from non-auth pages. All redundant — org context is derived from /api/organizations, and auth-config is only needed on the login page.

  • API XHRs on a typical page: 11 → 8
  • Shell isReady: ~1563 ms → ~625 ms (~940 ms earlier) on the prod waterfall
  • Net code: owletto -114 lines, server -26 lines
  • Also drops the dead /api/:orgSlug/public/agents endpoint (zero callers)

2. Route-level auto code-splitting (owletto#243)

One line — autoCodeSplitting: true on the TanStack Router Vite plugin. Each route component ships as its own lazy chunk instead of bundling into the entry.

  • First-paint entry chunk: 674 KB → 470 KB gzip (-30%, -204 KB)
  • Chunks: 5 → 60 (heavy routes — entity-type-page, entity-link-cell, connection-create — now load on navigation)
  • No .lazy.tsx files to maintain; routeTree.gen.ts unchanged

Dropped from original plan

Two follow-ups were specced but cut after review:

  • Trim resolve_path bootstrap surface — every field (recent_content/feeds/watchers, connector_definitions, summary) is consumed by the dashboard home on first paint; trimming would just move the XHRs back.
  • Progressive OwnerResolver — the app shell already paints independently via the root layout; only entity-identity chrome waits on resolve_path, which genuinely needs the round-trip.

Verified

  • owletto: tsc -b && vite build green; vite dev boots clean
  • make review BASE=origin/main (phase 1): 0 bugs / 0 blockers
  • 20/20 CI checks green

Summary by CodeRabbit

  • New Features

    • Added public event streaming for cache invalidation notifications.
    • Added content classification update capability with role-based authorization.
  • Removals

    • Removed the public agents listing endpoint.
  • Chores

    • Updated subproject dependencies.

Review Change Stack

Phase 1 of the app-bootstrap initiative. Three measured-and-verified
critical-path XHR cuts on every page load:

  /api/auth/organization/get-full-organization
  /api/auth/organization/list
  /api/auth-config  (on non-auth pages)

Plus the dead /api/:orgSlug/public/agents endpoint that nothing called.

owletto submodule bumped to feat/app-bootstrap (3 commits, -114 lines).
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

📝 Walkthrough

Walkthrough

The PR updates the owletto submodule pointer, removes the public agents list endpoint, and adds two new server API endpoints: one for streaming cache invalidation events to public organizations, and another for updating content classifications with owner/admin authorization.

Changes

Submodule Update

Layer / File(s) Summary
Owletto submodule pointer
packages/owletto
Git submodule reference updated to a new commit SHA.

Server API Endpoint Changes

Layer / File(s) Summary
Remove public agents endpoint
packages/server/src/rest-api.ts
Deleted publicRestListAgents function that provided a sanitized agents list for non-members accessing public workspaces.
Add public SSE events stream endpoint
packages/server/src/rest-api.ts
Added publicRestEventsStream public endpoint with PUBLIC_INVALIDATION_KEYS allowlist to stream cache invalidation events to non-members, filtering to whitelisted keys and scoping to public organizations.
Add content classification update endpoint
packages/server/src/rest-api.ts
Added restUpdateContentClassification PATCH endpoint that validates identifiers, enforces owner/admin roles, calls the manage_classifiers tool to apply changes, and returns updated classification records with full error handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • lobu-ai/lobu#1018: Submodule pointer bump to owletto with overlapping git reference update.
  • lobu-ai/lobu#1095: Includes the same owletto submodule pointer update alongside unrelated server endpoint changes.
  • lobu-ai/lobu#825: Shares the owletto submodule SHA pointer bump common to this PR.

Poem

🐰 Hop along, dear reviewer, through code anew!
Old agents gone, events stream flows true,
Classifications updated with owner's care,
Owletto bounds forward—changes in the air!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description includes detailed summaries of both performance improvements, explains dropped follow-ups, and documents verification steps; however, it does not follow the provided template structure with Test plan and Notes sections. Restructure the description to match the template: add a Summary section (1–3 bullets), a Test plan checklist, and a Notes section with any follow-ups or breaking changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title correctly reflects the main changes: removing critical-path XHRs and implementing route code-splitting in the web layer via owletto submodule bump.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/app-bootstrap

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@buremba
Copy link
Copy Markdown
Member Author

buremba commented May 28, 2026

bug_free 78, simplicity 92, slop 0, bugs 0, 0 blockers

Script suites passed: typecheck/unit/integration. Reviewed server diff and owletto submodule commits; owletto commit is on origin/feat/app-bootstrap. [env] Exploratory server /health boot failed because DATABASE_URL is unset; raw frontend bun test lacked jsdom/document harness.

Full verdict JSON
{
  "bug_free_confidence": 78,
  "bugs": 0,
  "slop": 0,
  "simplicity": 92,
  "blockers": [],
  "change_type": "refactor",
  "behavior_change_risk": "medium",
  "tests_adequate": true,
  "suggested_fixes": [],
  "notes": "Script suites passed: typecheck/unit/integration. Reviewed server diff and owletto submodule commits; owletto commit is on origin/feat/app-bootstrap. [env] Exploratory server /health boot failed because DATABASE_URL is unset; raw frontend bun test lacked jsdom/document harness.",
  "categories": {
    "src": 26,
    "tests": 0,
    "docs": 0,
    "config": 0,
    "deps": 2,
    "migrations": 0,
    "ci": 0,
    "generated": 0
  }
}

Local review gate — branch protection can require the pi-review commit status. See docs/REVIEW_SCHEMA.md.

@buremba buremba enabled auto-merge (squash) May 28, 2026 17:29
@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@buremba buremba changed the title perf: bump owletto with phase-1 XHR cuts + drop dead /public/agents perf(web): critical-path XHR cuts + route code-splitting May 28, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/owletto`:
- Line 1: The gitlink for the submodule at packages/owletto points to a
non-existent commit b05d2faa2e8c793a3f579baab0ff146fd9566c64; update the
submodule reference to a valid commit that exists on the feat/app-bootstrap
branch (or replace the gitlink with the correct repository/source if it’s
non-public) by updating the .gitmodules/entry and index entry for
packages/owletto and running git submodule sync && git submodule update --init
--recursive to verify; after updating the commit, run the pending smoke tests
and the Chrome extension / Mac app org-resolution verification for the auth/org
flow changes to ensure nothing broke (refer to the packages/owletto gitlink
entry and the feat/app-bootstrap branch when locating the correct commit).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b583291c-e678-4b4f-a9bb-85bad8808326

📥 Commits

Reviewing files that changed from the base of the PR and between 51124de and 9a0d2a0.

📒 Files selected for processing (3)
  • packages/owletto
  • packages/server/src/index.ts
  • packages/server/src/rest-api.ts
💤 Files with no reviewable changes (2)
  • packages/server/src/index.ts
  • packages/server/src/rest-api.ts

Comment thread packages/owletto
@@ -1 +1 @@
Subproject commit 6bcdb9c71645c98d7ee543d9c387747b864b8b78
Subproject commit b05d2faa2e8c793a3f579baab0ff146fd9566c64
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify owletto submodule commit exists on feat/app-bootstrap branch

cd packages/owletto 2>/dev/null || {
  echo "Note: owletto submodule not checked out in sandbox"
  echo "Verify commit b05d2faa2e8c793a3f579baab0ff146fd9566c64 exists at:"
  echo "  - Repository: owletto"
  echo "  - Branch: feat/app-bootstrap"
  exit 0
}

# Check if commit exists
git cat-file -t b05d2faa2e8c793a3f579baab0ff146fd9566c64 2>/dev/null || {
  echo "Commit b05d2faa2e8c793a3f579baab0ff146fd9566c64 not found locally"
  exit 1
}

# Check if commit is on feat/app-bootstrap
git branch -r --contains b05d2faa2e8c793a3f579baab0ff146fd9566c64 | grep -q 'feat/app-bootstrap'

Repository: lobu-ai/lobu

Length of output: 1943


🏁 Script executed:

cd packages/owletto || exit 1
git cat-file -t b05d2faa2e8c793a3f579baab0ff146fd9566c64
git branch -r --contains b05d2faa2e8c793a3f579baab0ff146fd9566c64 | rg -q 'origin/feat/app-bootstrap|feat/app-bootstrap'

Repository: lobu-ai/lobu

Length of output: 400


🏁 Script executed:

# Local checks to attach to the PR:
git submodule status
cat .gitmodules
git ls-files -s packages/owletto
ls -la packages/owletto

Repository: lobu-ai/lobu

Length of output: 395


🌐 Web query:

Find commit b05d2faa2e8c793a3f579baab0ff146fd9566c64 in https://github.com/lobu-ai/owletto and determine which branch it belongs to (feat/app-bootstrap)

💡 Result:

The commit b05d2faa2e8c793a3f579baab0ff146fd9566c64 does not exist in the lobu-ai/owletto repository. Searches across the repository's commit history and related technical documentation confirmed that the repository does not contain this specific commit hash [1][2]. The requested branch feat/app-bootstrap is also not associated with any recorded commit in the public repository history.

Citations:


Fix owletto submodule SHA: target commit doesn’t exist

  • packages/owletto now points to b05d2faa2e8c793a3f579baab0ff146fd9566c64, but that SHA can’t be fetched from https://github.com/lobu-ai/owletto.git (upload-pack: not our ref) and isn’t present in the public lobu-ai/owletto history.
  • Update the gitlink to a commit that exists on feat/app-bootstrap (or document the correct non-public source), then complete the pending smoke test + Chrome extension / Mac app org-resolution verification for the auth/org flow changes.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/owletto` at line 1, The gitlink for the submodule at
packages/owletto points to a non-existent commit
b05d2faa2e8c793a3f579baab0ff146fd9566c64; update the submodule reference to a
valid commit that exists on the feat/app-bootstrap branch (or replace the
gitlink with the correct repository/source if it’s non-public) by updating the
.gitmodules/entry and index entry for packages/owletto and running git submodule
sync && git submodule update --init --recursive to verify; after updating the
commit, run the pending smoke tests and the Chrome extension / Mac app
org-resolution verification for the auth/org flow changes to ensure nothing
broke (refer to the packages/owletto gitlink entry and the feat/app-bootstrap
branch when locating the correct commit).

@buremba buremba merged commit 9c5a3ce into main May 28, 2026
24 checks passed
@buremba buremba deleted the feat/app-bootstrap branch May 28, 2026 18:28
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