perf(web): critical-path XHR cuts + route code-splitting#1135
Conversation
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).
📝 WalkthroughWalkthroughThe 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. ChangesSubmodule Update
Server API Endpoint Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
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 |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
packages/owlettopackages/server/src/index.tspackages/server/src/rest-api.ts
💤 Files with no reviewable changes (2)
- packages/server/src/index.ts
- packages/server/src/rest-api.ts
| @@ -1 +1 @@ | |||
| Subproject commit 6bcdb9c71645c98d7ee543d9c387747b864b8b78 | |||
| Subproject commit b05d2faa2e8c793a3f579baab0ff146fd9566c64 | |||
There was a problem hiding this comment.
🧩 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/owlettoRepository: 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:
- 1: https://github.com/lobu-ai/owletto/commit/747e692cc35886a8f1326e2c80621d7664a00ca6
- 2: https://github.com/lobu-ai/owletto/commit/6d9763d2081e91e31107637336749c0e8214d45e
Fix owletto submodule SHA: target commit doesn’t exist
packages/owlettonow points tob05d2faa2e8c793a3f579baab0ff146fd9566c64, but that SHA can’t be fetched fromhttps://github.com/lobu-ai/owletto.git(upload-pack: not our ref) and isn’t present in the publiclobu-ai/owlettohistory.- 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).
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
isReadywas blocking on BetterAuth org hooks (get-full-organization×2,list) plus/api/auth-configfired from non-auth pages. All redundant — org context is derived from/api/organizations, and auth-config is only needed on the login page.isReady: ~1563 ms → ~625 ms (~940 ms earlier) on the prod waterfall/api/:orgSlug/public/agentsendpoint (zero callers)2. Route-level auto code-splitting (owletto#243)
One line —
autoCodeSplitting: trueon the TanStack Router Vite plugin. Each route component ships as its own lazy chunk instead of bundling into the entry..lazy.tsxfiles to maintain;routeTree.gen.tsunchangedDropped from original plan
Two follow-ups were specced but cut after review:
Verified
tsc -b && vite buildgreen; vite dev boots cleanmake review BASE=origin/main(phase 1): 0 bugs / 0 blockersSummary by CodeRabbit
New Features
Removals
Chores