feat: session-first mobile UX with agent-first pre-SSH onboarding (PR #6)#6
Open
claudinethelobster wants to merge 7 commits intomainfrom
Open
feat: session-first mobile UX with agent-first pre-SSH onboarding (PR #6)#6claudinethelobster wants to merge 7 commits intomainfrom
claudinethelobster wants to merge 7 commits intomainfrom
Conversation
- ADR-002: codifies two key improvements over PR #5: 1) Agent available before SSH is connected (onboarding mode) 2) Connectivity probe before showing install command - Onboarding state machine with probe result branching (connectable/dns_fail/port_fail/ssh_fail → different guidance) - Planning doc 08: conversation transcripts for ideal and blocked paths - Comparison table: why cleaner than PR #5 approach
…ity probe
- PostgreSQL integration (db.ts, schema.sql)
- crypto.ts: HKDF-SHA256 KEK, AES-256-GCM key encryption, token hashing
- GitHub OAuth 2.0 with PKCE + auto-keypair provisioning on first login
- REST API:
- /api/v1/auth/* — OAuth flow, session, account info
- /api/v1/keys/* — Ed25519 keypair management + install command
- /api/v1/connections/* — SSH connection CRUD + test
- NEW: POST /api/v1/connections/probe — connectivity pre-check before install
(DNS resolve → TCP probe → SSH banner check)
- /api/v1/sessions/* — session lifecycle
- /api/v1/sessions/bootstrap + confirm — chat-led onboarding flow
- Rate limiting, audit logging, proper error responses
- TypeScript strict mode: 0 compile errors
- Agent available in onboarding mode (before SSH connected): buildOnboardingContext() used when no active session exists - Per-turn SystemInstruction injection prevents context loss after N turns - DB fallback session rehydration when in-memory store is stale (after process restart or memory eviction) - Assistant output sanitization guards (strips ControlPath, SSH flags, SystemInstruction fragments before messages reach user)
- Fix probe flow: properly handle all state transitions - Improve blocked state: parse 'retry', 'port NNNN', IP addresses - Polish typing indicator and message rendering - Fix WebSocket reconnect logic for active sessions - Clean up dead code from initial implementation
…start loop The startAccount function was returning immediately, causing OpenClaw to treat the channel as completed and continuously auto-restart it. Now the function awaits the abortSignal before cleaning up, matching the expected long-running channel service lifecycle.
…iolation GitHub users without a public display name have ghUser.name = null. Fall back to ghUser.login to ensure display_name is always populated (backward compatible with existing NOT NULL constraint on accounts table).
Documents the column additions and table migrations needed when upgrading from feat/mobile-auth-overhaul to this branch's schema: - accounts: add github_id (with UNIQUE), login, avatar_url, updated_at - accounts.display_name: make nullable - auth_sessions: create from app_sessions (new table name + extra fields) - oauth_state_cache: ensure code_verifier column present - audit_logs: create new table Safe to run on existing PR#5 databases.
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 Changed
Session-First, Agent-First UX (PR #6 clean-room redo)
This PR delivers the session-first mobile UX with two key improvements over PR #5:
1. Agent available before SSH is connected
The chat agent greets users by name immediately on page load — before any server is connected. Users can ask questions, get help, and start onboarding through natural conversation from the very first second.
2. Connectivity probe BEFORE showing install command
Before showing the
authorized_keysinstall command, the backend probes the target host:If the host is blocked/unreachable, the agent explains WHY and provides specific guidance — before the user wastes time running an install command that won't work.
Architecture (ADR-002)
Onboarding state machine:
New API Endpoints
POST /api/v1/connections/probe— NEW — connectivity pre-check (DNS + TCP + SSH banner)GET /api/v1/auth/oauth/github/start— GitHub OAuth with PKCEGET /api/v1/auth/oauth/github/callback— auto-provision keypair on first loginGET/POST/PATCH/DELETE /api/v1/keys/*— Ed25519 keypair managementGET/POST/PATCH/DELETE /api/v1/connections/*— SSH connection CRUD + testPOST /api/v1/sessions/bootstrap— chat-led onboarding (returns install command)POST /api/v1/sessions/bootstrap/:id/confirm— test SSH + start sessionWhy Cleaner Than PR #5
Testing Evidence
All endpoints tested on clawdfather.ai (deployed to prod branch):
Known Limitations / Follow-Ups
Deploy Status
Live at: https://clawdfather.ai
Branch commit: $(git rev-parse HEAD)