Skip to content

✨ feat(onboarding): skip redirect when landing on agent/inbox with message param#15256

Merged
ONLY-yours merged 2 commits into
canaryfrom
feat/skip-onboarding-for-agent-inbox-message
May 27, 2026
Merged

✨ feat(onboarding): skip redirect when landing on agent/inbox with message param#15256
ONLY-yours merged 2 commits into
canaryfrom
feat/skip-onboarding-for-agent-inbox-message

Conversation

@ONLY-yours

@ONLY-yours ONLY-yours commented May 27, 2026

Copy link
Copy Markdown
Member

💻 Change Type

  • ✨ feat

🔗 Related Issue

🔀 Description of Change

Skills Marketplace "Try in LobeHub" links have the format:

/agent/inbox?message=<instruction>&skill=<skill-id>&utm_source=...

Problem: New users arriving via these links were being redirected to /onboarding before their message could be delivered, because useWebUserStateRedirect detects needsOnboarding = true for any new account and immediately navigates away — dropping the message param entirely.

Fix: In useWebUserStateRedirect, return early when the user is on any /agent/* path with a message search param.

Why /agent/* and not just /agent/inbox: AgentIdSync resolves the builtin inbox slug to a real agent ID and rewrites the URL to /agent/{resolvedId}?message=... via navigate(..., { replace: true }). Since useInitBuiltinAgent and useInitUserState run concurrently, the slug rewrite often completes before the user-state callback fires — so pathname is already /agent/{uuid} when the guard runs, and matching only /agent/inbox would silently miss it.

The message query param is the dedicated "send immediately" signal, so widening to /agent/* keeps the guard narrow enough.

🧪 How to Test

  1. Copy a Skills Marketplace link: /agent/inbox?message=<any text>
  2. Open in incognito (not logged in) and complete sign-up
  3. Before: redirected to /onboarding, message lost
  4. After: lands in the agent conversation, message sent automatically

Scenarios covered:

Scenario Expected
Email/password signup, no email verification ✓ lands on /agent/inbox?message=..., message sent
Email/password signup, with email verification callbackUrl preserved through verify-email step
OAuth/SSO signup callbackURL passed to OAuth provider, lands on target
AgentIdSync rewrites slug before callback fires /agent/{uuid}?message=... also matched by new guard
Page refresh after message is consumed message param removed by MessageFromUrl, normal onboarding resumes
Existing user (onboarding already done) needsOnboarding = false, guard never reached
  • Tested locally
  • Added/updated tests
  • No tests needed

📸 Screenshots / Videos

No UI changes.

📝 Additional Information

Onboarding state is not affected — finishedAt is only written when the user explicitly completes the onboarding flow. Skipping the redirect here just defers onboarding to the user's next session on a non-matching URL. There is no recurring check that would force them back mid-session.

…ssage param

New users arriving via /agent/inbox?message=... (e.g. Skills Marketplace
"Try in LobeHub" links) were being redirected to /onboarding before their
message could be sent, breaking the intended flow.

When the user lands on /agent/inbox with a message param, skip the onboarding
redirect so MessageFromUrl can immediately deliver the message. The user will
be prompted to complete onboarding on their next regular visit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented May 27, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
lobehub Canceled Canceled May 27, 2026 3:58am

Request Review

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. feature:agent Assistant/Agent configuration and behavior labels May 27, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We've reviewed this pull request using the Sourcery rules engine

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a56952eace

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/layout/GlobalProvider/useUserStateRedirect.ts Outdated
…g rewrite

The previous guard matched only /agent/inbox, but AgentIdSync rewrites the
builtin slug to the resolved real agent ID (/agent/{uuid}) before the
useInitUserState callback fires — so pathname.startsWith('/agent/inbox')
was false by the time the check ran.

Widen the guard to any /agent/* path with a message param. The message
query param is the "send immediately" signal so the guard remains narrow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.81%. Comparing base (1f6d350) to head (c41820a).

Additional details and impacted files
@@            Coverage Diff             @@
##           canary   #15256      +/-   ##
==========================================
- Coverage   70.82%   70.81%   -0.01%     
==========================================
  Files        3158     3158              
  Lines      315627   315628       +1     
  Branches    34428    34427       -1     
==========================================
- Hits       223529   223527       -2     
- Misses      91929    91932       +3     
  Partials      169      169              
Flag Coverage Δ
app 61.68% <0.00%> (-0.01%) ⬇️
database 92.22% <ø> (ø)
packages/agent-runtime 80.48% <ø> (ø)
packages/builtin-tool-lobe-agent 19.87% <ø> (ø)
packages/context-engine 84.13% <ø> (ø)
packages/conversation-flow 91.28% <ø> (ø)
packages/file-loaders 87.89% <ø> (ø)
packages/memory-user-memory 74.99% <ø> (ø)
packages/model-bank 99.99% <ø> (ø)
packages/model-runtime 83.90% <ø> (ø)
packages/prompts 72.67% <ø> (ø)
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/types 35.07% <ø> (ø)
packages/utils 88.47% <ø> (ø)
packages/web-crawler 88.08% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 67.68% <ø> (ø)
Services 54.64% <ø> (ø)
Server 72.23% <ø> (-0.01%) ⬇️
Libs 56.97% <ø> (ø)
Utils 86.06% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ONLY-yours ONLY-yours merged commit f0eded2 into canary May 27, 2026
35 checks passed
@ONLY-yours ONLY-yours deleted the feat/skip-onboarding-for-agent-inbox-message branch May 27, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature:agent Assistant/Agent configuration and behavior size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant