Skip to content

fix(onboarding): verify bootstrap message rendered before consuming one-shot gate - #307

Merged
steipete merged 2 commits into
openclaw:masterfrom
indierawk2k2:fix/bootstrap-injector-verify-rendered
May 11, 2026
Merged

fix(onboarding): verify bootstrap message rendered before consuming one-shot gate#307
steipete merged 2 commits into
openclaw:masterfrom
indierawk2k2:fix/bootstrap-injector-verify-rendered

Conversation

@indierawk2k2

Copy link
Copy Markdown
Contributor

Summary

Follow-up to Scott's PR #274 onboarding/chat work. The hatching/bootstrap prompt path was running, but BootstrapMessageInjector could consume HasInjectedFirstRunBootstrap after JavaScript merely returned "sent" without confirming the message actually rendered or the composer accepted it.

This PR hardens the injector so false-positive sends stay retryable instead of permanently suppressing the first-run hatching prompt.

Changes

  • Narrow send-button discovery to the located chat composer's form/container instead of accepting broad page buttons.
  • Prefer the input-associated form, then clearly-labeled send controls, then Enter fallback.
  • Poll after submit for confirmation that the input cleared or the message text appears in visible transcript text.
  • Return distinct retryable statuses such as sent-unverified, no-input, and no-send-button.
  • Only call MarkInjected() for confirmed sent.
  • Add tests proving sent-unverified does not flip HasInjectedFirstRunBootstrap, while verified sent still does.

Validation

  • ./build.ps1 — PASS (Cli, Shared, WinNodeCli, WinUI)
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore with OPENCLAW_REPO_ROOT set — PASS: 1465 total, 1443 succeeded, 22 skipped
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore --no-build with OPENCLAW_REPO_ROOT set — PASS: 911 total, 911 succeeded, 0 skipped
  • dotnet vstest ./tests/OpenClaw.Tray.Tests/bin/Debug/net10.0/OpenClaw.Tray.Tests.dll — PASS: 911 total, 911 passed
  • Fresh-binary smoke after build — PASS: launched OpenClaw.Tray.WinUI.exe from this worktree with isolated OPENCLAW_TRAY_DATA_DIR; process stayed alive for 15 seconds

Note: a full dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore build+test invocation hung in this local shell during project build output; the already-built test DLL passed via dotnet test --no-build and dotnet vstest.

Mike retest unstick command

Mike's current box already has HasInjectedFirstRunBootstrap=true, so after installing this build and before retesting first-run hatching, run:

$p="$env:APPDATA\OpenClawTray\settings.json"
$j=Get-Content $p -Raw|ConvertFrom-Json
$j.HasInjectedFirstRunBootstrap=$false
$j|ConvertTo-Json -Depth 10|Set-Content $p

This is not a reset of credentials; it only reopens the one-shot bootstrap prompt gate.

Mike Harsh and others added 2 commits May 10, 2026 21:55
Only persist the first-run bootstrap gate when the injected chat message is confirmed as accepted by the chat UI. Treat unverified sends as retryable so a false-positive send signal does not permanently suppress the hatching prompt.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@steipete
steipete merged commit 7f49beb into openclaw:master May 11, 2026
8 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.

2 participants