✨ feat(onboarding): skip redirect when landing on agent/inbox with message param#15256
Merged
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 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".
…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 Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💻 Change Type
🔗 Related Issue
🔀 Description of Change
Skills Marketplace "Try in LobeHub" links have the format:
Problem: New users arriving via these links were being redirected to
/onboardingbefore their message could be delivered, becauseuseWebUserStateRedirectdetectsneedsOnboarding = truefor any new account and immediately navigates away — dropping themessageparam entirely.Fix: In
useWebUserStateRedirect, return early when the user is on any/agent/*path with amessagesearch param.Why
/agent/*and not just/agent/inbox:AgentIdSyncresolves the builtininboxslug to a real agent ID and rewrites the URL to/agent/{resolvedId}?message=...vianavigate(..., { replace: true }). SinceuseInitBuiltinAgentanduseInitUserStaterun concurrently, the slug rewrite often completes before the user-state callback fires — sopathnameis already/agent/{uuid}when the guard runs, and matching only/agent/inboxwould silently miss it.The
messagequery param is the dedicated "send immediately" signal, so widening to/agent/*keeps the guard narrow enough.🧪 How to Test
/agent/inbox?message=<any text>/onboarding, message lostScenarios covered:
/agent/inbox?message=..., message sentcallbackUrlpreserved through verify-email stepcallbackURLpassed to OAuth provider, lands on target/agent/{uuid}?message=...also matched by new guardmessageparam removed byMessageFromUrl, normal onboarding resumesneedsOnboarding = false, guard never reached📸 Screenshots / Videos
No UI changes.
📝 Additional Information
Onboarding state is not affected —
finishedAtis 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.