Skip to content

fix(browser-handoff): log the previously-silent automatic-recheck scheduling failures - #229

Merged
convyusboy merged 3 commits into
boonfrom
ridho/browser-handoff-log-silent-recheck-failure
Sep 21, 2026
Merged

convyusboy merged 3 commits into
boonfrom
ridho/browser-handoff-log-silent-recheck-failure

Conversation

@convyusboy

@convyusboy convyusboy commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Live-diagnosed against a real production gateway (arief-openclaw-test, via its own log files, not a guess): a fresh browser_handoff request_login request had its automatic recheck job silently fail to schedule at all. The customer sat in pending for 8 minutes with zero cron activity, zero warnings, zero errors anywhere in the gateway logs — until a manual chat message from the customer triggered a real turn, which then scheduled and ran successfully. Confirmed via the log's own job-id: "cron: job added" for this exact browser-handoff job appears exactly once all day, timestamped to the manual nudge, not the original request.

Root cause: scheduleRecheck in extensions/browser-handoff/src/tool.ts has two early-return failure paths, and both were 100% silent:

const sessionKey = context.runSessionKey ?? context.sessionKey;
if (!sessionKey) {
  return false;   // no log at all
}
...
if (!cleared) {
  return false;   // no log at all
}

Because of this, a broken automatic-resume chain is indistinguishable from "working as intended, hasn't fired yet" — the only way to tell them apart was diffing gateway cron logs against boon-core's own poll history by hand, which is what this investigation had to do.

Why This Change Was Made

Both silent paths now log a warning via createSubsystemLogger("browser-handoff"), naming the site and which specific gate failed (missing session key, or failed to confirm the previous schedule was cleared). This doesn't fix the underlying scheduling gap itself — the root cause of why the very first scheduleRecheck call after request_login didn't succeed is still not conclusively identified — but it turns a silent, hours-long diagnosis into an immediately greppable log line the next time it happens.

User Impact

No behavior change for a working handoff. When automatic resume silently fails to schedule (as it did here), it's now visible in gateway logs instead of requiring manual correlation against boon-core's poll history.

Evidence

  • Live production log evidence (see above) that reproduced and diagnosed the exact silent-failure window.
  • node scripts/run-vitest.mjs extensions/browser-handoff/src/tool.test.ts — 27 examples, 0 failures (2 new assertions added covering both previously-silent branches).
  • pnpm tsgo:extensions — clean, no errors.

🤖 Generated with Claude Code


Summary by cubic

Logs warnings when browser-handoff recheck scheduling fails silently, so a broken automatic-resume chain is no longer indistinguishable from one that just hasn't fired yet. The three early-return paths in scheduleRecheck — missing session key, failure to confirm the prior schedule cleared, and scheduleSessionTurn returning no job — previously logged nothing; all now warn with the site and the specific gate that failed. Working handoffs are unaffected. Tests assert the exact warning text for each gate.

Written for commit 2565d4d. Summary will update on new commits.

Review in cubic

…eduling failures

Live-diagnosed (production gateway logs, arief-openclaw-test): the automatic
recheck job for a fresh browser_handoff request_login was not scheduled at
all until the customer was manually nudged 8 minutes later -- zero cron
activity, zero warnings, zero errors in between. scheduleRecheck's two
early-return failure paths (missing sessionKey/runSessionKey, and
clearScheduledRecheck failing after all retries) were both 100% silent,
making a broken automatic-resume chain indistinguishable from 'working as
intended, just hasn't fired yet' without diffing cron logs against
boon-core poll history by hand.

Both paths now log via createSubsystemLogger so the next occurrence is
immediately diagnosable instead of requiring the same manual log
archaeology.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@convyusboy
convyusboy requested a review from a team September 17, 2026 10:01
@claude

claude Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread extensions/browser-handoff/src/tool.ts Resolved
convyusboy and others added 2 commits September 21, 2026 12:38
…ual gate reasons

Strips the ENG-17466 reference and incident narrative from the inline
comment per AGENTS.md's no-ticket-refs rule, keeping just the concise why.
Tests now assert the specific warning text for each gate (missing session
key vs. failed-to-clear-prior-schedule) instead of just checking for the
site name, so a regression can't silently swap the two reasons.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
The host scheduler logs its own generic failure reason for this case, but
not this handoff's site — reopening the same silent-diagnosis gap one
layer down. Third and last silent return path in scheduleRecheck.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

@augusteo augusteo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed at the current head. The previously identified falsy scheduleSessionTurn result is now logged with site context and covered by a regression assertion. Targeted tests, extension type-check, formatting, Oxlint, and exact-head CI all pass.

@convyusboy
convyusboy merged commit 47a157b into boon Sep 21, 2026
138 checks passed
@convyusboy
convyusboy deleted the ridho/browser-handoff-log-silent-recheck-failure branch September 21, 2026 07:11
convyusboy added a commit that referenced this pull request Sep 22, 2026
…bump conflict)

Merges 3 commits from origin/boon (#233, #212, #229) into the 6.34
integration branch. Only pnpm-lock.yaml conflicted; package.json,
ui/package.json, and pnpm-workspace.yaml auto-merged clean and already
reflect boon's vitest 4.1.10 -> 4.1.11 bump. Resolved each lockfile
conflict hunk to boon's side (the newer vitest/@vitest/* version
strings and one transitive es-module-lexer bump); `pnpm install`
afterward made no further changes, confirming the resolution is
consistent.

Verified: tsgo:core clean; targeted vitest runs across the merged
surfaces (src/plugins/registry-lifecycle, plugin-registry, runtime,
host-hook-cleanup*, host-hook-scheduled-turns-diagnostics,
scheduled-turns.contract, extensions/browser-handoff/tool) all green.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
insomnius added a commit that referenced this pull request Sep 22, 2026
…238)

Root version, 135 plugin manifests synced via scripts/sync-plugin-versions.ts, changed npm-shrinkwrap.json files regenerated, CHANGELOG section for boon.46.

Shipping: #237 (diagnostics-otel owns its tracer and meter providers instead of the global ones, so it stops handing spans to a co-running SDK), #235 (model.usage stays inside the turn trace), #233 (a plugin's scheduled turn is no longer rolled back by an unrelated registry becoming active), #229 (browser-handoff recheck scheduling failure is logged), #212 (dev-only vitest bump in ui).

Base = 2026.6.11-boon.45. Gateway plus @openclaw/slack, @openclaw/msteams and @openclaw/diagnostics-prometheus bumped in lockstep; no separately published plugin source changed in this train, so a gateway roll delivers all of it.
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