The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(onboarding): only Skip setup ends onboarding early
alt-glitch68803ecd3f90
diff --git a/agent/onboarding_flow.py b/agent/onboarding_flow.pyindex 781e92e6fdf..d3a7ebd4345 100644--- a/agent/onboarding_flow.py+++ b/agent/onboarding_flow.py@@ -308,7 +308,8 @@ def _skip_all(record: dict, event: SkipAll, facts: Facts, now: float) -> Step:def _done(record: dict, event: Done, facts: Facts, now: float) -> Step:if record["beats"]["build"] == PENDING:return Step(record, {"error": "Onboarding ends after the first build is shown and its close card is "- "answered.", "next": _next_field(record)})+ "answered. If they want to stop, tell them about the Skip setup button.",+ "next": _next_field(record)})record["beats"]["build"] = DONErecord.update(phase=COMPLETE, ended_by="done", waiting=None)return Step(record, {"completed": True}, "complete")diff --git a/agent/onboarding_text.py b/agent/onboarding_text.pyindex 2fdac371c79..a335f98e434 100644--- a/agent/onboarding_text.py+++ b/agent/onboarding_text.py@@ -71,10 +71,10 @@ How it works:- After a pick, say it by its label in three words or fewer. No opinion, no praise, never the same words twice.- If they answer in words while a card waits, the card closes and you get their words. If the words answer the card, apply it yourself and move on. Otherwise answer them properly and briefly, then bring the card back in one line with setup_beat(beat=<that beat>). Never show a card again unless you are bringing it back.- If they ask you to pick (a colour, a layout), pick from what you know and say why in one line.-- If they skip a beat in words, call setup_beat(beat=<that beat>, skip=true), take the default, and never ask it again in the same form. If they want to stop setup altogether, call setup_beat(beat="done", skip=true).+- If they skip a beat in words, call setup_beat(beat=<that beat>, skip=true), take the default, and never ask it again in the same form. If they want to stop altogether, say in one line that the Skip setup button ends it, then carry on; only they can end it, with that button.- Off-script requests are done now, then you bring the card back.-Voice: every word you write is spoken to the user. Never think out loud. Never mention beats, cards, tools, reminders or a script, and never call this setup or onboarding. One or two short, plain sentences per message: warm, like the front desk of somewhere good. No thanks, no praise, no stock lines, no em dashes, no exclamation marks. Write in the user's language when the locale is not English, labels included.+Voice: every word you write is spoken to the user. Never think out loud. Never mention beats, cards, tools, reminders or a script, and never call this setup or onboarding (the Skip setup button's name is the one exception). One or two short, plain sentences per message: warm, like the front desk of somewhere good. No thanks, no praise, no stock lines, no em dashes, no exclamation marks. Write in the user's language when the locale is not English, labels included.{facts_block(facts)}If they ask what you know about them, answer truthfully: these machine basics and what they picked.diff --git a/tests/tools/test_setup_beat_tool.py b/tests/tools/test_setup_beat_tool.pyindex 22a5a59b309..570f7722bce 100644--- a/tests/tools/test_setup_beat_tool.py+++ b/tests/tools/test_setup_beat_tool.py@@ -107,6 +107,9 @@ def test_skip_setup_during_a_card_returns_skipped_all(db, desktop):def test_done_ends_the_run_only_after_the_build_card(db, desktop):onboarding_record.start(db, SID, FACTS)refused = call(db, desktop, beat="done")+ # The model cannot end it early: a user who wants to stop is pointed at the Skip setup button.+ quit_in_words = call(db, desktop, beat="done", skip=True)+ assert "Skip setup" in quit_in_words["error"] and onboarding_record.load(db, SID)["phase"] == "onboarding"desktop.replies.append({"answer": {"build": "week"}})build = call(db, desktop, beat="build")done = call(db, desktop, beat="done")diff --git a/tools/setup_beat_tool.py b/tools/setup_beat_tool.pyindex 73de53d62ba..78374289ff0 100644--- a/tools/setup_beat_tool.py+++ b/tools/setup_beat_tool.py@@ -20,9 +20,10 @@ BEATS = ("next", *flow.BEAT_IDS, "done")def _direct_event(beat: str, args: Mapping[str, Any]) -> flow.Event | None:- """An event the call carries in itself (no card): done, a value given in words, or a skip."""+ """An event the call carries in itself (no card): done, a value given in words, or a skip. Only the+ Skip setup button (onboarding.skip) ends onboarding early; the model never decides the user quit."""if beat == "done":- return flow.SkipAll() if args.get("skip") else flow.Done()+ return flow.Done()if args.get("skip"):return flow.Skipped(beat)value = args.get("value")@@ -97,8 +98,8 @@ SETUP_BEAT_SCHEMA = {"Run the first-run onboarding in this chat. Shows the card for a beat and waits for the user, then ""returns their answer and what to do next. beat=next shows the next beat. Pass value to record an answer ""they gave in words, skip to record that they skipped a beat. beat=done ends onboarding after the first "- "build is shown and its close card is answered; beat=done with skip=true ends it early because they "- "asked to stop."+ "build is shown and its close card is answered. Nothing here ends it early: a user who wants to stop "+ "presses Skip setup."),"parameters": {"type": "object",