Repository navigation
feat(console): serve apple-app-site-association for iOS pair links - #58540
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Looks good. I ran the console app with vite dev on the base and on this branch. On the base, /.well-known/apple-app-site-association returns 404 (HTML). On this branch, GET returns 200 with application/json and the expected AASA JSON, HEAD returns the same headers with no body, and /pair still returns 404. bun test (49 pass) and typecheck:tsc both pass. Handling this first in the middleware, before locale and redirect handling, is the right place given that the file router skips dot directories.
Public API: unchanged (no SDK, server API, CLI, config or plugin surface). The site now serves one new public URL on opencode.ai, which only affects how iOS opens /pair links.
No blocking concerns.
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.
What it does.
https://opencode.ai/pair#…links (the pairing linksopencode pairprints) open in Safari today. This serves an Apple App Site Association file so iOS opens them in the OpenCode iOS app instead. Only/pairand/pair/*open the app; every other opencode.ai URL keeps opening in the browser.How it works.
GET/HEAD /.well-known/apple-app-site-associationwith the JSON below,Content-Type: application/json, no redirect, before any other handling.fast-globwithoutdot), and a static file inpublic/would be served without an extension asapplication/octet-stream.{"applinks":{"details":[{"appIDs":["5NZ4Q7NXJ4.ai.opencode.mobilecode"],"components":[{"/":"/pair","comment":"pairing links, payload in the fragment"},{"/":"/pair/*"}]}]}}The app side (
applinks:opencode.aientitlement and the/pair#<base64url {"code","urls"}>handler) is already shipping in the iOS app.Risk. Small: one exact path in the opencode.ai console worker. Nothing else changes, and
/pairitself still 404s in a browser. Apple's CDN caches AASA files, so devices pick this up within about a day of deploy. To check after deploy:Proof.
bun testinpackages/console/app: 49 pass, including newtest/appleAppSiteAssociation.test.ts(body, content type, HEAD, other paths and methods ignored).bun run typecheck:tsc: pass.bun run build: pass.wrangler dev:GET /.well-known/apple-app-site-association→200,Content-Type: application/json, the JSON above;/pair→ 404 as before.