fix(coding-agent): address PR review feedback (#4924)

Op: remove the unrelated sendUserMessage changelog entry and replace the aborted-turn test cast with a typed assistant fixture.

Restores: PR #4924 carries only the autolearn changelog bullet and its regression test no longer relies on as-never type hacks.
This commit is contained in:
metaphorics
2026-07-09 23:37:15 +09:00
parent dac54080d2
commit 81c4cb6df5
2 changed files with 19 additions and 8 deletions
-1
View File
@@ -4,7 +4,6 @@
### Fixed
- Fixed extension `sendUserMessage` throwing `Agent is already processing…` while the agent is streaming: without `deliverAs`, busy messages now queue as a steer. ACP/RPC skill invocations pass `streamingBehavior: "steer"` so they can land mid-turn the same way TUI skill commands do.
- Fixed autolearn auto-continue firing a capture turn after an aborted stop (Esc/cancel): the controller now skips any `agent_end` whose last assistant message has `stopReason: "aborted"`.
## [16.3.12] - 2026-07-08
@@ -1,5 +1,6 @@
import { describe, expect, it } from "bun:test";
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
import type { AssistantMessage } from "@oh-my-pi/pi-ai";
import { AutoLearnController, buildAutoLearnInstructions } from "@oh-my-pi/pi-coding-agent/autolearn/controller";
import { Settings } from "@oh-my-pi/pi-coding-agent/config/settings";
import type { AgentSession, AgentSessionEvent } from "@oh-my-pi/pi-coding-agent/session/agent-session";
@@ -254,13 +255,24 @@ describe("AutoLearnController", () => {
const session = new FakeSession();
install(session, { "autolearn.autoContinue": true });
session.toolCalls(5);
session.agentEnd([
{
role: "assistant",
content: [{ type: "text", text: "partial" }],
stopReason: "aborted",
} as never,
]);
const abortedMessage: AssistantMessage = {
role: "assistant",
content: [{ type: "text", text: "partial" }],
api: "anthropic-messages",
provider: "anthropic",
model: "mock",
usage: {
input: 0,
output: 0,
cacheRead: 0,
cacheWrite: 0,
totalTokens: 0,
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
},
stopReason: "aborted",
timestamp: Date.now(),
};
session.agentEnd([abortedMessage]);
expect(session.sent).toHaveLength(0);
});
});