Commit Graph

235 Commits

Author SHA1 Message Date
3a02c40b02 Move RATE_LIMIT_COOLDOWN_MS to constants file
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:16:14 -08:00
bbe68942e1 Exclude rate-limited platforms from job selection
When LinkedIn is rate-limited, its jobs were filling the maxApps quota
but then getting skipped, leaving 0 applied. Now excludes easy_apply
jobs from selection during cooldown so Wellfound jobs get picked up.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:15:29 -08:00
69eb6b124f Classify unknown_external jobs by following Apply redirects
After LinkedIn search completes, visits each unknown_external job page,
clicks the Apply button, captures the redirect URL, and matches against
known ATS patterns to identify the actual application platform.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:13:32 -08:00
cc0d15ece7 6-hour cooldown after LinkedIn Easy Apply daily limit
When rate limited, writes timestamp to data/linkedin_rate_limited_at.json.
Subsequent runs skip LinkedIn until 6 hours have passed. Other platforms
(Wellfound) continue unaffected. Cooldown file auto-deleted on expiry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:02:24 -08:00
dfe6810acc Add direct URL rate limit text to detection
LinkedIn shows different text on direct /apply/ URL vs button click:
- Button: "Easy Apply limit"
- Direct URL: "limit daily submissions" / "apply tomorrow"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 17:58:37 -08:00
374b2e6640 Rate limit only stops LinkedIn, continues other platforms
Don't break the entire run when LinkedIn rate limits — skip LinkedIn
jobs and continue to Wellfound and other platforms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 17:55:02 -08:00
331408be41 Detect LinkedIn Easy Apply daily limit and stop run
When LinkedIn shows "Easy Apply limit" message, detect it in the
modal-open check, return rate_limited status, put job back in queue,
send Telegram alert, and stop the entire run. Prevents burning retries
and wasting browser sessions when rate limited.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 17:54:45 -08:00
814492d9b6 Skip file upload when input only accepts images, not PDF/DOC
Some LinkedIn listings have image-only upload fields (JPG/PNG).
Don't attempt to upload a PDF resume to these inputs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 17:41:34 -08:00
6a1423eab6 Silence stdout when status sends via Telegram directly
Match applier behavior — sendTelegram() only, no stdout relay.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:54:41 -08:00
1a1af5934a Fix status: send via Telegram directly, short ack to stdout
Prevents OpenClaw from relaying full report as plain-text duplicate.
sendTelegram() handles formatted delivery, stdout just says "sent".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:51:30 -08:00
38dabbd6dd Fix address hallucination and duplicate status messages
- answerFor returning '' (intentionally blank) was treated as falsy,
  falling through to AI which fabricated "123 Main Street". Now
  empty string skips the field without triggering AI or reporting unknown.
- status.mjs was printing to stdout AND sending via Telegram, causing
  OpenClaw to relay a duplicate plain-text copy. Now only prints to
  stdout when Telegram isn't configured.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:47:18 -08:00
84a98e7839 Treat number fields as required even if DOM doesn't mark them
LinkedIn validates number fields even when not marked required in the
DOM. Previously these were skipped (no AI call, no answer). Now number
fields always trigger AI fallback and are reported as unknown if empty.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:43:39 -08:00
a629291722 Auto-clear stale batch markers in filter before submitting
When a batch completes but scores aren't written back (collection
error), jobs get stuck with filter_batch_id set and never re-submitted.
Now checks: if no filter_state.json exists (no batch in flight) but
jobs have batch markers without scores, clear them so they get
re-submitted on the next run.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:41:08 -08:00
8cdafcae4a Send status report directly via Telegram for proper markdown rendering
Previously status.mjs relied on OpenClaw relaying stdout, which sent
as plain text. Now sends via sendTelegram() directly when Telegram
config is present, matching how all other scripts send notifications.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:38:33 -08:00
aefd1f2023 Fix label dedup for space-separated duplicates
LinkedIn renders label text twice in nested spans, producing
"Question? Question?" instead of "Question?". The old dedup only
caught exact concatenation (ABCABC); now also handles space-separated
duplicates by comparing left/right halves at the midpoint space.

