From f2c1a5ec89b414e8c26687ef583e8ff146f879bc Mon Sep 17 00:00:00 2001 From: BotHarness Date: Sun, 22 Nov 2026 05:49:49 +0900 Subject: [PATCH 01/12] Add HTTPS Owner sign-in on iOS and Android Issue: #4900 Agent-Task: codex/local/01a1ff25-bf04-7871-9287-3625c3cb9dcd --- .../features/phone-pairing.md | 8 + apps/mobile/app/pair/_layout.tsx | 1 + apps/mobile/app/pair/index.tsx | 9 ++ apps/mobile/app/pair/owner.tsx | 138 ++++++++++++++++++ .../features/environments/pairing-strings.ts | 22 +++ apps/mobile/src/host/host-session.ts | 52 +++++++ apps/mobile/src/host/native-carrier.ts | 5 +- .../mobile/test/host-session-multiple.test.ts | 52 +++++++ .../test/native-carrier-request.test.ts | 40 +++++ .../mobile/test/owner-sign-in-screen.test.tsx | 116 +++++++++++++++ apps/mobile/test/pair-choice.test.tsx | 6 + changes/4900-mobile-owner-remote-sign-in.md | 11 ++ .../src/client/owner-sign-in-dialog.tsx | 18 +-- packages/host-client/src/owner-sign-in.ts | 16 ++ 14 files changed, 477 insertions(+), 17 deletions(-) create mode 100644 apps/mobile/app/pair/owner.tsx create mode 100644 apps/mobile/test/native-carrier-request.test.ts create mode 100644 apps/mobile/test/owner-sign-in-screen.test.tsx create mode 100644 changes/4900-mobile-owner-remote-sign-in.md diff --git a/.agents/skills/verify-deepseekbot/features/phone-pairing.md b/.agents/skills/verify-deepseekbot/features/phone-pairing.md index b44a7a1640..4f03b47d38 100644 --- a/.agents/skills/verify-deepseekbot/features/phone-pairing.md +++ b/.agents/skills/verify-deepseekbot/features/phone-pairing.md @@ -2,6 +2,8 @@ ## Sources +- `apps/mobile/app/pair/{_layout,index,owner}.tsx` +- `apps/mobile/src/host/{host-session,native-carrier}.ts` - `apps/mobile/app/member-pairing.tsx` - `apps/mobile/src/host/{account-pairing,pairing-image}.ts` - `apps/mobile/src/ui/pairing-failure.ts` @@ -16,6 +18,12 @@ - Paired Device - Host Relationship +## Owner sign-in over HTTPS (#4900) + +In the shared device QA lanes, use two isolated Hosts with separate Feed markers and trusted HTTPS addresses. On each platform, start without a saved Host, then choose **Sign in with username and password** under **Pair with your computer**. The Host records an Owner password-enrolled device and the phone opens its Feed. Open the workspace drawer, choose **Add computer**, and sign in to the second Host through the same entry. Open each Feed and verify the markers stay scoped to their Host. Confirm a duplicate attempt leaves the original saved grant intact. + +Exercise an untrusted certificate, a redirect and a changed key for a saved Host. In each case, verify the Host receives no password. Correct a wrong credential and retry with the address and username still populated. Verify QR pairing, fingerprint comparison and approval from the same menu. Repeat the form with the software keyboard and default, intermediate and maximum text sizes in both themes. Save redacted visuals for the menu and form on each platform. + ## Connect desktop self-check (#4170) In a task-owned signed-in Host, open Connections → Tobs Connect and verify automatic check progress after sign-in/connector recovery. Compare the card and `deepseekbot connect-check` with `connect-status` through the same authenticated Host. A running connector alone must remain neutral. Require relay online plus a fresh Host-pinned public encrypted handshake before success; observe checked time and copy only bounded diagnostics. Inject task-owned DNS/TLS/HTTP/handshake failures, retry after recovery, expire the observation and fail the snapshot/retry request: none may retain green success. Opening the dialog must not start extra probes. Transient public failures retry at most four attempts with 1/3/6-second waits within the same 20-second deadline; certificate/identity failures refuse immediately, including incomplete certificate chains. Handshake payloads are limited to1KiB without compression before Noise decoding. A stale checking snapshot must allow retry when no local request is active; manual requests time out after25seconds and abort on card close. Each completed check refreshes the account computer list once without closing an existing management confirmation. A health refresh that interrupts a post-revoke list read must start a replacement read and leave controls usable. Do not change production DNS, other Host bindings or device grants. Record official-service versus isolated transport-fixture proof separately; desktop self-check does not qualify every phone network or reproduce a customer fault. diff --git a/apps/mobile/app/pair/_layout.tsx b/apps/mobile/app/pair/_layout.tsx index dd86ae0c1f..281835fb9d 100644 --- a/apps/mobile/app/pair/_layout.tsx +++ b/apps/mobile/app/pair/_layout.tsx @@ -10,6 +10,7 @@ export default function PairLayout() { + ); diff --git a/apps/mobile/app/pair/index.tsx b/apps/mobile/app/pair/index.tsx index 054d193874..4aa3dd3172 100644 --- a/apps/mobile/app/pair/index.tsx +++ b/apps/mobile/app/pair/index.tsx @@ -69,6 +69,15 @@ export default function PairChoiceScreen() { }) } /> + router.push('/pair/owner')} + /> (); + const [busy, setBusy] = useState(false); + const pending = useRef(undefined); + + useFocusEffect(useCallback(() => () => pending.current?.abort(), [])); + + const ready = address.trim() !== '' && username.trim() !== '' && password !== ''; + const submit = async () => { + if (pending.current || !ready) return; + const route = ownerSignInOrigin(address); + if (route === undefined) { + setError(t.teamSignIn.errors['insecure-transport'] ?? t.ownerSignIn.failed); + return; + } + const request = new AbortController(); + pending.current = request; + setBusy(true); + setError(undefined); + const computed = Constants.deviceName?.trim().slice(0, 60); + const deviceName = computed || (Platform.OS === 'ios' ? 'iPhone' : 'Android phone'); + const result = await hostSession.signInOwner({ + route, + username: username.trim(), + password, + deviceName, + signal: request.signal, + }); + pending.current = undefined; + setBusy(false); + setPassword(''); + if (request.signal.aborted) return; + if (result.ok) { + conversationFilter.set(computerEnvironmentKey(result.value.hostId)); + closeWorkspacePageWhenShown(); + router.dismissTo('/'); + return; + } + if (result.code === 'request-cancelled') return; + const errors: Partial> = { + ...t.teamSignIn.errors, + 'owner-sign-in-disabled': t.ownerSignIn.disabled, + 'already-paired': t.ownerSignIn.alreadyPaired, + 'storage-failed': t.ownerSignIn.storageFailed, + 'credentials-invalid': t.ownerSignIn.credentialsInvalid, + 'fingerprint-mismatch': t.ownerSignIn.fingerprintMismatch, + }; + setError( + (errors[result.code] ?? t.ownerSignIn.failed).replace( + '{seconds}', + String(result.retryAfterSeconds ?? 60), + ), + ); + }; + + return ( + + {t.ownerSignIn.hint} + + + void submit()} + /> + {error === undefined ? null : ( + + {error} + + )} +