Agent resolves an ambiguous case identifier by recent-context bias instead of the literal exact match, then executes on the wrong target

Open 💬 1 comment Opened Jun 29, 2026 by Mig-Sornrakrit

Summary

When a user refers to an item by a short identifier that has two valid, namespaced interpretations, the agent resolved it using recent-conversation bias instead of the literal identifier match — then executed a consequential, visible action on the wrong target. The agent even self-confirmed its wrong choice ("driving X now …") before the user caught it. The user had to stop and correct the target.

This is a recurring failure shape: an explicit, exact-match identifier supplied by the user is overridden by what the session was "recently about."

What happened (abstracted)

Two related items exist with distinct IDs in different namespaces:

  • a base item: X-03
  • a derived variant: DX-03
  1. Earlier in the session, work was focused on the derived variant.
  2. The user said, in effect: "run/verify case x03."
  3. Expected resolution: X-03 (the literal exact match) — or, if genuinely ambiguous, ask which one.
  4. Actual: the agent mapped x03 → the derived variant DX-03 (because that's what the session had recently been about), announced it was proceeding, and launched a consequential action on DX-03.
  5. User: "I ordered X-03 … what did you run?" — only then did the agent run the correct X-03.

Why this is a problem

  • A literal token the user typed exactly matched one item, yet the agent chose the other item on the basis of recent topic priming.
  • The agent treated its own inference as authoritative and acted (an irreversible/visible launch) before verifying the resolved target against the user's literal token.
  • Its self-confirmation message ("proceeding with …") masked the misread rather than surfacing it.
  • Net effect: wasted cycle, the user must continuously police target selection, and trust that "if I name it explicitly, it will be honored" is eroded.

Suggested behavior

  1. When a short identifier has more than one valid resolution, prefer the literal exact match; if still ambiguous, ask — do not silently infer from recent context.
  2. Before executing a consequential or hard-to-reverse action keyed off an identifier, echo the fully-resolved target and confirm it matches the user's literal token.
  3. Do not let recent-topic bias override an explicit exact-match identifier.
  4. Treat "I'm proceeding with X" as a point to verify the target, not as license to skip verification.

Environment

  • Claude Code 2.1.177
  • The task involved two near-identical, separately-namespaced variants of the same function (a base form and a derived form); only the base was named, but the derived form was driven.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