Applied to all 4 copies: extractLabel, _extractLabel, normalizeLegend,
_normalizeLegend.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:28:51 -08:00
05739a455b Fix AI hallucinating street addresses and other facts
- Add street/address pattern to answerFor() — returns profile address or empty string
- Update AI prompt: return "UNKNOWN" instead of guessing facts
- Handle UNKNOWN response by treating it as no answer (triggers Telegram ask)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:25:32 -08:00
fd30646d8a Fix number field validation: strip text from numeric answers
Number inputs (type="number") were getting answers like "5 years"
instead of "5", causing LinkedIn validation errors. Now:
- AI gets "(must be a number, no text or units)" hint
- Answers are stripped to digits before filling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:21:37 -08:00
9a0d13c920 Bump to 0.1.5
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:10:00 -08:00
6e0f212515 Add GitHub link to top of SKILL.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:09:40 -08:00
f248e8573f Auto-create claw-apply proxy if it doesn't exist
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:06:47 -08:00
df9c790a0e Look up proxy by name 'claw-apply' instead of stored ID
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:06:14 -08:00
80d2323a37 Dynamic profile lookup from auth connection
Profile name is returned by ensureAuth() from the auth connection
(looked up by domain). No more storing profile names in settings.json
for the applier flow. createBrowser() still supports legacy platform
keys as fallback for searcher/setup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:02:19 -08:00
0e18bbf481 Update docs: domain-based auth lookup, no connection IDs needed
Connection IDs are no longer stored in settings.json. The applier
finds auth connections by domain (linkedin.com, wellfound.com) at
runtime via the Kernel SDK. Updated SKILL.md, README.md, and bumped
to 0.1.4.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 15:57:55 -08:00
668a40a51a Look up auth connections by domain instead of stored ID
Connection IDs change when re-authing. Instead of storing IDs in
settings.json (which go stale), look up connections by domain at
runtime via kernel.auth.connections.list({ domain }). This keeps
the applier in sync regardless of connection recreation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 15:55:26 -08:00
561e666323 Document LinkedIn rate limit and 1-job-per-run pacing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 15:49:35 -08:00
59e410b9c4 Add auth health check before browser creation
- Rewrite session.mjs: check connection status via SDK before creating
  browser. If NEEDS_AUTH + can_reauth, auto re-auth with stored creds.
  If can't re-auth, send Telegram alert and skip platform.
