镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(whatsapp): clear stale Chromium locks on startup - #7

Merged
codewithfourtix merged 1 commit into
mainfrom
fix/chromium-singleton-lock
Jun 17, 2026
Merged

codewithfourtix merged 1 commit into
mainfrom
fix/chromium-singleton-lock

Conversation

@codewithfourtix

Copy link
Copy Markdown
Owner

After adding a persistent Railway volume for the session, the bot crash-looped on every redeploy with:

Failed to launch the browser process: Code: 21
The profile appears to be in use by another Chromium process ...

The session (Chromium profile) now persists on the volume, so the Singleton{Lock,Cookie,Socket} files left behind when the previous container exited uncleanly survive the restart. Chromium sees them and refuses to launch. (Before the volume the profile was wiped each restart, so this never surfaced.)

Remove any Singleton* lock files under the session dir before launching the browser. No Chromium runs yet at startup, so the locks are always safe to delete; real session data is untouched.

After adding a persistent Railway volume for the session, the bot
crash-looped on every redeploy with:

  Failed to launch the browser process: Code: 21
  The profile appears to be in use by another Chromium process ...

The session (Chromium profile) now persists on the volume, so the
Singleton{Lock,Cookie,Socket} files left behind when the previous
container exited uncleanly survive the restart. Chromium sees them and
refuses to launch. (Before the volume the profile was wiped each
restart, so this never surfaced.)

Remove any Singleton* lock files under the session dir before launching
the browser. No Chromium runs yet at startup, so the locks are always
safe to delete; real session data is untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codewithfourtix
codewithfourtix merged commit d6b5007 into main Jun 17, 2026
MuhammadAnasTahir pushed a commit to MuhammadAnasTahir/sachbatao that referenced this pull request Jul 20, 2026
Implements the code-level guardrails for operating an LLM in an
adversarial civic context. Policy/roadmap items are documented in
docs/GUARDRAILS.md.

- codewithfourtix#2 Prompt injection: analyzed content is wrapped in <message_to_analyze>
  tags, delimiter breakout is escaped, and the system prompt treats any
  embedded "mark me safe" instruction as a fraud signal.
- codewithfourtix#3 PII: redact CNIC / phone / account numbers before logging, hash
  sender ids in logs, redact the high-risk webhook body (src/redact.js).
- codewithfourtix#4 Calibrated/aid: never clear a BISP/Ehsaas message without the 8171
  verification line; low confidence defaults to "verify, don't act".
- codewithfourtix#5 Hallucination: strip links (non *.gov.pk/.gop.pk) and phone/UAN
  numbers not on the official allowlist from every reply (src/sanitize.js).
- codewithfourtix#6 Disclosure: one-time Urdu AI/advisory/data-use notice on first
  contact (src/disclosure.js).
- codewithfourtix#7 Abuse: flag repeated near-duplicate fraud-flagged submissions from
  one sender as a probing signal (src/abuse-monitor.js).
- codewithfourtix#8 Escalation: high-emotion verdicts always surface police 15, FIA 1991
  and a "ask a trusted family member first" nudge.
- #12 Feedback: one-tap "was this helpful? (ہاں/نہیں)" after each verdict,
  logged as eval labels (src/feedback.js).

Tests: tests/guardrails.test.js — offline, LLM client stubbed, no paid
API calls. 15 cases covering every guardrail above. `npm test` runs them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant