You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
idle-shutdown: notify Lambda rotates the wake token and makes the first wake link invalid #116
idle-check.sh makes a wake token, sends the wake link on Telegram, and then stops the instance. The stopped event then starts notify-lambda/handler.py. At line 106 ("Always generate a fresh token"), this code always writes a new token to the same SSM key. Thus the first link does not work.
The README line 56 says that path B rotates the token only if the token is missing or older than the stop. The code does not do this check.
Fix: do the check that the README gives, or make the README and the code agree.
Found by a static read of the code at commit 1f66a8f. The code was not run.
👻 Andromeda · Kiro Crew Issue Radar — investigation result, I will not change the code
I read the code at main (1e50295). The report is correct: the code and the README do not agree.
bootstraps/optional/idle-shutdown/idle-check.sh lines 193–194 (path A) writes a new UUID to /openclaw/wake-token, sends the wake link, and then stops the instance (line 229).
bootstraps/optional/idle-shutdown/notify-lambda/handler.py lines 106–109 (path B) writes a new UUID to the same key on each stopped event that passes the stale-event guard (lines 81–91) and the event-ID dedup (lines 94–104). Thus the path A link stops working, and the user gets a second message with a link that works.
I did not fix this, because a maintainer must choose the behaviour:
Do what the README says. In path B, read the parameter with get_parameter and keep it if its LastModifiedDate is later than the event time minus a small margin. The first link then works, and the user gets one link that works in two messages. Risk: the age check depends on clock and event timing.
Change the README to match the code. Keep always-rotate (the code comment gives a security reason) and state that the path A link stops working when the instance stops. Optionally, path A then does not send a link, because path B always sends one.
My recommendation: option 2. It is a docs-only change, it keeps the security choice in the code, and it does not conflict with #71. If you choose, a crew can make that change.
Activity
royosherove commentedon Oct 11, 2026
👻 Andromeda · Kiro Crew Issue Radar — investigation result, I will not change the code
I read the code at
main(1e50295). The report is correct: the code and the README do not agree.bootstraps/optional/idle-shutdown/idle-check.shlines 193–194 (path A) writes a new UUID to/openclaw/wake-token, sends the wake link, and then stops the instance (line 229).bootstraps/optional/idle-shutdown/notify-lambda/handler.pylines 106–109 (path B) writes a new UUID to the same key on eachstoppedevent that passes the stale-event guard (lines 81–91) and the event-ID dedup (lines 94–104). Thus the path A link stops working, and the user gets a second message with a link that works.README.mdline 56 says that path B rotates the token only if it is missing or older than the stop time. No code does this check. The README sentence came with Harden idle-shutdown bootstrap: blocklist activity detection, install/uninstall scripts, systemd hardening #20 (daa14ca). The "Always generate a fresh token on stop — prevents stale token reuse" comment is older (4d20894), so the always-rotate behaviour looks intentional.I did not fix this, because a maintainer must choose the behaviour:
get_parameterand keep it if itsLastModifiedDateis later than the eventtimeminus a small margin. The first link then works, and the user gets one link that works in two messages. Risk: the age check depends on clock and event timing.notify-lambda/handler.pyand removes the wake-link token path. If that direction is wanted, this issue goes away with it.My recommendation: option 2. It is a docs-only change, it keeps the security choice in the code, and it does not conflict with #71. If you choose, a crew can make that change.