Skip to content

fix(dev): print seeded dev-admin credentials in the serve startup banner - #1510

Merged
xuyushun441-sys merged 1 commit into
mainfrom
fix/print-seeded-admin
Jun 2, 2026
Merged

fix(dev): print seeded dev-admin credentials in the serve startup banner#1510
xuyushun441-sys merged 1 commit into
mainfrom
fix/print-seeded-admin

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

Problem

After #1503 moved dev-admin seeding in-process, the confirmation line went silent. The seed runs inside runtime.start(), which is within serve's boot-quiet window (stdout is suppressed to produce a clean banner, restored only afterward). So the ctx.logger.info('🔑 Dev admin seeded …') line was swallowed — a DX regression vs the old HTTP seed, which printed the credentials.

Fix

plugin-auth records the seed result on the auth service (AuthManager.devSeedResult). serve reads it after restoreOutput() and renders it inside the ready banner:

 ✓ Server is ready
➜ API: http://localhost:3999/
➜ Console: http://localhost:3999/_console/
🔑 Dev admin: admin@objectos.ai / admin123
seeded on empty DB · dev only — do not use in production
  • Single print point. Because os dev spawns serve with inherited stdout, printing from the serve child covers both serve --dev standalone and the os dev console — no IPC needed for this.
  • Never stale. The line shows only when an admin was actually seeded this boot (empty DB). On a populated DB the seed skips, devSeedResult stays undefined, and nothing prints.
  • Dev-only by construction (the seed itself is hard-gated to NODE_ENV=development).

Verification (showcase)

CaseResult
Fresh DB → seedsbanner shows 🔑 Dev admin: …
Second run, same DB → skipbanner has no Dev-admin line ✓

Tests: cli 144, plugin-auth 88 — all green. Typecheck/build clean.

🤖 Generated with Claude Code

The in-process dev seed confirmed via ctx.logger during runtime.start(),
inside serve's boot-quiet window, so the line was swallowed and never
reached the console (a regression vs the old HTTP seed, which printed the
credentials). plugin-auth now records the seed result on the `auth`
service; serve reads it after restoreOutput() and renders it in the ready
banner:
🔑 Dev admin: admin@objectos.ai / admin123
seeded on empty DB · dev only — do not use in production
Shown only when an admin was actually seeded this boot (empty DB), so
stale credentials are never displayed on a populated DB. Visible in both
`serve --dev` and `os dev` (the child's stdout is inherited by the parent
terminal). Verified: line appears on a fresh DB, absent on a second run.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercelBot commented Jun 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
specReadyReadyPreview, CommentJun 2, 2026 2:43am

Request Review

@github-actionsgithub-actionsBot added documentation Improvements or additions to documentation tooling size/s labels Jun 2, 2026
@xuyushun441-sys
xuyushun441-sys merged commit b7a4f14 into mainJun 2, 2026
12 checks passed
@xuyushun441-sys
xuyushun441-sys deleted the fix/print-seeded-admin branch June 2, 2026 02:51
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/stooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@xuyushun441-sys@os-zhuang