From 3f5e3bb19d5c2f17b9389b5958eb5fd39277a3fc Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Mon, 9 Nov 2026 17:41:10 -0500 Subject: [PATCH] fix(agent): install helpers off the main thread and offer sign-in only after the install --- .gitattributes | 1 + app/src/main/java/com/droiddeck/launcher/agent/AgentSetup.kt | 2 +- app/src/main/java/com/droiddeck/launcher/ui/AgentSetupView.kt | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index 940dbb5f1..b2b4dff68 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10,3 +10,4 @@ tools/mangoapp/mangoapp text eol=lf app/src/main/assets/desktop-removal/*.json text eol=lf app/src/main/assets/desktop-removal/*.txt text eol=lf *.pdf binary +app/src/main/assets/agent/* text eol=lf diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentSetup.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentSetup.kt index 8f8484fa3..01d6b9a73 100644 --- a/app/src/main/java/com/droiddeck/launcher/agent/AgentSetup.kt +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentSetup.kt @@ -63,7 +63,6 @@ object AgentSetup { val command = when (step) { Step.CONNECTION -> return Step.INSTALL -> { - installHelpers(app) listOf("sh", "-c", "set -e; export DEBIAN_FRONTEND=noninteractive; " + "apt-get install -y --no-install-recommends git gh adb curl ca-certificates python3; ${harness.install}") } @@ -76,6 +75,7 @@ object AgentSetup { detail.remove(step) Thread({ val result = runCatching { + if (step == Step.INSTALL) installHelpers(app) val child = AgentHost.guest(app, command).start() child.outputStream.close() child.inputStream.bufferedReader().forEachLine { line -> diff --git a/app/src/main/java/com/droiddeck/launcher/ui/AgentSetupView.kt b/app/src/main/java/com/droiddeck/launcher/ui/AgentSetupView.kt index cc34183bb..99f503f27 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/AgentSetupView.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/AgentSetupView.kt @@ -61,7 +61,8 @@ internal fun AgentSetupView(modifier: Modifier, onDone: () -> Unit = {}) { }, title, detail, divider = index < steps.lastIndex, ) { - if (status == Status.TODO || status == Status.FAILED) { + val blocked = step == Step.SIGN_IN && AgentSetup.status[Step.INSTALL] != Status.DONE + if ((status == Status.TODO || status == Status.FAILED) && !blocked) { val label = stringResource(if (status == Status.FAILED) R.string.agent_setup_retry else action(step)) val run = { if (step == Step.CONNECTION) pair(context) else AgentSetup.run(context, step) } if (step.required) PrimaryButton(label, compact = true, onClick = run) else SecondaryButton(label, compact = true, onClick = run)