Skip to content

chore: session followups — CI greens, AGENTS.md auth scope, lobu run shared-DB guard#745

Merged
buremba merged 1 commit into
mainfrom
chore/session-followups
May 15, 2026
Merged

chore: session followups — CI greens, AGENTS.md auth scope, lobu run shared-DB guard#745
buremba merged 1 commit into
mainfrom
chore/session-followups

Conversation

@buremba
Copy link
Copy Markdown
Member

@buremba buremba commented May 15, 2026

Cleans up four loose ends surfaced while debugging the food-ordering agent end-to-end (PRs #734, #735, #740). Each piece is independent; bundled because they're all small and tightly related to the auth/run footguns we hit.

What

  1. format-lint green againpackages/landing/src/components/FeatureGraphics.tsx:357 had a trailing blank line that biome rejected. The CI `format-lint` job has been red on main since this slipped in; this unblocks every PR's CI.

  2. integration green againpackages/server/src/utils/__tests__/mcp-install-targets.test.ts:28 expected the legacy 7-element list of first-class MCP install targets, but the source list now has 9 (`skills` and `lobu-cli` added without updating the test). CI `integration` job goes from red to green on main.

  3. AGENTS.md auth-scope clarification — the "Browser-driven verification" section's forged-session-cookie recipe authenticates only the web admin REST mounted at /, NOT the public Agent API at /lobu. The missing distinction caused an hour of debugging in the previous session.

  4. `lobu run` refuses non-loopback `DATABASE_URL` inherited from shell — if `DATABASE_URL` is set in `process.env` but NOT in the project's `.env`, AND its host isn't loopback, refuse to start. The error spells out three remediations (pin in .env, unset, or pass the new `--unsafe-shared-db` escape hatch). Closes the footgun where a parent shell carries a tailnet/prod URL into a freshly-cloned project's `lobu run`, racing prod workers and mutating shared data.

Out of scope

PR #734's Phase B/C of the agents per-org PK refactor (~67 storage call sites + composite FK swap). Multi-day; separate branch and review pass.

Test plan

  • `bun test packages/cli/src/tests/dev.test.ts` — 6 pass; new test covers `isSharedDatabaseUrl` for loopback / tailnet / prod / IPv6 / garbage cases.
  • `bunx vitest run mcp-install-targets.test.ts` — 3 pass.
  • `bun run typecheck` clean.
  • `bun run format:check` clean.
  • `make build-packages` clean.
  • Verify in CI that the previously-red `format-lint` and `integration` jobs flip to green on this PR.

…shared-DB guard

Cleans up four loose ends surfaced while debugging the food-ordering agent:

1. **format-lint green again** — `packages/landing/src/components/
   FeatureGraphics.tsx:357` had a trailing blank line that biome rejected.
   Stripped via `bunx biome format --write`. The CI `format-lint` job has
   been red on `main` since this slipped in; this unblocks every PR's CI.

2. **integration green again** — `packages/server/src/utils/__tests__/
   mcp-install-targets.test.ts:28` expected the legacy 7-element list of
   first-class MCP install targets, but the source list now has 9 (`skills`
   and `lobu-cli` were added without updating the test). Updated the
   expected array. CI `integration` job goes from red to green on `main`.

3. **AGENTS.md auth-scope clarification** — adds a paragraph to the
   "Browser-driven verification" section calling out that the forged
   session cookie authenticates only the web admin REST mounted at `/`
   (what `lobu apply` and the SPA hit), NOT the public Agent API at
   `/lobu` (which expects a JWT bearer from `lobu login` or a PAT). The
   missing distinction caused an hour of debugging in the previous
   session — anyone hitting `/lobu/api/v1/agents` with a cookie now gets
   pointed at the right auth path.

4. **`lobu run` refuses non-loopback DATABASE_URL inherited from shell** —
   `packages/cli/src/commands/dev.ts` checks at startup: if
   `DATABASE_URL` is set in `process.env` but NOT in the project's `.env`,
   AND its host isn't `localhost` / `127.0.0.1` / `::1`, refuse to start.
   The error spells out three remediations (pin in .env, unset, or pass
   the new `--unsafe-shared-db` escape hatch). Closes the silent footgun
   where a developer's parent shell carries a tailnet/prod URL into a
   freshly-cloned project's `lobu run`, leading to local-dev runs racing
   prod workers and writing into shared data.

Tested:
- `bun test packages/cli/src/__tests__/dev.test.ts` — 6 pass (1 new for
  isSharedDatabaseUrl loopback/tailnet/prod/IPv6/garbage cases)
- `bunx vitest run mcp-install-targets.test.ts` — 3 pass
- `bun run typecheck` clean
- `bun run format:check` clean
- `make build-packages` clean

Out of scope: PR #734's Phase B/C of the agents per-org PK refactor (~67
storage call sites + composite FK swap). That's a multi-day project that
deserves its own branch and review pass.
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Warning

Rate limit exceeded

@buremba has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 31 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9f1e8294-7de2-49e5-8cc3-9e969cbac715

📥 Commits

Reviewing files that changed from the base of the PR and between 587c32f and 1eee347.

📒 Files selected for processing (6)
  • AGENTS.md
  • packages/cli/src/__tests__/dev.test.ts
  • packages/cli/src/commands/dev.ts
  • packages/cli/src/index.ts
  • packages/landing/src/components/FeatureGraphics.tsx
  • packages/server/src/utils/__tests__/mcp-install-targets.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/session-followups

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

@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

❌ Patch coverage is 12.06897% with 51 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/cli/src/commands/dev.ts 12.06% 51 Missing ⚠️

📢 Thoughts on this report? Let us know!

@buremba buremba merged commit 68644f2 into main May 15, 2026
18 of 19 checks passed
@buremba buremba deleted the chore/session-followups branch May 15, 2026 02:39
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