René's URL Explorer Experiment


Title: Add /_/* redirect route by claude[bot] · Pull Request #4523 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: Add /_/* redirect route by claude[bot] · Pull Request #4523 · triggerdotdev/trigger.dev

X Title: Add /_/* redirect route by claude[bot] · Pull Request #4523 · triggerdotdev/trigger.dev

Description: Requested by Chris Arderne · Slack thread Before: there's no stable URL you can put in docs, an email or a Slack message that lands someone on their own project's API keys page — every dashboard URL contains the org, project and environment slugs, so you have to tell people to navigate there by hand. After: /_/apikeys resolves the signed-in user's current organization, project and environment and redirects to /orgs/{org}/projects/{project}/env/{env}/apikeys. Deeper segments are preserved (/_/runs/run_abc123) and the query string is passed through. If you're not signed in, login happens first and you land on the deeplink afterwards. The preserved suffix drops . and .. segments in both their plain and escaped spellings, so a crafted URL can't escape the resolved environment path. The /_/ prefix matches how Supabase spells the same idea. How New loader-only route apps/webapp/app/routes/[_].$.ts, modelled on the existing redirect-only routes (orgs.$organizationSlug.projects.$projectParam.apikeys.ts, orgs.$organizationSlug.projects.v3.$.ts): requireUser (app/services/session.server.ts) — already redirects to /login?redirectTo=…, so the deeplink survives login. SelectBestEnvironmentPresenter.call({ user }) resolves org + project + environment from dashboard preferences, falling back to the most recently updated project and the user's dev/prod environment. The suffix is resolved by resolveDeeplinkPage against ENV_PAGE_TARGETS in app/utils/deeplinkPages.ts, which mirrors the environment layout's routes (_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.*). An unrecognised first segment redirects to the environment root — a user-supplied path is never used as the redirect target. The query string survives either way, so /_, /_/nonsense and /_/tasks all behave alike. A user with pending invites goes to invitesPath() first, mirroring _app._index/route.tsx — a deeplink is exactly the URL a new invitee is sent, and without this they were offered organization creation while their invite sat unaccepted. If the user has no projects the presenter throws, and we branch to newProjectPath / newOrganizationPath exactly like _app._index/route.tsx does. The suffix is read from new URL(request.url).pathname rather than the splat param, which React Router decodes. The dashboard writes a task id containing a slash as group/my-task, and the decoded param split that into two segments that matched no route. Segments are passed through as they arrived — re-encoding would turn / into %2F. Why the filename is [_].$.ts The brackets are Remix's character escape, and they're load-bearing. In the flat-route convention a segment beginning with _ is a pathless layout that contributes nothing to the URL, so a plain _.$.ts would mount this route at /* and swallow the entire site. createRoutePath skips a segment only when the cooked and the raw spelling both start with _: // skip pathless layout segments if (segment.startsWith("_") && rawSegment.startsWith("_")) { continue; } For [_].$ the escape parser yields segment = "_" but rawSegment = "[_]", so the skip doesn't fire and the segment survives as a literal. Running the repo's own routes directory through flatRoutes() on @remix-run/dev 2.17.5 confirms it: { file: "routes/[_].$.ts", id: "routes/[_].$", path: "_/*", parentId: "root" } The same entry appears in the production server build's route manifest, no route-path collisions are reported across the other 482 routes, and nothing else in the app claims /_ or anything under it. No route file used […] escaping before this one, so the test asserts the resulting pattern (/_/*) directly rather than leaving it implicit. One consequence: the prefix comparison in deeplinkSuffix no longer folds case. It used to, because React Router compiles route paths with the i flag and /Deeplink/apikeys really did reach the loader — but _ has no case, so the fold became dead code. Page-name folding stays, since /_/APIKeys still has a route to agree with. Why the map has two paths per entry Most names are a page in their own right. Three segments under the environment layout are not — they exist only as the parent of param or child routes, so a bare URL matches no route and would 404: name bare URL resolves landing prefix for deeper segments tasks no (only tasks.dashboard, tasks.{standard,scheduled}.$taskParam, tasks.stream) the environment root tasks waitpoints no (only waitpoints.tokens[.$waitpointParam]) waitpoints/tokens waitpoints/tokens metrics no (only metrics.$dashboardKey, metrics.custom.$dashboardId) — dropped — So each entry carries a landing used for a bare /_/ and a prefix that deeper segments hang off; for an ordinary page both are just the name. The two differ only where the page and the things underneath it live in different places: the task list is the environment root (that route is the env _index, titled "Tasks") while task detail pages are under /tasks. A single "prefix the target" rule would fix waitpoints and break tasks. metrics is left out entirely — it's only a legacy 301 shim to dashboards with no page of its own, so it falls back to the environment root rather than being given an invented target. A suffix that already spells out a path under the prefix is kept as written, so the shorthand /_/waitpoints/waitpoint_123 and the longhand /_/waitpoints/tokens/waitpoint_123 agree. ENV_PAGE_META in app/components/navigation/favoritePages.tsx looked like the natural source for this list, but it only lists segments that need an icon and a label — tasks, agents and settings get theirs from special cases when resolving page metadata — and it says nothing about whether a segment resolves on its own. The route files answer both questions, so they are the source of truth. No /deeplink/ alias. The route hasn't shipped, so nothing links to the old spelling and there's no compatibility to preserve. Keeping both would mean two route files and a two-valued prefix constant for no gain. No project-picker fallback page. The presenter always resolves something for a user with at least one project, and the zero-project case already has a well-defined destination (create project / create org), so an intermediate "which project did you mean?" page would never be shown in practice. ✅ Checklist I have followed every step in the contributing guide The PR title follows the convention. I ran and tested the code works Testing pnpm run format, pnpm run lint:fix, pnpm run typecheck --filter webapp and pnpm run build --filter webapp are clean — the build matters here because the route filename is what produces the URL. Not yet exercised against a running dashboard — worth clicking through /_/apikeys, /_/tasks, /_/waitpoints, /_/runs?statuses=COMPLETED_SUCCESSFULLY, /_/runs/run_…, /_/nonsense and /_ while signed out and signed in. app/utils/deeplinkPages.test.ts reads the environment layout's route files and enforces the invariants that keep the map honest: every landing page resolves to a real route — a leaf route or an _index child, since a param route like metrics.$dashboardKey isn't somewhere you can arrive without the param; every deep link that can actually be made resolves, walking the real child routes under each prefix rather than probing one synthetic segment (names whose children are all literal, like settings/general and alerts/new, need that); every segment that resolves on its own has a deeplink name, so a new page can't be quietly forgotten; the mounted path really is /_/*, asserted with matchPath against the prefix constant the loader strips — the one invariant with no in-repo precedent to lean on. Deliberate exclusions are named in the test: _index (the environment root, which tasks already points at) and queues_ (Remix's layout-opt-out spelling of queues, not a distinct URL). Failures name the offending entry. Traversal is covered in both spellings, because the two escapes behave differently and it's worth knowing which layer stops each. / survives in pathname, so an escaped slash inside an id stays one segment. .. does not: WHATWG normalises it to .. and resolves it, so /_/runs/../../etc reaches the loader as /etc — outside the prefix, and treated as no suffix. Individually, a segment is dropped when it is ./.., when it decodes to one, or when it isn't decodable. Both parser behaviours are asserted rather than assumed. The redirect loader itself is still untested: there is no existing pattern for testing a redirect-only Remix loader in this repo. Changelog Short links like /_/apikeys now take you straight to that page in your current project and environment (.server-changes/deeplink-routes.md). Generated by Claude Code

Open Graph Description: Requested by Chris Arderne · Slack thread Before: there's no stable URL you can put in docs, an email or a Slack message that lands someone on their own project's API keys page — every dash...

X Description: Requested by Chris Arderne · Slack thread Before: there's no stable URL you can put in docs, an email or a Slack message that lands someone on their own project's API keys page — ev...

Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/4523

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:5f3140ac-8b54-a11a-bc5e-f54fbd48f0e5
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idECF6:18D292:185695:22AA6A:6AFAF69B
html-safe-nonce2d3710a75ad321d7b5cd62cdc4a64cc9b0f104117234b536aabad8de0467a872
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0Y2OjE4RDI5MjoxODU2OTU6MjJBQTZBOjZBRkFGNjlCIiwidmlzaXRvcl9pZCI6IjIzMTQyMjc1MzQ0OTQ2Mjc0ODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac5fc381cb04c005a99d4954ad9b1ecb344793021c694e041a8090f42f73c1c3df
hovercard-subject-tagpull_request:4222696556
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/triggerdotdev/trigger.dev/pull/4523/files
twitter:imagehttps://avatars.githubusercontent.com/in/1236702?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/in/1236702?s=400&v=4
og:image:altRequested by Chris Arderne · Slack thread Before: there's no stable URL you can put in docs, an email or a Slack message that lands someone on their own project's API keys page — every dash...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None54f7a6886649661c85eee945cca0773566bfb4065370e0429b7c8f7204184650
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git
octolytics-dimension-user_id95297378
octolytics-dimension-user_logintriggerdotdev
octolytics-dimension-repository_id572570113
octolytics-dimension-repository_nwotriggerdotdev/trigger.dev
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id572570113
octolytics-dimension-repository_network_root_nwotriggerdotdev/trigger.dev
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasecf8450eb633ec589502c42ff6f4072e40db65da3
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/4523/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4523%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4523%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=triggerdotdev%2Ftrigger.dev
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4523/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4523/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4523/files
triggerdotdevhttps://github.com/triggerdotdev
trigger.devhttps://github.com/triggerdotdev/trigger.dev
Codehttps://github.com/triggerdotdev/trigger.dev
Issues203 (203)https://github.com/triggerdotdev/trigger.dev/issues
Pull requests67 (67)https://github.com/triggerdotdev/trigger.dev/pulls
Discussionshttps://github.com/triggerdotdev/trigger.dev/discussions
Actionshttps://github.com/triggerdotdev/trigger.dev/actions
Projectshttps://github.com/triggerdotdev/trigger.dev/projects
Security and quality39 (39)https://github.com/triggerdotdev/trigger.dev/security
Insightshttps://github.com/triggerdotdev/trigger.dev/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
cardernehttps://github.com/carderne
mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
deeplink-routehttps://github.com/triggerdotdev/trigger.dev/tree/deeplink-route
Conversation 44 https://github.com/triggerdotdev/trigger.dev/pull/4523
Commits 12 https://github.com/triggerdotdev/trigger.dev/pull/4523/commits
Checks 44 https://github.com/triggerdotdev/trigger.dev/pull/4523/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/4523/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4523/files
Add /_/* redirect route https://github.com/triggerdotdev/trigger.dev/pull/4523/files#top
Show all changes 12 commits https://github.com/triggerdotdev/trigger.dev/pull/4523/files
d2efe29 Add /deeplink/* redirect route claude Aug 6, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/d2efe29456c7bb230c5a93b7e75b3bae3adea073
e326919 Harden the deeplink suffix against traversal and delimiter injection claude Aug 6, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/e326919772f8fb1fa615ad76e5c2fcb76f1c333f
a1fa385 Derive deeplink allowlist from the environment route segments claude Aug 6, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/a1fa3858a76442da96948e92cc5320bc9b4d0ea7
cf24f03 Add a test that the deeplink allowlist matches the environment routes claude Aug 6, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/cf24f034b06a5535001d339349e64eec360e3d16
c72f501 Send deeplinks whose own segment has no page to a page that exists claude Aug 6, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/c72f50109716d19b684289b060f7145cafc2b880
90577d2 Give deeplink targets a separate landing path and deep prefix claude Aug 6, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/90577d28590566284a3ed2627c784d1f8d060eb4
1660450 Read the deeplink suffix from the pathname, and honour pending invites claude Aug 6, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/16604509b4c4d5746692dd0150a28dff6d203538
71c6d3c Match a deeplink's prefix and page name the way the router does claude Aug 6, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/71c6d3c9e044f2e86cad456899ac62ec37b510d9
6b2e0f9 Compare a written-out deeplink prefix with its case folded too claude Aug 6, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/6b2e0f97e52b1a085c29987f3f89f84a02d98dfe
f93a892 Serve deeplinks from /_ instead of the deeplink literal claude Aug 7, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/f93a89278e4e12cd5fcee13df8b4b5147acf271d
3de75c1 Assert the deeplink route's path from Remix's own route manifest claude Aug 7, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/3de75c10090729ecf469280e7ceb4348c8a8779c
f505054 Cut the deeplink route's comments back to what the code can't say itself claude Aug 7, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/f5050541797194b22dc1333f1461778b9638820c
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/4523/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4523/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4523/files
deeplink-routes.md https://github.com/triggerdotdev/trigger.dev/pull/4523/files#diff-bfb3cee0c02b4b0f1111eb7e84087007af5d6395140e3045cf2849fff9e91dd5
[_].$.ts https://github.com/triggerdotdev/trigger.dev/pull/4523/files#diff-df472a0a20c6da56cc62056f19205132666bfb9c4e9e752c9f20aac23258515e
deeplinkPages.test.ts https://github.com/triggerdotdev/trigger.dev/pull/4523/files#diff-9b4e1a5f02d9dc2bf42b86616b30d2e2e4528c30043c2dd81287f899e3df05d7
deeplinkPages.ts https://github.com/triggerdotdev/trigger.dev/pull/4523/files#diff-843bf93e256d89fd4c3c296f54498279d5e92038ebc583b4b0fa352b693ce061
.server-changes/deeplink-routes.mdhttps://github.com/triggerdotdev/trigger.dev/pull/4523/files#diff-bfb3cee0c02b4b0f1111eb7e84087007af5d6395140e3045cf2849fff9e91dd5
View file https://github.com/triggerdotdev/trigger.dev/blob/f5050541797194b22dc1333f1461778b9638820c/.server-changes/deeplink-routes.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4523/{{ revealButtonHref }}
apps/webapp/app/routes/[_].$.tshttps://github.com/triggerdotdev/trigger.dev/pull/4523/files#diff-df472a0a20c6da56cc62056f19205132666bfb9c4e9e752c9f20aac23258515e
View file https://github.com/triggerdotdev/trigger.dev/blob/f5050541797194b22dc1333f1461778b9638820c/apps/webapp/app/routes/%5B_%5D.%24.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4523/{{ revealButtonHref }}
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4523/files
apps/webapp/app/utils/deeplinkPages.test.tshttps://github.com/triggerdotdev/trigger.dev/pull/4523/files#diff-9b4e1a5f02d9dc2bf42b86616b30d2e2e4528c30043c2dd81287f899e3df05d7
View file https://github.com/triggerdotdev/trigger.dev/blob/f5050541797194b22dc1333f1461778b9638820c/apps/webapp/app/utils/deeplinkPages.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4523/{{ revealButtonHref }}
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4523/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4523/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.