Repository navigation
feat: type the code a job site emails into Windrush, and it sends the form - #70
Merged
Merged
Conversation
… form
Greenhouse asked Catapult's send for an emailed code "to confirm you're a human",
and the run could only give up. Now a live run holds the filled form open for
the user's code: the run shows "Needs your code" with the site's message and a
box; the code typed there is entered on the form and the application sent.
The code always comes from the user. The check is there to confirm a person is
applying, so Windrush never fetches a code itself, not even from a connected
Gmail inbox; the only way in is the user typing it (POST .../code).
- browser_agent: when the submit stops at a code page and ask_code is given, it
waits for the user's code, types it into the page's code boxes (one character
a box, as Greenhouse has eight, or one field labelled as a code; insertText,
so React boxes take it), checks the boxes hold it, and sends again. A code
that doesn't take is asked for again, up to three.
- autopilot: the run is "awaiting_code" while it waits, with the site's line and
how long it waits (10 minutes); give_code hands a typed code to the waiting
form. Sent: "Sent after you typed in the code…". No code in time, or none that
took: held as before, saying which, with the handover pack. Practice runs
never wait.
- A restart while a form waits holds it (the browser is gone).
- POST /autopilot/runs/{id}/code: letters and digits, 4 to 12; 409 once the
form isn't waiting; another user's run is out of reach.
- Frontend: "Needs your code" in the queue and the sidebar count, with a code
box on the run.
Tests: fast (a wrong code then the right one sends it; no code in time holds it;
practice never waits; restart; the endpoint), real browser (the code entered in
eight boxes and in one field, then sent; no code leaves it unsent) and the e2e
smoke test (the code typed goes to its run).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Catapult's live send stopped at Greenhouse's "A verification code was sent to … enter the 8-character code to confirm you're a human". Autopilot could only give up and hand over (#67, #69). The user wants to finish such sends from Windrush: they read the code from their inbox and type it in, and Windrush enters it on the form it holds open.
The code always comes from the user. The check is there to confirm a person is applying, so Windrush never fetches a code itself, not even from a connected Gmail inbox. The only way in is the user typing it (
POST /autopilot/runs/{id}/code). This is stated where the hook is defined (browser_agent.CodeAsker) and in the endpoint.What changed
browser_agent
_finish_unattended(..., ask_code)handles a submit that stops at a code page (_code_asked). It:_enter_code): one character a box when there's a box each (Greenhouse has eight,maxlength=1), else the one field labelled as a code. It uses CDPinsertText, so React-controlled boxes take it like typing;apply_with_browserpassesask_codethrough.autopilot
awaiting_code, with the site's line and the wait (10 minutes,_CODE_WAIT_S).give_codehands a typed code to the waiting form (_codes: run id → future).needs_you), saying which, with the handover pack.ask_code).tracker
awaiting_code. A restart while a form waits holds it, since the browser is gone.main
POST /autopilot/runs/{id}/code: letters and digits, 4 to 12 (spaces and dashes dropped). It returns 409 once the form isn't waiting, and another user's run is out of reach.Frontend
Tests
code_boxes.html, eight auto-advancing boxes like Greenhouse, andcode_field.html): the code is entered and the form sent again, and with no code it's left unsent. ScriptedLLM'ssubmit_successcan now be a sequence.tscand lint clean.After deploy
Rebuild both containers with
docker compose up -d --build api frontend.