test(server): make fetch and ACP expectations match supported Git and timeline behavior

Newer Git also creates origin/HEAD on the first fetch, so assert the authenticated branch result without excluding that valid additional ref. Main now qualifies ACP timeline identities by chunk kind while preserving the native messageId; update the plugin round-trip test to check that contract.
This commit is contained in:
paseo-bot[bot]
2026-10-27 10:23:44 +00:00
parent a7575127c2
commit 6f040f93b5
2 changed files with 7 additions and 4 deletions
@@ -651,7 +651,8 @@ lines.on("line", (line) => {
type: "timeline.item",
item: expect.objectContaining({
type: "assistant_message",
id: "assistant-1",
id: JSON.stringify(["agent_message_chunk", "assistant-1"]),
messageId: "assistant-1",
text: "ACP says hi",
}),
}),
@@ -233,9 +233,11 @@ test.skipIf(process.platform === "win32")(
const result = await fetchWorkspaceGitRemote(cwd, { onRefSnapshot() {} }, run);
expect(result.error).toBeNull();
expect(result.changes).toEqual([
{ kind: "added", ref: "origin/main", afterOid: expectedOid },
]);
expect(result.changes).toContainEqual({
kind: "added",
ref: "origin/main",
afterOid: expectedOid,
});
expect((await run(["rev-parse", "refs/remotes/origin/main"], { cwd })).stdout.trim()).toBe(
expectedOid,
);