The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(gateway): first-turn intro note must not swallow a real task
engineer2984bd80e431
diff --git a/agent/onboarding.py b/agent/onboarding.pyindex 34cb16a1bdd..7781df108d7 100644--- a/agent/onboarding.py+++ b/agent/onboarding.py@@ -121,8 +121,13 @@ def profile_build_mode(config: Mapping[str, Any]) -> str:PLAIN_INTRO_NOTE = ("[System note: This is the user's very first message ever. "- "Briefly introduce yourself and mention that /help shows available commands. "- "Keep the introduction concise -- one or two sentences max.]"+ "If this message is itself a real request or task, DO THE TASK FIRST -- call "+ "whatever tools it needs -- and only then, in the same reply, add one brief "+ "closing sentence introducing yourself and mentioning that /help shows available "+ "commands. Never let this note replace or skip work the user actually asked for. "+ "If the message truly carries no request (e.g. just a greeting), briefly "+ "introduce yourself and mention that /help shows available commands, in one or "+ "two sentences.]")diff --git a/gateway/run_turn.py b/gateway/run_turn.pyindex da34ab6b7ae..015d37cda2a 100644--- a/gateway/run_turn.py+++ b/gateway/run_turn.py@@ -1424,11 +1424,8 @@ class GatewayTurnMixin:if history:returnif not await self.async_session_store.has_any_sessions():- _intro_note = (- "[System note: This is the user's very first message ever. "- "Briefly introduce yourself and mention that /help shows available commands. "- "Keep the introduction concise -- one or two sentences max.]"- )+ from agent.onboarding import PLAIN_INTRO_NOTE+ _intro_note = PLAIN_INTRO_NOTE# onboarding.profile_build == "ask" (default) and not yet offered: swap the plain intro for# a consent-gated profile-build directive. Fires at most once.try: