eca icon indicating copy to clipboard operation
eca copied to clipboard

Native commands (e.g. /sync-system-prompt) aren't intercepted when sent via steering input

Open stig opened this issue 2 months ago • 0 comments

Description

Native commands (defined in src/eca/features/commands.clj, :type :native) are correctly intercepted and handled without invoking the LLM when submitted as a normal chat message. However, when the same command text is submitted via the steering input path (injecting text into an in-progress agent turn, per eca-chat.el's "Steering: ..." UI), the command is not intercepted — it's forwarded to the model as literal chat text instead.

This means the model receives /sync-system-prompt as ordinary input, has no way to recognize it as a valid command (it's not in the skill/tool catalog available to the model), and responds with a confused "I don't recognize this command" message — while the command may still be processed correctly afterward via the client/protocol layer, leading to duplicated/contradictory behavior in the same turn.

Steps to reproduce

  1. Start a chat and begin a task that takes several tool calls (so the agent is mid-turn).
  2. While the agent is working, submit /sync-system-prompt via the steering input (i.e. as an interrupt/injection rather than a fresh message).
  3. Observe the model's response — it does not recognize the command and asks for clarification.
  4. Submit /sync-system-prompt again as a normal new message (not via steering).
  5. Observe it is now handled correctly and silently (bare confirmation, no LLM turn).

Expected behavior

Native commands should be intercepted consistently regardless of whether they're submitted as a fresh prompt or as steering input. The model should never see raw native-command text as part of its context.

Actual behavior

Steering-path submissions of native commands bypass command dispatch and are forwarded to the model as plain chat content.

Evidence from a real session

/sync-system-prompt

Thought 4s

I don't recognize `/sync-system-prompt` — it's not among the skills or tools
available to me in this session [skills list redacted].

If this is an editor/client-level command rather than something for me to
act on, it may not route through here. Could you clarify what you'd like...
/sync-system-prompt


System prompt will be re-synced on the next message (prompt cache invalidated).
continue.

Note the second invocation (sent normally, not via steering) produced only the bare confirmation with no model turn at all — confirming the command dispatch logic works correctly on that path.

Environment

  • ECA server: 0.160.2
  • Client: eca-emacs, GNU Emacs 30.2 (aarch64-apple-darwin25.6.0)
  • OS: Mac OS X 26.7
  • Java: 25.0.4

Possible root cause

The steering-input send path (client-side, eca-emacs) may not run submitted text through the same slash-command recognition that the normal prompt-submission path uses, or the server's steering-message handler may not route through f.commands/handle-command! the way the main message handler does. Not sure which side owns the fix — flagging here first since native command definitions live in this repo.

stig avatar Sep 16 '26 13:09 stig