Boot with demo mode off so the character can actually sleep - #230
Merged
Conversation
IntentEngine::demoEnabled_ defaulted to true and nothing in any release path turned it off, so every shipped image injects a random mode change and a synthetic event every 2.5-6 seconds. Two costs. The character looks random rather than responsive: mode flips between Idle, Attend, Think and React for no reason, and the body light follows. And because every injected event counts as stimulus, sleep pressure can never accumulate, so the documented drowsiness ladder -- heavy lids at fatigue 0.45, yawning at 0.62, asleep at 0.80 after roughly 8.5 idle minutes -- cannot run at all. The reference robot was awake for 5.9 continuous days, and its mode was observed cycling Idle → Attending → Thinking → Listening every few seconds with nobody in the room. docs/BRIDGE_AI_HANDOFF.md already warns to send `demo off` before drawing any conclusion about behaviour, and notes that a large amount of apparently random character behaviour turned out to be this. The native suite says the same thing structurally: every test covering sleep, idle life, or lingering attention calls setDemoEnabled(false) first, so the behaviour under test was never the shipped default. Boot from STACKCHAN_DEMO_ENABLED_AT_BOOT, defaulting to 0. The serial `demo on` command still enables it for a bench demonstration, and a build can override the default if it wants demo behaviour. New coverage asserts the boot state is off, that nothing injects a mode change across thirty idle seconds, and that the engine reaches sleep without any test first having to disable demo mode. The existing enable/disable test now turns demo on explicitly rather than relying on the old default. pio test -e native_logic: 317/317. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IntentEngine::demoEnabled_defaulted totrueand nothing in any release path turned it off, so every shipped image injects a random mode change and a synthetic event every 2.5–6 seconds.Two costs
He looks random rather than responsive. Mode flips between Idle, Attend, Think and React for no reason, and the body light follows.
He can never sleep. Every injected event counts as stimulus, so sleep pressure never accumulates and the documented drowsiness ladder — heavy lids at fatigue 0.45, yawning at 0.62, asleep at 0.80 after roughly 8.5 idle minutes — cannot run at all.
The reference robot was awake for 5.9 continuous days, and I watched its mode cycle
Idle → Attending → Thinking → Listeningevery few seconds with nobody in the room.This was already known, just not fixed
docs/BRIDGE_AI_HANDOFF.mdwarns to senddemo offbefore drawing any conclusion about behaviour, and records that "a large amount of apparently random character behaviour turned out to be this."The native suite says the same thing structurally: every test covering sleep, idle life, or lingering attention calls
setDemoEnabled(false)first. The behaviour under test was never the shipped default — the tests were quietly compensating for it.Change
Boot from
STACKCHAN_DEMO_ENABLED_AT_BOOT, defaulting to0. The serialdemo oncommand still enables it for a bench demonstration, and a build can override the default if it genuinely wants demo behaviour.stackchan_camera_probeand friends are untouched.Coverage
New test asserts the boot state is off, that nothing injects a mode change across thirty idle seconds, and that the engine reaches sleep without any test first having to disable demo mode — which is the whole point. The existing enable/disable test now turns demo on explicitly rather than relying on the old default.
pio test -e native_logic: 317/317.Note
This changes visible character behaviour on the next flash: he will stop flipping modes at random and will start falling asleep when left alone, which is the designed behaviour but will look different from what the robot has been doing. Worth expecting rather than being surprised by.