Archived
fix(sessions): stop duplicating user message for slash commands
A slash command sent as the first (or any idle) message showed the raw command text twice until reload: once from the client's optimistic insert and once from the server's message.append echo, neither of which converges with the agent's canonical expanded message (e.g. a /skill:* block). Make commands obey the same source-of-truth contract as prompts: - client no longer inserts the raw command text optimistically; it shows the existing per-session sending indicator instead - forwarded runtime/skill commands return a bare done result rather than a synthetic "Accepted ..." line - server suppresses the raw message.append echo for command-forwarded prompts (threaded through the compaction queue too) Result: pre-reload state matches reload, with no transient duplicate.
This commit is contained in:
@@ -80,8 +80,12 @@ export class SessionCommandService<TSession extends CommandSession = CommandSess
|
||||
|
||||
if (!isBuiltinCommand(name)) {
|
||||
if (this.isRuntimeCommand(session, name)) {
|
||||
// The command is forwarded to the agent, which expands it (e.g. /skill:*
|
||||
// into a skill block) and streams the canonical message back. That is the
|
||||
// authoritative feedback, so we don't synthesize an extra "Accepted" line
|
||||
// that would only vanish on reload.
|
||||
await this.prompt(sessionId, text);
|
||||
return { type: "done", message: `Accepted ${text}` };
|
||||
return { type: "done" };
|
||||
}
|
||||
return { type: "unsupported", message: `Unknown command: /${name}` };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user