Skip to content

openrouter scraper: SelectorTimeout at signup_flow — DOM drift #83

@hanwencheng

Description

@hanwencheng

Symptom

agentkeys --session-id alice provision openrouter against live broker.litentry.org consistently fails at the openrouter signup step with a SelectorTimeout tripwire.

{"level":"info","event":"provision_metric","name":"trip_wire_fired","service":"openrouter","kind":"SelectorTimeout","step":"signup_flow"}
Problem: A script step timed out at 'signup_flow'.
Cause: The target site's DOM may have changed (tripwire: SelectorTimeout).

Scope (what's broken vs what works)

  • ✅ Auto-provision pipeline works end-to-end: agentkeys provision loads the saved session JWT, calls /v1/mint-oidc-jwt, exchanges via AssumeRoleWithWebIdentity, injects AWS temp creds into the scraper subprocess. The fact that trip_wire_fired fires AT ALL is proof of life that the pipeline ran.
  • ❌ openrouter's signup-page DOM has drifted since the scraper's selectors were last verified.

Affected file

provisioner-scripts/src/scrapers/openrouter.ts — the signupEmailOtp pattern's selectors no longer match openrouter's current signup flow.

Current hardcoded selectors at the top of the file:

  • EMAIL_SELECTOR = 'input[name="email"]'
  • SUBMIT_BUTTON_SELECTOR = 'button[type="submit"]'
  • OTP_SELECTOR = 'input[name="otp"]'
  • VERIFY_BUTTON_SELECTOR = 'button[type="submit"]'

Proposed systemic fix

See comment #issuecomment-4455841217 for the 4-layer scalable selector-healing plan covering ALL provisioner scrapers (forensics → fallback chains → nightly canary → LLM auto-heal). Supersedes the per-incident "Fix path" below.

Fix path (per-incident, pre-systemic-fix)

Run the workflow recorder against the current openrouter signup page:

# Dev-time
# See SKILL: agentkeys-workflow-collection / agentkeys-record-scraper

…then update the selectors (or migrate to the *-cdp.ts variant if openrouter has anti-bot defenses that block Playwright's default Chromium).

Demo-doc note

docs/stage7-demo-and-verification.md §5.3 now explicitly states that a trip_wire_fired log line proves the auto-provision pipeline succeeded — scraper maintenance is out of scope for that demo. So this issue doesn't gate the §5.3 demo claim; it's a follow-up to keep openrouter usable as an example service.

Repro

bash scripts/agentkeys-init-email-demo.sh --session-id alice
set -a; source scripts/operator-workstation.env; set +a
export AGENTKEYS_BROKER_URL=https://broker.litentry.org
export AGENTKEYS_DATA_ROLE_ARN=arn:aws:iam::${ACCOUNT_ID}:role/agentkeys-data-role
export AWS_REGION=us-east-1
export AGENTKEYS_SIGNER_URL=$BACKEND_URL
export AGENTKEYS_SESSION_ID=alice
(cd provisioner-scripts && npm install && npx playwright install chromium)
agentkeys --session-id alice provision openrouter

Last verified failing: 2026-05-14.

Metadata

Metadata

Assignees

No one assigned

    Labels

    provision-fixProvisioner scraper DOM drift / selector maintenance

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions