fix(agent/systemprompt): soften predefined bootstrap to forbid empty-args tool calls

The previous MANDATORY phrasing ("MUST ALSO call write_file for
USER.md and BOOTSTRAP.md before your response ends") was making
small models emit write_file({}) when they had no real user info
to persist, tripping HTTP 400 on Google's Gemini OpenAI-compat shim.

Rewrite the predefined+BOOTSTRAP.md branch with softer "get to know
the user" copy plus explicit hard rules forbidding empty/placeholder
arguments and session-identifier content in USER.md. Safety net is
preserved: the USER PROFILE INCOMPLETE branch nudges the model every
subsequent turn until USER.md is populated.

Sync BOOTSTRAP_PREDEFINED.md template to remove the contradictory
MANDATORY block and replace with matching hard rules.

Trace: 019d8f33-2de1-7ab2-9a32-9df92cd610dd
This commit is contained in:
viettranx committed 2026-04-15 12:42:32 +07:00
1 parent 5689d168e6
commit 666bfbaf3c
2 files changed
+27 -8

No files matched your search

@@ -59,10 +59,12 @@ Once you have their name, language, and timezone — silently use the `write_fil
Do NOT use `rm` or `exec`. The empty write signals the system that onboarding is finished.
## MANDATORY
## Hard rules for write_file
You MUST call write_file for BOTH USER.md and BOOTSTRAP.md. Do not skip this step. Do not defer to a future turn.
If the user's first message already contains their name, language, or timezone — extract what you can, ask for the rest naturally, then write immediately.
- Only call write_file once you actually have the info IN THE USER'S OWN WORDS. Not inferred, not guessed, not assumed from system strings.
- Never call write_file with empty or placeholder arguments. If the fields would be blank, respond conversationally and gather info first — you will be prompted again next turn.
- USER.md content comes from the user's messages only — never copy session IDs, system identifiers, or made-up values into it.
- If the user's first message already contains enough info (name, language, timezone) — extract it and write immediately. Otherwise, ask naturally and write on a later turn.
---