Skip to content

Bots, group member events and sign-in renewal (PR #4 with CI fix) - #5

Merged
ash-hashtag merged 8 commits into
mainfrom
pr4-review
Nov 9, 2026
Merged

ash-hashtag merged 8 commits into
mainfrom
pr4-review

Conversation

@ash-hashtag

Copy link
Copy Markdown
Contributor

Carries #4 by @pranay1618 unchanged, plus two commits on top:

Opened from a lupyd/firefly branch so CI runs with repository secrets. Merging this with a merge commit marks #4 as merged.

Known failures that also happen on main (not caused by this PR): the address rotation tests (server device-limit policy), the chatbot "SeeMessage permission required" test, and possibly the call/WebTransport tests.

🤖 Generated with Claude Code

pranay1618 and others added 8 commits November 9, 2026 12:04
…e2e setup

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The access token is renewed 5 minutes before it expires and handed to the
  Rust client, which reads it synchronously. A renewal timer that ran late
  (machine slept) is caught up by the next request. Temporary failures keep
  the current token and retry with back-off; one renewal runs at a time.
- Unattended mode (FIREFLY_UNATTENDED=true, set by run-bots.ts) never opens a
  browser. A revoked or expired refresh token exits with code 78, and
  run-bots.ts stops restarting that bot until it is signed in again.
- A refresh no longer overwrites the username with "client" when the token
  has no uname claim.
- With only FIREFLY_BASE_URL set, the websocket URL follows it instead of
  defaulting to production.
- The bot state database is held with an exclusive SQLite lock, so a second
  copy of a bot refuses to start instead of breaking its encryption sessions.
- run-bots.ts rotates each bot log to <bot>.log.1 at 10 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The published server image has no built-in subscription fallback, so group
creation failed without a subscription service. CI now starts
examples/bots-e2e/fake-subscriptions.ts, which serves the same unlimited plan
as the server's emulator fallback, and points the server at it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
examples/BOTS-SETUP.md covers everything from a fresh checkout to running the
bots unattended: the Auth0 callback URL that still has to be allowed, bot
accounts, tools, the first sign-in (including over an SSH tunnel on a
server), run-bots.ts, starting on boot, backing up the bot's files, signing in
again, testing against a local server, and troubleshooting.

The sign-in link is now always printed, so it can be opened from another
computer when the bot runs on a server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
setup-protoc downloads protoc from GitHub release assets, which returned 504 three times in a
row and failed the run before any test started. Ubuntu's protobuf-compiler (3.21) compiles the
only protos that need it (libsignal's, through prost-build).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The welcome DM comes from the bot's account but any group admin writes its text, so on the
official account a fresh group could message every newcomer as "Lupyd". DMs now start with
"From the admins of <group>:".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ash-hashtag
ash-hashtag merged commit 7322d4a into main Nov 9, 2026
1 check failed
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.

2 participants