fix(session): stop training the model to parrot [Message Time: ...]

Past assistant turns in history were prefixed with "[Message Time: ...]"
just like user turns. The model treated these as in-context demos and
started prefixing its own replies with the same marker, leaking
metadata to the user. Prompt-level warnings could not beat dozens of
prior assistant samples.

Annotate only user turns and proactive deliveries
(_channel_delivery=True, i.e. cron / heartbeat pushes whose timing is
the whole point and which are too infrequent to act as demos). Adjacent
user-side timestamps still pin every normal assistant reply for
relative-time reasoning. The now-redundant identity.md warning is
removed along with the demonstration source.
This commit is contained in:
Xubin Ren
2026-04-27 07:11:20 +00:00
parent 620d9e4f31
commit 311a7fe36e
5 changed files with 72 additions and 16 deletions
+4 -3
View File
@@ -188,14 +188,15 @@ def test_identity_has_no_behavioral_instructions(tmp_path) -> None:
assert "Execution Rules" not in identity
def test_system_prompt_treats_message_time_as_metadata(tmp_path) -> None:
def test_system_prompt_does_not_warn_about_message_time_markers(tmp_path) -> None:
"""Parroting is prevented by not annotating assistant turns in history;
no prompt-level warning about ``[Message Time: ...]`` is needed."""
workspace = _make_workspace(tmp_path)
builder = ContextBuilder(workspace)
prompt = builder.build_system_prompt()
assert "Historical messages may include `[Message Time: ...]` prefixes" in prompt
assert "never quote, copy, or include those markers" in prompt
assert "Message Time" not in prompt
def test_default_soul_template_contains_execution_rules() -> None: