mirror of
https://github.com/murashit/codex-panel.git
synced 2026-07-22 06:57:10 +00:00
Normalize file change execution state
This commit is contained in:
parent
379ce709c4
commit
3547898077
2 changed files with 19 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import type { MessageStreamFileChange, MessageStreamItem } from "../../../domain/message-stream/items";
|
||||
import { patchApplyExecutionState } from "../../../domain/message-stream/execution-state";
|
||||
|
||||
export interface AppServerFileChange {
|
||||
readonly path: string;
|
||||
|
|
@ -30,6 +31,7 @@ export function streamingFileChangeMessageStreamItem(
|
|||
sourceItemId: itemId,
|
||||
provenance: { source: "appServer", channel: "notification", event: "streamingDelta", sourceItemId: itemId },
|
||||
status,
|
||||
executionState: patchApplyExecutionState(status),
|
||||
changes,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { streamingFileChangeMessageStreamItem } from "../../../../src/features/chat/app-server/mappers/message-stream/file-changes";
|
||||
import { messageStreamItemFromTurnItem } from "../../../../src/features/chat/app-server/mappers/message-stream/turn-items";
|
||||
import { messageStreamReasoningIsActive } from "../../../../src/features/chat/domain/message-stream/semantics/active-turn";
|
||||
import { messageStreamSemanticClassifications } from "../../../../src/features/chat/domain/message-stream/semantics/classify";
|
||||
|
|
@ -91,6 +92,22 @@ describe("message stream semantic classification", () => {
|
|||
]);
|
||||
});
|
||||
|
||||
it("classifies streaming file change patch status as lifecycle state", () => {
|
||||
const [semantic] = messageStreamSemanticClassifications([
|
||||
streamingFileChangeMessageStreamItem(
|
||||
"patch",
|
||||
"turn",
|
||||
[{ kind: "update", path: "src/main.ts", diff: "@@\n-old\n+new" }],
|
||||
"inProgress",
|
||||
),
|
||||
]);
|
||||
|
||||
expect(semantic).toMatchObject({
|
||||
meaning: { plane: "workspace", event: "result" },
|
||||
lifecycle: { state: "running" },
|
||||
});
|
||||
});
|
||||
|
||||
it("classifies thread and interaction events by meaning", () => {
|
||||
const semantic = messageStreamSemanticClassifications([
|
||||
{ id: "goal", kind: "goal", role: "tool", text: "set: Ship it", action: "set" },
|
||||
|
|
|
|||
Loading…
Reference in a new issue