- Wire ensureAuth() into job_applier.mjs before createBrowser()
- Jobs are returned to queue (not failed) when auth is down

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 15:45:24 -08:00
a133202e1b Bump to 0.1.3
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 15:27:17 -08:00
82db9658c2 Add security note to SKILL.md addressing prompt-injection false positive
The ClawHub scanner flags systemPrompt variables in lib/*.mjs as
potential prompt injection. These are legitimate Claude API prompts
for job scoring, answer generation, and keyword generation. Added
explicit note clarifying their purpose.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 15:26:47 -08:00
c767c7e30e Bump version to 0.1.2 for ClawHub republish
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 15:25:03 -08:00
7083e1bc77 Fix ClawHub scan findings: declare env vars, remove git-pull cron
- claw.json: declare KERNEL_API_KEY (required) and ANTHROPIC_API_KEY
  (optional) so registry metadata matches actual requirements
- claw.json: add telegram credentials declaration
- SKILL.md: remove frontmatter block (triggered prompt-injection scanner)
- SKILL.md: remove Git Pull cron row (ops detail, not part of skill)
- Bump version to 0.1.1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 15:22:23 -08:00
6d69443f51 Pass placeholder format hints to AI for inputs and textareas
Captures placeholder from textareas in snapshot. When AI fallback is
used, includes placeholder as a format hint so the AI knows expected
format (dates, phone numbers, URLs, etc).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 15:12:35 -08:00
7bd91a19a0 Fix maxRetries not defined crash in handleResult
The stuck/incomplete retry logic referenced maxRetries which was only
defined in main() scope, not in handleResult(). Compute it locally.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 15:11:32 -08:00
3bf1786895 Detect date format from placeholder (MM/DD/YYYY) instead of label matching
Reads input placeholder in snapshot. If it contains MM/DD/YYYY pattern,
auto-fills with today's date in the correct format. Generic — works
regardless of the field label.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 15:05:41 -08:00
7d81d59cb5 Broaden date field detection — match any label containing 'date'
Catches 'Date of Application', 'Available Start Date', and other
date fields that expect mm/dd/yyyy format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 15:04:10 -08:00
fdb0224226 Fix date inputs and dismiss date picker/sub-form popups
- Start date fields now return mm/dd/yyyy format instead of "Immediately"
- Cancel any open sub-forms or date pickers before filling (handles
  stacked popups with double-cancel check)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 15:02:35 -08:00
029360b118 Dismiss LinkedIn education/experience sub-forms before filling
LinkedIn sometimes opens an Add Education/Experience sub-form with
Save/Cancel buttons that blocks the main Next button. Detect and
cancel these before attempting to fill the step.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:54:40 -08:00
ad281d1a9f Retry stuck/incomplete jobs instead of marking permanently failed
Stuck and incomplete jobs now get retried up to max_retries (default 2)
before being permanently marked. Honeypots are still permanent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:51:20 -08:00
d0a40e4654 Batch CDP calls: single-evaluate debug info, data-claw-idx tagging, field count logging
- getModalDebugInfo: one evaluate() for heading, buttons, errors (was N+2 calls)
- selectOptionFuzzy: batch-read option texts in one evaluate (was N calls)
- Tag elements with data-claw-idx during snapshot, query by attribute in fill()
  (fixes fragile positional index matching for checkboxes/inputs)
- Log field counts per fill step for debugging

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:50:47 -08:00
a956b98941 Stop auto-checking 'top choice' and 'interested' checkboxes
Only auto-check confirm/agree/consent checkboxes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:46:03 -08:00
23eb5284fa Fix snapshot evaluate: scope queries to container element, handle Page fallback
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:42:41 -08:00
aeb41b42c2 Optimize form_filler: batch DOM reads into single evaluate() call
Instead of 60+ sequential CDP round-trips per step (isVisible, getLabel,
inputValue, isRequired for each element), snapshot all form state in one
evaluate() call, do answer matching locally, then only make CDP calls to
fill/click elements that need action.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:39:18 -08:00
d2de496d27 Track apply_started_at per job and log duration on success
Adds timing data to queue entries and shows seconds in the apply log.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:30:11 -08:00
dc7113907b Fix Anthropic API 404 — correct model ID to claude-sonnet-4-6
The dated model ID claude-sonnet-4-6-20251101 doesn't exist, causing
keyword generation to fall back to static keywords.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:24:38 -08:00
6d325cf931 Add timestamps to searcher start/finish logs for run tracking
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:22:48 -08:00
d5e595475c fix: 6h cooldown guard on searcher — prevents accidental re-runs 2026-03-06 22:18:25 +00:00
c4e5dbc32a Fix Telegram code block rendering — remove leading spaces from messages
Telegram Markdown treats lines starting with spaces as preformatted code
blocks. Replaced leading spaces with bullet points and arrows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:14:47 -08:00
ba4bc9ac03 Fix status Telegram: keep markdown in console output for agent relay
When --telegram, send directly and don't print. Otherwise keep * in
console output so agents capturing stdout can relay with formatting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:13:01 -08:00
199175f5f6 Add --telegram flag to status report, fix missing duplicate/closed counts
status.mjs --telegram sends the report to Telegram with proper bold formatting.
Console output strips markdown. Queue total now accounts for duplicates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:09:19 -08:00
cd454f8cc2 Clean up status report and apply summary
Status: only show non-zero queue counts, compact breakdown line,
remove emoji clutter
Apply summary: remove misleading green check on header, show applied/total

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:05:45 -08:00
b0a2eb3746 Fix fieldset radios: validate answers against options, fix checkbox skip, fix authorization match
Tested against Webflow (4311307116) and Scout Global (4378934058):
- Webflow: reaches Review page with all radios checked and checkbox group selected
- Scout Global: already applied successfully with select fix

Three fixes:
1. Fieldset radio answers validated against available options - prevents
   experience pattern returning "7" when options are Yes/No
2. Checkbox groups no longer skipped when one checkbox already checked -
   was preventing multi-select from working on retry
3. "authoriz" pattern matches both "authorized" and "authorization"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:05:02 -08:00