Skip to content

feat(messaging): spread new iMessage links across phone lines - #24164

Merged
Git-on-my-level merged 1 commit into
mainfrom
keiki-line-balance
Oct 31, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
keiki-line-balance

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

What

iMessage links now spread across phone lines. David asked for this on 2026-10-31, ahead of a wider launch. It works the same with one line or many.

Keiki's iMessage guidance sets the limits: under 50 new conversations per line in 24 hours, about 500 users per line, and stop adding at 70–80%. Past its daily ceiling, Keiki refuses sends that would open a new conversation, so a person's first reply could fail.

How a line is chosen. When the app mints a link code, the backend picks the line with the most room:

  • Room is the tighter of new people in the last 24 hours (default limit 40) and people linked (default limit 400).
  • Up to 8 lines are compared in one transaction. Beyond that it takes random samples of 8, and keeps sampling until it finds room or has checked every line. A wave of links doesn't contend on every line.
  • A new line takes 10 new people a day in its first week and 10 more each week after, up to its limit. This pace is my choice; Keiki only says to grow gradually over the first weeks.

Staying on a line.

  • A person who has linked keeps their line, including after unlinking and returning, because their conversation is there.
  • Asking for a new code keeps the same line and the same slot.
  • An abandoned code gives its slot back after 10 minutes, when the code expires.

When every line is full. Mint answers 409 and adds the person to the waitlist, the same as a full seat cap, so the app needs no new state.

Config. lines in OMI_MESSAGING_LINK_TARGETS, documented in the channel runbook. "enabled": false closes a line to new people and keeps those on it. This PR puts the current line, +14155252967, in the list with its start date.

App. "Open Messages" after connecting now opens the line the code was sent to. It used the flag's address before, which would start a second conversation for anyone on another line.

Product invariants

  • Nobody is moved off a line they have linked on. A returning person can take a line past max_users, which leaves 20% room below Keiki's figure.
  • A channel without lines behaves as before, so Telegram and WhatsApp don't change.
  • Malformed or empty lines closes linking and sends people to the waitlist. It never lifts the limits.
  • Linking stays proof-based. A person who texts a different line by hand is still linked and counted on the line they were assigned.
  • Line rows hold counts and hashed uids only, with no message content or phone numbers of users.

Product invariants affected

  • INV-MEM-4

Cited because the deploy manifest changed. The manifest edit touches only OMI_MESSAGING_LINK_TARGETS, so memory promotion is unaffected.

Verification

  • pytest tests/unit/test_messaging_lines.py tests/unit/test_messaging_firestore.py tests/unit/test_messaging_launch_hardening.py tests/unit/test_messaging_channels.py tests/unit/test_messaging_keiki.py on a local Firestore emulator: 154 passed, 1 skipped.
  • New tests cover one line, even spread across three, a new line in a wave, 30 lines with one free, 12 simultaneous codes against a limit of 5, re-minting, abandoned codes, relinking, a returning person on a full line, malformed config, closed lines, links from before this change, and account deletion.
  • flutter test test/pages/settings/chat_apps test/providers/messaging_channels_provider_test.dart: 76 passed, including the new check that the connected button opens the assigned line.
  • Not measured: real traffic on more than one line. Only one line exists today.

UI-Evidence: none -- no visual change; the existing button opens a different number
Failure-Class: none

Rollout

Backend deploy through the rollout coordinator, with the manifest's OMI_MESSAGING_LINK_TARGETS change. Only David's account has Keiki iMessage today. The app change ships in the next mobile release; an older app opens the flag's address from that button, which still reaches Omi on the same linked identity.

Limits on the current line from deploy: its start date of 2026-10-30 gives 10 new people a day in its first week. seat_cap in the channel policy is unchanged and still caps the whole channel.

Links made before this change aren't counted until their next code. Only David's link is on this line, so the counts need no backfill.

Rollback: revert this commit. Links keep working on the plain address. Line rows and placements are then unused.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

