Skip to content

Commit 1dc38ab

Browse files
author
OpenClaw
committed
onboarding: run discovery sync in background
1 parent 81216cb commit 1dc38ab

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/cyberagent/cli/onboarding.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,10 @@ def handle_onboarding(
211211
elif force_background:
212212
background_discovery = True
213213
else:
214-
background_discovery = not sys.stdin.isatty() or not sys.stdout.isatty()
214+
# Default to background discovery so onboarding can start immediately.
215+
# Foreground discovery can take minutes (e.g. PKM repo sync / docker pulls)
216+
# and shouldn't block the user from answering the first question.
217+
background_discovery = True
215218

216219
summary_path: Path | None = None
217220
if background_discovery:

src/cyberagent/cli/onboarding_discovery.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,17 @@ def start_discovery_background(args: object, team_id: int) -> None:
5959
if os.environ.get("CYBERAGENT_DISABLE_BACKGROUND_DISCOVERY"):
6060
logger.info("Background discovery disabled via env override.")
6161
return
62+
63+
# Background discovery should not block the onboarding interview, but we still
64+
# want it to enqueue the onboarding discovery prompt once the sync completes
65+
# so the agent can incorporate PKM/profile context as soon as it's available.
6266
thread = threading.Thread(
6367
target=_run_discovery_pipeline,
6468
kwargs={
6569
"args": args,
6670
"team_id": team_id,
6771
"allow_prompt": False,
68-
"enqueue_prompt": False,
72+
"enqueue_prompt": True,
6973
},
7074
daemon=True,
7175
)

0 commit comments

Comments
 (0)