Skip to content

v1.8.0: AI Providers, SSH Access, Ctrl keys, Configure menu, resolv.conf fix (#36-#40)#42

Merged
mithun50 merged 14 commits intomainfrom
fix/issue-40-resolv-conf-enoent
Mar 1, 2026
Merged

v1.8.0: AI Providers, SSH Access, Ctrl keys, Configure menu, resolv.conf fix (#36-#40)#42
mithun50 merged 14 commits intomainfrom
fix/issue-40-resolv-conf-enoent

Conversation

@mithun50
Copy link
Copy Markdown
Owner

@mithun50 mithun50 commented Mar 1, 2026

Summary

Combined PR covering issues #36#40:

Ctrl key & Configure menu (#37, #38)

  • Fix Ctrl key for arrow keys and special key combinations
  • Add Configure menu screen with PTY terminal
  • Clickable URL detection in terminal
  • Add OpenSSH as optional package

AI Providers & SSH Access (new feature)

  • Add GUI to select AI providers (Anthropic, OpenAI, Google Gemini, OpenRouter, NVIDIA NIM, DeepSeek, xAI) and configure API keys/models
  • Provider config written to ~/.openclaw/openclaw.json via Node.js safe-merge
  • Add SSH remote access management — start/stop sshd, set root password, show connection info
  • Add "AI Providers" and "SSH Access" cards to dashboard

Fix resolv.conf ENOENT after upgrade (#40)

  • After app upgrade, Android may clear the files directory
  • writeResolvConf() now calls setupDirectories() to recreate the entire directory tree
  • Uses two-argument File(parent, child) constructor for correctness

New Files

  • lib/models/ai_provider.dart — Provider data model with 7 built-in providers
  • lib/services/provider_config_service.dart — Read/write provider config
  • lib/screens/providers_screen.dart — Provider list with Active/Configured badges
  • lib/screens/provider_detail_screen.dart — API key + model selection form
  • lib/services/ssh_service.dart — SSH server lifecycle operations
  • lib/screens/ssh_screen.dart — SSH management UI

Test plan

  • Ctrl+C / Ctrl+Arrow keys work in terminal
  • Configure menu opens and runs openclaw configure
  • Tap "AI Providers" → select provider → enter API key → save → verify config
  • SSH Access: install OpenSSH → set password → start server → verify connection info
  • Fresh install / clear data → gateway starts without ENOENT
  • Upgrade scenario: resolv.conf created and DNS works

Fixes #37, #38, #40

mithun50 added 3 commits March 1, 2026 14:31
…RL, SSH package (#37, #38)

- Fix Ctrl+Arrow/Home/End/PgUp/PgDn sending raw sequences instead of
  xterm Ctrl-modified variants (e.g. \x1b[1;5A for Ctrl+Up)
- Make gateway dashboard URL clickable (opens WebDashboardScreen) with
  primary color + underline styling and open_in_new icon button
- Add "Configure" quick action card running `openclaw configure` in terminal
- Add OpenSSH as optional package (apt-get install openssh-client openssh-server)

Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>
- Add AiProvider data model with 7 built-in providers (Anthropic, OpenAI,
  Google Gemini, OpenRouter, NVIDIA NIM, DeepSeek, xAI)
- Add ProviderConfigService to read/write provider config in openclaw.json
  using Node.js safe-merge pattern
- Add ProvidersScreen listing all providers with Active/Configured badges
- Add ProviderDetailScreen with API key form and model dropdown
- Add SshService for sshd lifecycle (start/stop, password, IP discovery)
- Add SshScreen with service control, password management, and connection
  info with copyable ssh commands
- Add AI Providers and SSH Access cards to dashboard

Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>
After upgrading to v1.7.3, Android may clear the app's files directory.
writeResolvConf() only created the config/ directory but other required
directories (tmp/, home/, lib/, proc/sys fakes) were missing, causing
proot bind-mount failures.

Call setupDirectories() instead of a bare mkdirs() so the entire
directory tree is recreated before writing resolv.conf. Also use the
two-argument File constructor for correctness.

Fixes #40

Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>
@mithun50 mithun50 changed the title Fix resolv.conf ENOENT after app upgrade v1.8.0: AI Providers, SSH Access, Ctrl keys, Configure menu, resolv.conf fix (#36-#40) Mar 1, 2026
mithun50 added 11 commits March 1, 2026 15:40
On a normal app launch (setup already complete), setupDirs was never
called. If Android cleared the files directory after an upgrade, the
config/ directory was missing when writeResolv ran.

Now both init() and start() call setupDirs() first, matching the
bootstrap flow. The Kotlin-side writeResolvConf() also calls
setupDirectories() internally as a safety net.

Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>
#40)

setupDirectories() also runs setupLibtalloc() and setupFakeSysdata()
which can fail during first-time setup when rootfs hasn't been
extracted yet. writeResolvConf() only needs the config/ directory
to exist.

The Dart-side gateway_service.dart still calls setupDirs() before
writeResolv() for the upgrade/restart case where directories may
have been cleared by Android.

Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>
After an app update, Android may clear all files. The background
GatewayService only called writeResolvConf() which creates config/
dir, but proot also needs tmp/, home/, lib/libtalloc.so.2, and
proc/sys fakes for bind mounts.

Now setupDirectories() runs before writeResolvConf() in the Android
service, matching the Dart-side fix in gateway_service.dart.

All paths now covered:
- First-time setup: bootstrap calls setupDirs then writeResolv
- App open (Dart): init/start call setupDirs then writeResolv
- Background service (Kotlin): setupDirectories then writeResolvConf
- writeResolvConf itself: mkdirs config dir as safety net

Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>
The previous implementation used single-shot runInProot() which can't
run daemons — proot uses --kill-on-exit so sshd dies when the command
finishes. Also pgrep/hostname -I don't work reliably inside proot.

Changes:
- Add SshForegroundService.kt: runs sshd -D (foreground mode) in a
  persistent proot process with wake lock and notification
- Add native bridge methods: startSshd, stopSshd, isSshdRunning,
  getSshdPort, getDeviceIps, setRootPassword
- getDeviceIps uses Android NetworkInterface (not proot hostname -I)
- setRootPassword runs chpasswd via processManager.runInProotSync
- Register SshForegroundService in AndroidManifest.xml
- Rewrite ssh_service.dart to use native methods
- Update ssh_screen.dart to fetch IPs from Android

Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>
CTRL/ALT toolbar buttons only worked with other toolbar buttons (arrows,
etc.), not with soft keyboard input. Keyboard chars went directly through
terminal.onOutput → pty.write(), bypassing the toolbar's modifier state.

Fix: Share CTRL/ALT state via ValueNotifier between toolbar and screen.
The onOutput handler now checks if modifiers are active and transforms
keyboard input (e.g., Ctrl+C sends byte 0x03). Both terminal_screen.dart
and configure_screen.dart are fixed.

Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>
… imports

Add ctrlNotifier/altNotifier to TerminalToolbar usage in
onboarding_screen.dart and package_install_screen.dart (build errors).
Remove unnecessary dart:typed_data imports (already provided by
package:flutter/services.dart).

Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>
)

- writeResolvConf() now uses context.filesDir (Android-guaranteed path)
  instead of the String configDir which could point to a cleared directory
- gateway_service init() wraps writeResolv() in try-catch since it's
  non-critical when gateway is already running

Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>
Previously these only ran when the gateway was already running.
After an app update, the gateway is not running but Android may have
cleared the files directory. Moving setupDirs/writeResolv before the
isGatewayRunning check ensures resolv.conf always exists before any
terminal or gateway operation.

Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>
getProotShellConfig() is called by all screens before starting proot
(terminal, configure, onboarding, package install). Adding setupDirs
and writeResolv here guarantees resolv.conf exists regardless of which
screen the user opens first after an app update.

Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>
The splash screen is the first screen on every app open — reinstall,
update, or normal launch. Running setupDirs + writeResolv here
guarantees the files exist before any screen can use proot.

Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>
…onf fix

- Bump version to 1.8.0 (pubspec.yaml, constants.dart)
- Update CHANGELOG with all new features and bug fixes
- Update README with new features, file structure, and OpenSSH package

Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>
@mithun50 mithun50 merged commit aaa8d0b into main Mar 1, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

how to use ssh access

1 participant