Each new link goes to the line with the most room, by new people in the last 24 hours and people linked. A person stays on their line. When no line has room, mint answers like a full seat cap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit 2e18b25 into main Oct 31, 2026
63 checks passed
@Git-on-my-level
Git-on-my-level deleted the keiki-line-balance branch October 31, 2026 12:32
Git-on-my-level added a commit that referenced this pull request Oct 31, 2026
… 5xx re-escalation, WQ31) (#24194)

## Summary

Firestore read lever config — guard flag-off: 7 levers 100 -> 0
(`singleton_loops`, `usage_month_cache`, `backfill_task_reads`,
`historical_scan_memo`, `ledger_purge_coalesce`,
`queue_age_sample_budget`, `usage_month_total`). Complete 20-key
literal, delta vs main only in those 7 keys; `finjob_candidate_queries`
stays 5 (its own gate). The `usage_month_total` Cloud Run-only override
in `prod.overlay.yaml` goes 100 -> 0 with this flag-off — umt is itself
guard-flagged; #23739 (4f7e485) set the precedent of flagging umt to
0 and removing the wanted-line CR term while keeping
`FSR_USAGE_MONTH_TOTAL_EPOCH` recorded.

Reason: backend-sync 5xx guard re-escalation fired per the armed WQ30
plan. verify graded the flagged levers UNSAFE on 5 consecutive ticks
(17Z-21Z 2026-10-31: rate 0.0035-0.0036, 1550-1600 err/h excl
audio-merge, vs ref 0.0014). The 17:15Z run disposed the first raise as
exogenous (route attribution: /v2/sync-jobs/run + audio-merge retry
noise under 2x WoW traffic) and armed re-escalation: "flag off next run
if verify still FAIL post-fix-serve with 2h train-quiet tail, or on any
lever-specific why". The lead's fix train (14d7e31 carrying #24161,
#24164, #24175) went live 15:18Z on backend / backend-sync /
backend-integration (lead bus post); no train since (5h+ quiet tail);
verify still FAILs with a FLAT rate and unchanged error counts. No
lever-specific why (finjob at 5% carries the same service-scope why).
Per the runbook judgment rule, flag-off is the discriminating
experiment: if the 5xx rate persists at levers 0, the cohort is
exonerated (cause exogenous) and re-enables at 5%; if it drops, the
cohort is implicated.

## Product invariants affected

- INV-FSR-LEVERS — replace-mode literal rule respected; all 20 keys
present; absent keys remain off by default; KNOWN_LEVERS unchanged.
- INV-MEM-4 — required by the `backend/deploy/runtime_env.yaml`
generated-manifest lock; the change is the rendered
FIRESTORE_READ_LEVERS literal only.
- INV-DATA-1 — lever-off restores legacy un-memoized paths (safe
defaults, all previously serving pre-ramp).

Failure-Class: none

## Verification

- `set_levers.py` REPLACE-mode with the complete 20-key umt:0 literal (6
keys 100 -> 0 in base/charts/pins); `prod.overlay.yaml` hand-patched umt
100 -> 0 plus the same 6 keys (4 sites, set_levers does not match its
inline literal form); `compose_runtime_env.py` +
`render_feature_flag_registry.py` re-run.
- Contract-pinned expected dict in `test_render_backend_runtime_env.py`
updated per #24134/#23739 convention (6 keys 100 -> 0; the `wanted`
CR-override term removed while umt is off, epoch assertion unchanged).
- Diff audit: 43 changed-literal sites, every `+` side equals the new
20-key literal exactly; zero residual sites with any flagged lever > 0;
`finjob_candidate_queries` = 5 everywhere.
- Contract tests: `test_render_backend_runtime_env.py` 91 passed +
`test_verify_pusher_config_references.py` 28 passed (lane venv).
- Full CI: on this head.

## Lead-owned ship plan

URGENT: deploy needed listen -> pusher -> Cloud Run
(FIRESTORE_READ_LEVERS train order). Bus handoff posted to the lead;
ride the next train rather than batching.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/24194?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/24194?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F24194&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
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