omp packages

@rakshazi/phantom-user0.1.0

Stop the model from answering user messages nobody sent

rakshazi Published 4 days ago LGPL-3.0-or-later ~0 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

phantom-user: stop the model from answering messages nobody sent

Install with pi install npm:@rakshazi/phantom-user.

Some reasoning models open a turn by restating the request: The user says: "...". Pi sends that reasoning back on every later request, so the transcript fills with examples of a turn that starts by quoting the user. After a tool result, where no user spoke, the model follows the pattern anyway and invents the quote. Then it acts on it.

Each invented quote becomes one more example, so they multiply through a session.

What it does

  • Every request: reasoning blocks that open by quoting the user are left out of what the model gets back. The session file keeps them; only the outgoing request changes.
  • Every turn end: when a reply to tool results alone opens with such a quote, a warning shows the invented line, so the tool calls of that turn get a second look.

Measured by replaying one long session, 30 times per arm at two points: the plain request produced an invented user quote in 4 and 11 of 30 replies, the guarded one in 0 and 0.

What counts as quoting the user

The first reasoning block of an assistant message starts with The user, followed within 40 characters by a colon or a double quote:

Reasoning opens with Verdict
The user says: "make the header purple" quote, left out
The user (in German): "nein, lila" quote, left out
The user asks: drop the header entirely. quote, left out
The user wants a cleaner layout, so the grid goes first. kept, no colon or quote in reach
The user's repo is at: /srv/site. kept, a sentence about the user
Rendered. Let me view it. kept

Honest restatements of a real message are left out too. They are the first examples the pattern grows from, and the request loses nothing: the real message is still in the transcript.

When the warning fires

Only when nobody spoke. A quote is treated as real, and stays silent, when:

  • a user message or an extension's custom message sits between the last tool result and the reply (steering, a subagent notice);
  • one of the tool results came from ask_user_question, since that result is the user's answer;
  • the quote opens right after the attribution (The user says: "...") and its text appears word for word in an earlier user message or in those tool results. A quote further into the sentence, a file name say, vouches for nothing.

The check reads the session branch, so it judges what was really said and ignores anything another extension added to the request.

Limits

  • Only unsigned reasoning is touched, the kind stored as reasoning_content, reasoning or reasoning_text. Signed reasoning from providers that verify it is left alone.
  • The match is one English phrase shape. Reasoning that invents a request without starting on The user passes.
  • The warning comes after the turn's tool calls were issued, so it reports and blocks nothing.
  • An unquoted honest recall in the middle of a tool loop (The user asked: fix the lint first, The user wants three fixes: lint, tests, docs) cannot be checked against the transcript, so it warns.
  • It fails open: an error inside the extension sends the request untouched.