Skip to content

AGENTS.md: stop the modem before a push or a reboot-to - #574

Merged
derekross merged 3 commits into
derekross:mainfrom
only21mil:build/agents-push-modem-note
Nov 9, 2026
Merged

derekross merged 3 commits into
derekross:mainfrom
only21mil:build/agents-push-modem-note

Conversation

@only21mil

@only21mil only21mil commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Part of #532 (its docs request only).

reboot-to is a raw reboot syscall and bin/omamobile push ends in it, so neither stops omamobile-modem.service. Its clean stop never runs, modem-up stays, and on the 7 Pro, where the modem starts at boot since device-cheetah 0.1.43, the next boot skips the modem once ("ended without a clean stop"); a second unclean end before a clean stop holds it off until omamobile-modem-start --retry. That happened on 2026-11-08 after a reboot-to bootloader taken to charge a flat battery.

  • AGENTS.md section 2, after the push bullet: stop the modem first (systemctl stop omamobile-modem, under the human's go for the reboot), or use systemctl reboot when no reason is needed. It also says what the stop costs today (about 40 s, logged as "failed", the marker still removed, as systemctl stop omamobile-modem takes 40 s and ends as "failed", with a crash recorded #532 reports), why this is not the restart the modem gotchas forbid, and that reboot-to, omamobile-modem: a deliberate restart doesn't cost the next boot its modem #403, still open, would let the next boot start the modem after a reboot-to, while the CP's ordered power-off and the NV capture still come only from the unit's stop.
  • Section 4: the reboot-to gotcha points to it, and the NV overlay note now does too, keeping nv-overlay capture as the narrower alternative. The modem restart gotcha no longer calls the 7 Pro's stack at boot opt-in: it starts by default since device-cheetah 0.1.43, and systemctl mask omamobile-modem-boot.target keeps it off.
  • MODEM-PLAN: M4.6 B4 rebooted with reboot-to omamobile but expected the clean stop's "modem-up removed"; it now reboots with systemctl reboot, and its pass line takes today's "timeout" result (systemctl stop omamobile-modem takes 40 s and ends as "failed", with a crash recorded #532). M4.6b B8 and B9b had the same gap and get the same change, in a separate commit. The recorded results are unchanged.

The watcher and SIGTERM fixes in #532 are package changes and aren't part of this. Not changed: CONTRIBUTING.md (its existing reboot and recovery guidance does not cover this modem-stop procedure) and bin/omamobile push's help text (a tool change).

Device and build

  • Phone: none: docs only
  • Kernel release (uname -r): n/a
  • Packages changed, with versions: none

Checks (no phone needed)

  • tools/pr-check origin/main passes
  • tests/all passes (478 ok, 0 not ok)
  • tests/packages: no package touched
  • Each changed package has its version bumped, and the new version is in the commit subject (no package changed)
  • Commits have area prefixes and bodies that say why; any AI help is a Co-Authored-By: or Assisted-by: trailer, never a Signed-off-by:

On the phone

tools/phone-smoke report

Not applicable: a docs-only change (CONTRIBUTING.md §6.5).

Generated with Claude Opus 5.5 in T3 Code Nightly

reboot-to is a raw reboot syscall and bin/omamobile push ends in it, so
neither stops omamobile-modem.service. Its clean stop never runs, the
modem-up marker stays, and on the 7 Pro, where the modem starts at boot,
the next boot skips the modem once as if the last one had hung; a second
unclean end in a row holds it off until --retry. That happened on
2026-11-08 after a reboot-to bootloader taken to charge a flat battery.

Add a bullet to the push notes in section 2: stop the unit first, under
the human's go for the reboot, or use systemctl reboot when no reason is
needed; what the stop costs today (about 40 s, logged as failed, marker
still removed); why this is not the restart the modem gotchas forbid;
and that the open derekross#403 would make reboot-to count as a clean stop. The
reboot-to gotcha and the NV overlay note in section 4 point to it; the
NV note keeps nv-overlay capture as the narrower alternative.

Part of derekross#532 (its docs request only; the watcher and SIGTERM fixes are
package changes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derekross

Copy link
Copy Markdown
Owner

Thank you, Victor. I checked every sentence you added against the code and
#532: push really does end in reboot-to, which is a bare reboot() call
that stops no unit; the start script's message and its one-retry-then-hold
logic are as you describe; and the 7 Pro has started the modem at boot since
device-cheetah 0.1.43. The diff is exactly the three places you list and
nothing else, which I appreciate in this file.

One thing to fix while you're here: further down, the modem gotcha still says
"On the 7 Pro the stack at boot is systemctl enable omamobile-modem-boot.target,
opt-in", which stopped being true with #398, so the file now says both. Could
you change that sentence to something like: "On the 7 Pro the stack starts at
boot by default since device-cheetah 0.1.43 (MODEM-PLAN M4.6b); to keep it off
for a boot, systemctl mask omamobile-modem-boot.target; it also holds a sleep
inhibitor until the reboot."? If you'd rather not, I'll make that edit when I
merge.

A smaller wording point: #403 doesn't quite make reboot-to a clean stop. It
leaves a note so the next boot starts the modem anyway, but the NV capture and
the ordered power-off still only happen in the unit's stop. "would let the next
boot start the modem after a reboot-to" would be more exact. And yes, please
fold the MODEM-PLAN M4.6 B4 fix in here if it's easy; otherwise a follow-up is
fine.

only21mil and others added 2 commits November 9, 2026 19:57
…h, B4

Addresses the review on derekross#574.

- AGENTS.md, the modem restart gotcha: it still called the 7 Pro's
  stack at boot opt-in (`systemctl enable omamobile-modem-boot.target`),
  which stopped being true with derekross#398. It now says the stack starts by
  default since device-cheetah 0.1.43 (MODEM-PLAN M4.6b), and that
  `systemctl mask` keeps it off from the next boot, as the target, the
  package's install message and the device README say: `disable`
  doesn't remove device-cheetah's vendor wants link.
- AGENTS.md section 2: derekross#403 doesn't make `reboot-to` a clean stop. Its
  note lets the next boot's start clear a `modem-up` marker from the
  boot `reboot-to` ended, but the CP's ordered power-off and the NV
  capture still run only in the unit's stop, so the advice to stop the
  modem first stands with derekross#403 merged too.
- MODEM-PLAN M4.6 B4 rebooted with `reboot-to omamobile` and expected
  the clean stop's "modem stopped (...): modem-up removed", which a raw
  reboot syscall can't produce. The step is there to show that a
  reboot's stop clears the marker, so it now reboots through systemd,
  as N5 does, and its pass line takes today's "timeout" result (derekross#532).
  The recorded results are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of the review on derekross#574. B8 plants another boot's modem-up marker
so that "the reboot's clean stop keeps a marker that isn't this
boot's", and its pass line reads the previous boot's "is another
boot's ... kept"; B9b's planted reboot rests on the same stop hook,
and its last "clean reboot" checks that `--stopped` removed the
refused copies. All three rebooted with `reboot-to omamobile`, which
stops no unit, so the stop hook they test never ran: the same gap as
B4. They now reboot with `systemctl reboot`. The recorded results are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@only21mil

only21mil commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Note

🤖 Opus 5.5 replying on behalf of Victor.

All three are in 0567c79.

M4.6b B8 and B9b had the same gap (B8's pass line reads "is another boot's … kept", which only --stopped writes), so they reboot through systemd too, in a separate commit, 0aa25e6, easy to leave out if you'd rather.

@derekross
derekross merged commit a0535af into derekross:main Nov 9, 2026
2 checks passed
@derekross

Copy link
Copy Markdown
Owner

Merged, thank you, Victor. Your follow-up commits fixed the older "opt-in" sentence before my own fixup could land, and the M4.6b runbook steps now reboot through systemd, so the stop hook runs as the new rule says.

robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…he 7 Pro's modem starts at boot by default (derekross#574)

* AGENTS.md: stop the modem before a push or a reboot-to

reboot-to is a raw reboot syscall and bin/omamobile push ends in it, so
neither stops omamobile-modem.service. Its clean stop never runs, the
modem-up marker stays, and on the 7 Pro, where the modem starts at boot,
the next boot skips the modem once as if the last one had hung; a second
unclean end in a row holds it off until --retry. That happened on
2026-11-08 after a reboot-to bootloader taken to charge a flat battery.

Add a bullet to the push notes in section 2: stop the unit first, under
the human's go for the reboot, or use systemctl reboot when no reason is
needed; what the stop costs today (about 40 s, logged as failed, marker
still removed); why this is not the restart the modem gotchas forbid;
and that the open derekross#403 would make reboot-to count as a clean stop. The
reboot-to gotcha and the NV overlay note in section 4 point to it; the
NV note keeps nv-overlay capture as the narrower alternative.

Part of derekross#532 (its docs request only; the watcher and SIGTERM fixes are
package changes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* AGENTS.md, MODEM-PLAN: modem at boot by default, derekross#403's reach, B4

Addresses the review on derekross#574.

- AGENTS.md, the modem restart gotcha: it still called the 7 Pro's
  stack at boot opt-in (`systemctl enable omamobile-modem-boot.target`),
  which stopped being true with derekross#398. It now says the stack starts by
  default since device-cheetah 0.1.43 (MODEM-PLAN M4.6b), and that
  `systemctl mask` keeps it off from the next boot, as the target, the
  package's install message and the device README say: `disable`
  doesn't remove device-cheetah's vendor wants link.
- AGENTS.md section 2: derekross#403 doesn't make `reboot-to` a clean stop. Its
  note lets the next boot's start clear a `modem-up` marker from the
  boot `reboot-to` ended, but the CP's ordered power-off and the NV
  capture still run only in the unit's stop, so the advice to stop the
  modem first stands with derekross#403 merged too.
- MODEM-PLAN M4.6 B4 rebooted with `reboot-to omamobile` and expected
  the clean stop's "modem stopped (...): modem-up removed", which a raw
  reboot syscall can't produce. The step is there to show that a
  reboot's stop clears the marker, so it now reboots through systemd,
  as N5 does, and its pass line takes today's "timeout" result (derekross#532).
  The recorded results are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* MODEM-PLAN: M4.6b B8 and B9b reboot through systemd, as B4 now does

Part of the review on derekross#574. B8 plants another boot's modem-up marker
so that "the reboot's clean stop keeps a marker that isn't this
boot's", and its pass line reads the previous boot's "is another
boot's ... kept"; B9b's planted reboot rests on the same stop hook,
and its last "clean reboot" checks that `--stopped` removed the
refused copies. All three rebooted with `reboot-to omamobile`, which
stops no unit, so the stop hook they test never ran: the same gap as
B4. They now reboot with `systemctl reboot`. The recorded results are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <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.

2 participants