Build1 distinct publisher3 min readUpdated
An Instagram automation lane reported success twelve times a day while doing nothing. The fix was asserting on live session state, read out of Chrome's cookie database, not on the absence of errors.
The Engineer · Build desk
Compiled by The EngineerSomething wrong?How this is made
A scheduled browser-automation lane ran twelve times a day, logged "complete" on every run, sent no errors to its monitoring dashboard, and produced zero likes and zero follows for days [1][2]. The account it drove, `ig-2`, had been logged out and its Instagram session had expired; the job, parked on a logout screen, kept returning exit 0 on the reasoning that there were no targets left or no accounts matched the criteria [3][4].
The developer, writing on dev.to, says the lane looked normal until the morning of 2026-08-09 [5]. There was login-detection code. `needLogin()` in `social-autolike/src/run.js` flagged a login as required if the URL contained `/login`, or if the body contained the Japanese word for login and none of `article`, `[role=feed]`, `video`, `main` or `[data-e2e]` were present [6]. Instagram's logout screen contains a `main` element, so the second condition never fired: one `main` was found, and the check passed the logged-out page as healthy [7].
That is the whole failure in miniature. A selector answers "does this page look like a login screen," which is not the question; the question is whether this browser is currently authenticated, and the first proxy dies the moment the markup changes [8].
The replacement assertion reads state instead of appearance. Chrome keeps session cookies in a SQLite file at `Default/Network/Cookies`, or `Default/Cookies` on older versions [9]. Instagram's login state lives in a cookie named `sessionid`; if that cookie exists for the `instagram.com` domain, the profile is logged in [10]. The author's argument for making cookies the primary source is that the mapping holds regardless of redesigns to the logout page [11]. Anything driving a Chrome or Chromium profile is exposed to the same gap, whether the driver is Playwright, Puppeteer, browser-use, or something assembled with Claude Code [12].
The guard script, `profile-session-guard.sh`, runs before the work and stops the lane with a notification when the session is dead [15]. Four stages: resolve the profile directory list from three config files (`accounts.json`, `ig-reply-accounts.json`, `post-accounts.json`) plus two fixed entries from a separate repo, collapsing duplicates [16]; look for the cookie DB at `Default/Network/Cookies`, `Default/Cookies`, `Network/Cookies` or `Cookies`, and copy it with `mktemp`, deleting the copy on exit [17]; query the copy with `sqlite3` using a per-platform SQL statement and grade each profile OK, EXPIRED or UNKNOWN [18]; then aggregate, compare against a state file, skip the notification when the breakage matches the previous run, and on a new breakage send a Discord message and exit 1 [19].
The cost of not doing this is measured in silence. A graph pinned at zero is hard to notice while no errors fire, and the author could not reconstruct how many days `ig-2` had lost [13][14]. At twelve runs a day, a single week of that is eighty-four consecutive green runs [20].
Two things to watch if you copy the pattern. UNKNOWN is a real third outcome in this design, not a rounding error, and it needs a policy: treat it as expired and you halt on a moved database file, treat it as fine and you are back to guessing [18][9]. And the state-file deduplication that stops Discord from repeating itself also means a lane that stays broken tells you once [19], so the durable check is the inverse of the one that failed here: alert on a lane that has produced nothing while claiming success, not on a lane that threw.
Follow any of these and your For You feed starts watching them — no settings page required.
Ranked by verification strength, evidence, and original report placement.
The lane tied to the account ig-2 in the author's social-autolike system was scheduled to run 12 times a day; each run logged "complete" and no errors reached the monitoring dashboard.
The reality was likes = 0 and follows = 0; the job had been doing absolutely nothing for days.
The cause was that the ig-2 account was logged out and its Instagram session had expired.
The job, staring at a logout screen, kept returning exit 0 on the grounds that "there were no targets left" or "no accounts matched the criteria".
The job was working normally, or appeared to be, until the morning of 2026-08-09.
needLogin() in social-autolike/src/run.js decided login was required based on roughly two conditions: the URL contains /login; or the body contains the word "login" in Japanese AND none of the elements article, [role=feed], video, main, [data-e2e] exist.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Detailed but single-source and self-reported
The mechanism is specified at a level a reader can check independently — the exact needLogin() conditions, the presence of a main element on Instagram's logout screen, the Chrome cookie DB paths, the sessionid cookie, and a four-stage script with quoted jq code. That specificity is real evidentiary weight. But everything comes from one dev.to post by the operator of the system: there is no second publisher, no log excerpt or metric series showing the zero-output window, no stated outage length, and the broader claims (cookie state as a redesign-proof login oracle, applicability to all Chrome-profile automation) are asserted rather than tested.
One self-hosted deployment by the author
Observed adoption is confined to the author's own environment: one guard script watching the profiles of their personal social-autolike and related lanes, notifying a private Discord. No other users, downloads, forks, organizations, or third-party deployments are reported anywhere in the supplied source, and the incident itself is a single-lane event.
Mostly proportionate, with a slightly oversold universal fix
The framing is unusually restrained for the genre: the headline claim (exit 0 only means nothing threw) is exactly what the incident shows, the author admits not knowing how long the lane was dead, and the fix is presented as a bash script rather than a product. The modest positive gap comes from two stretches beyond the evidence — that the sessionid cookie maps one-to-one to login state regardless of any redesign, and that any Chrome-profile automation can hit this exact problem — both generalized from a single lane, and neither addressing the case where a cookie persists after a session is revoked.
Self-promotional practitioner narrative around own tooling
The post opens with a monetization arc — ¥100k/month as a student, ¥600k/month of side gigs, layoff to zero, then ¥1.2M/month rebuilt with Claude Code — and frames the incident as an installment in an ongoing series about mass-producing personal projects. That gives the author a clear reputational and audience-growth incentive to present the failure and its fix as a generalizable lesson, and the tooling praised is the author's own. Offsetting factors: the piece discloses its own bugs, including a prior false-positive release, and no vendor sponsorship, paid product, or third-party interest is evident in the supplied source.
Moderate: coherent and checkable, but uncorroborated
Confidence in the narrow, first-person facts is fairly high — the incident, the DOM heuristic, the cookie-based replacement and the script's structure are internally consistent, technically plausible, and specific enough that a reader could verify the mechanism. Confidence in the general prescription is much lower: a single publisher, a single operator, one platform, no measured before/after metrics, and no independent test of the cookie-as-truth premise. The blended score reflects a well-documented anecdote rather than an established practice.
build
The 46GB Leak Your RSS Alert Cannot See: macOS Compressed Memory Breaks Threshold Monitoring1 distinct publisher
build
Yadda 3's real artifact is not the code, it is the rules the agent could not rewrite1 distinct publisher
product
Cinemas, classrooms and ICE: smart glasses now need a venue-policy contingency1 distinct publisher
science
Feeds are triaging patients by engagement, and the proposed defence is literacy, not moderation1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 16, 2026