Skip to content

emrg: the batch-call reminder is the daemon instruction, so it is a system message #2693

Closed

Description

@argszero

What happens today

A round that dispatches exactly one tool call is reminded at the tail of the next request, so the rule "a round may carry several tool calls" sits where the next round's calls are decided instead of only in the system prompt. The reminder is appended as

{"role": "user", "content": "batch call"}

(_with_batch_call_nudge, emrg/server/daemon.py:730).

A user turn is the host's voice. It is the role a client renders as the host's bubble, the role a transcript attributes to the host, and the role a compaction summarises as something the host said. This reminder is the daemon's own instruction to the model, so a user role tells every one of those readers that the host said something the host never typed. The host reported exactly that on 2026-11-03, after seeing a session in which batch call appeared as a message of its own.

The records that made it visible read {"type": "message", "role": "user", "content": "batch call"} in the deepnest-opensource-task session history (lines 225 and 342 of history_261103.jsonl), each landing 0.8 ms after a one-call round's tool_result and with no task received line in the daemon log — so the host did not type them. The mechanism in this repository never writes the reminder to session history; what those two records show is what a user-role reminder looks like the moment anything persists it.

What is wanted

The reminder is a system message:

{"role": "system", "content": "batch call"}

Measured on 2026-11-03 against the configured provider (https://atp-dev.shenbiai.net/v1, model deepseek-flash): a {"role": "system"} entry placed after the user turn is accepted, and a request carrying one answers normally.

Acceptance

# Requirement
1 A round whose tool-call count is exactly 1 → the next request's last entry is {"role": "system", "content": "batch call"}
2 No user-role entry is appended in its place: the request carries exactly one entry beyond the loop's own list, and its role is system
3 A round with 0 tool calls, or with 2 or more, appends nothing
4 Still request-only: nothing in session history, nothing in a rebuilt request, and the loop's own list is never written to

How this is checked

tests/test_batch_call_nudge.py reads the messages the provider was handed, captured where the stream is consumed, so the role is asserted where it is actually sent rather than in the shape of the code that built it. The expectations in that file move with this change; no new guard is added.

Handled by #2694

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions