mirror of
https://github.com/murashit/codex-panel.git
synced 2026-07-22 06:57:10 +00:00
Remove deprecated app-server compatibility consumers
This commit is contained in:
parent
57cab74ecf
commit
4d138a3f9b
19 changed files with 7 additions and 50 deletions
|
|
@ -9,7 +9,6 @@ export interface CatalogModel {
|
|||
supportedReasoningEfforts: readonly { reasoningEffort: string; description: string }[];
|
||||
defaultReasoningEffort: string | null;
|
||||
inputModalities: readonly string[];
|
||||
additionalSpeedTiers: readonly string[];
|
||||
serviceTiers: readonly { id: string; name: string }[];
|
||||
defaultServiceTier: string | null;
|
||||
isDefault: boolean;
|
||||
|
|
@ -62,7 +61,6 @@ function modelMetadataFromCatalogModel(model: CatalogModel): ModelMetadata {
|
|||
})),
|
||||
defaultReasoningEffort: model.defaultReasoningEffort,
|
||||
inputModalities: [...model.inputModalities],
|
||||
additionalSpeedTiers: [...model.additionalSpeedTiers],
|
||||
serviceTiers: model.serviceTiers.map((tier) => ({ id: tier.id, name: tier.name })),
|
||||
defaultServiceTier: model.defaultServiceTier,
|
||||
isDefault: model.isDefault,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ export function cloneModelMetadata(models: readonly ModelMetadata[]): ModelMetad
|
|||
supportedReasoningEfforts: [...model.supportedReasoningEfforts],
|
||||
...(model.reasoningEffortOptions ? { reasoningEffortOptions: model.reasoningEffortOptions.map((option) => ({ ...option })) } : {}),
|
||||
inputModalities: [...model.inputModalities],
|
||||
additionalSpeedTiers: [...model.additionalSpeedTiers],
|
||||
serviceTiers: model.serviceTiers.map((tier) => ({ ...tier })),
|
||||
}));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ export interface ModelMetadata {
|
|||
readonly reasoningEffortOptions?: readonly ReasoningEffortMetadata[];
|
||||
readonly defaultReasoningEffort: string | null;
|
||||
readonly inputModalities: readonly string[];
|
||||
readonly additionalSpeedTiers: readonly string[];
|
||||
readonly serviceTiers: readonly ModelServiceTier[];
|
||||
readonly defaultServiceTier: string | null;
|
||||
readonly isDefault: boolean;
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ export type ServerNotificationRoute =
|
|||
| { kind: "unhandled"; notification: ServerNotification }
|
||||
| { kind: "inactive"; notification: ServerNotification };
|
||||
|
||||
type ServerNotificationScopeExtractors = {
|
||||
type ServerNotificationScopeExtractors = Partial<{
|
||||
[Method in ServerNotificationMethod]: (notification: Extract<ServerNotification, { method: Method }>) => AppServerRouteScope;
|
||||
};
|
||||
}>;
|
||||
|
||||
const GLOBALLY_ROUTED_THREAD_CATALOG_NOTIFICATION_METHODS = [
|
||||
"thread/started",
|
||||
|
|
@ -50,7 +50,6 @@ const STREAM_UPDATE_NOTIFICATION_METHODS = [
|
|||
"item/completed",
|
||||
"item/commandExecution/outputDelta",
|
||||
"item/fileChange/patchUpdated",
|
||||
"item/fileChange/outputDelta",
|
||||
"turn/diff/updated",
|
||||
"hook/started",
|
||||
"hook/completed",
|
||||
|
|
@ -91,7 +90,6 @@ const DIAGNOSTIC_STATUS_NOTIFICATION_METHODS = [
|
|||
type DiagnosticStatusNotificationMethod = (typeof DIAGNOSTIC_STATUS_NOTIFICATION_METHODS)[number];
|
||||
|
||||
const USER_VISIBLE_NOTICE_NOTIFICATION_METHODS = [
|
||||
"thread/compacted",
|
||||
"model/rerouted",
|
||||
"deprecationNotice",
|
||||
"error",
|
||||
|
|
@ -166,7 +164,6 @@ const SERVER_NOTIFICATION_SCOPE_EXTRACTORS: ServerNotificationScopeExtractors =
|
|||
"process/exited": unscopedNotificationScope,
|
||||
"item/commandExecution/outputDelta": threadTurnNotificationScope,
|
||||
"item/commandExecution/terminalInteraction": threadTurnNotificationScope,
|
||||
"item/fileChange/outputDelta": threadTurnNotificationScope,
|
||||
"item/fileChange/patchUpdated": threadTurnNotificationScope,
|
||||
"serverRequest/resolved": threadOnlyNotificationScope,
|
||||
"item/mcpToolCall/progress": threadTurnNotificationScope,
|
||||
|
|
@ -182,7 +179,6 @@ const SERVER_NOTIFICATION_SCOPE_EXTRACTORS: ServerNotificationScopeExtractors =
|
|||
"item/reasoning/summaryTextDelta": threadTurnNotificationScope,
|
||||
"item/reasoning/summaryPartAdded": threadTurnNotificationScope,
|
||||
"item/reasoning/textDelta": threadTurnNotificationScope,
|
||||
"thread/compacted": threadTurnNotificationScope,
|
||||
"model/rerouted": threadTurnNotificationScope,
|
||||
"model/verification": threadTurnNotificationScope,
|
||||
"turn/moderationMetadata": threadTurnNotificationScope,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
import type { ServerNotification } from "../../../../app-server/connection/rpc-messages";
|
||||
import { jsonPreview } from "../../../../domain/display/json-preview";
|
||||
import type { TurnRuntimeEvent } from "../../application/turns/runtime-events";
|
||||
import {
|
||||
STREAMED_COMMAND_RUNNING_TEXT,
|
||||
STREAMED_FILE_CHANGE_IN_PROGRESS_TEXT,
|
||||
STREAMED_MCP_PROGRESS_LABEL,
|
||||
} from "../../domain/thread-stream/factories/streaming-items";
|
||||
import { STREAMED_COMMAND_RUNNING_TEXT, STREAMED_MCP_PROGRESS_LABEL } from "../../domain/thread-stream/factories/streaming-items";
|
||||
import { createSystemItem } from "../../domain/thread-stream/factories/system-items";
|
||||
import type { ThreadStreamItem } from "../../domain/thread-stream/items";
|
||||
import { type AppServerFileChange, normalizeFileChanges, streamingFileChangeThreadStreamItem } from "../mappers/thread-stream/file-changes";
|
||||
|
|
@ -21,8 +17,6 @@ import {
|
|||
} from "../mappers/thread-stream/turn-items";
|
||||
import type { StreamUpdateNotification, TurnLifecycleNotification, UserVisibleNoticeNotification } from "./notification-routing";
|
||||
|
||||
const MESSAGE_CONTEXT_COMPACTED = "Context compacted.";
|
||||
|
||||
type RuntimeEventSource =
|
||||
| StreamUpdateNotification
|
||||
| TurnLifecycleNotification
|
||||
|
|
@ -105,17 +99,6 @@ export function turnRuntimeEventsFromNotification(
|
|||
item: fileChangeItem(notification.params.itemId, notification.params.turnId, notification.params.changes, "inProgress"),
|
||||
},
|
||||
];
|
||||
case "item/fileChange/outputDelta":
|
||||
return [
|
||||
{
|
||||
type: "itemOutputDelta",
|
||||
itemId: notification.params.itemId,
|
||||
turnId: notification.params.turnId,
|
||||
delta: notification.params.delta,
|
||||
kind: "fileChange",
|
||||
fallbackText: STREAMED_FILE_CHANGE_IN_PROGRESS_TEXT,
|
||||
},
|
||||
];
|
||||
case "turn/diff/updated":
|
||||
return [{ type: "turnDiffUpdated", turnId: notification.params.turnId, diff: notification.params.diff }];
|
||||
case "hook/started":
|
||||
|
|
@ -159,8 +142,6 @@ export function turnRuntimeEventsFromNotification(
|
|||
];
|
||||
case "serverRequest/resolved":
|
||||
return [{ type: "requestResolved", requestId: notification.params.requestId }];
|
||||
case "thread/compacted":
|
||||
return [{ type: "systemNotice", item: createSystemItem(localItemId("system"), MESSAGE_CONTEXT_COMPACTED) }];
|
||||
case "model/rerouted":
|
||||
case "deprecationNotice":
|
||||
case "error":
|
||||
|
|
@ -198,10 +179,7 @@ function hookRunEvents(
|
|||
return item ? [{ type: "hookRunObserved", item, turnId, eventName: run.eventName }] : [];
|
||||
}
|
||||
|
||||
function jsonNoticeEvent(
|
||||
notification: Extract<UserVisibleNoticeNotification, { method: Exclude<UserVisibleNoticeNotification["method"], "thread/compacted"> }>,
|
||||
localItemId: (prefix: string) => string,
|
||||
): TurnRuntimeEvent {
|
||||
function jsonNoticeEvent(notification: UserVisibleNoticeNotification, localItemId: (prefix: string) => string): TurnRuntimeEvent {
|
||||
return {
|
||||
type: "systemNotice",
|
||||
item: createSystemItem(localItemId("system"), `${notification.method}: ${jsonPreview(notification.params)}`),
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { RUNNING_EXECUTION_STATE } from "../execution-state";
|
|||
import type { ThreadStreamItem, ThreadStreamItemKind } from "../items";
|
||||
|
||||
export const STREAMED_COMMAND_RUNNING_TEXT = "Command running";
|
||||
export const STREAMED_FILE_CHANGE_IN_PROGRESS_TEXT = "File change inProgress";
|
||||
export const STREAMED_MCP_PROGRESS_LABEL = "mcp progress";
|
||||
const UNKNOWN_STREAMED_COMMAND_CWD = "(unknown)";
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ describe("app-server catalog mappers", () => {
|
|||
],
|
||||
defaultReasoningEffort: "high",
|
||||
inputModalities: ["text"],
|
||||
additionalSpeedTiers: ["fast"],
|
||||
serviceTiers: [{ id: "priority", name: "Fast" }],
|
||||
defaultServiceTier: "priority",
|
||||
isDefault: true,
|
||||
|
|
@ -263,7 +262,7 @@ function modelFixture(overrides: Partial<Model> = {}): Model {
|
|||
defaultReasoningEffort: "high",
|
||||
inputModalities: ["text"],
|
||||
supportsPersonality: false,
|
||||
additionalSpeedTiers: ["fast"],
|
||||
additionalSpeedTiers: [],
|
||||
serviceTiers: [{ id: "priority", name: "Fast", description: "Fast tier" }],
|
||||
defaultServiceTier: "priority",
|
||||
isDefault: true,
|
||||
|
|
|
|||
|
|
@ -622,7 +622,6 @@ function catalogModel(model: string): CatalogModel {
|
|||
supportedReasoningEfforts: [],
|
||||
defaultReasoningEffort: "medium",
|
||||
inputModalities: ["text"],
|
||||
additionalSpeedTiers: [],
|
||||
serviceTiers: [],
|
||||
defaultServiceTier: null,
|
||||
isDefault: false,
|
||||
|
|
|
|||
|
|
@ -186,7 +186,6 @@ function model(modelId: string): ModelMetadata {
|
|||
supportedReasoningEfforts: [],
|
||||
defaultReasoningEffort: null,
|
||||
inputModalities: [],
|
||||
additionalSpeedTiers: [],
|
||||
serviceTiers: [],
|
||||
defaultServiceTier: null,
|
||||
isDefault: false,
|
||||
|
|
|
|||
|
|
@ -13,12 +13,12 @@ type NotificationRouteKind = ReturnType<typeof routeServerNotification>["kind"];
|
|||
type RequestRouteKind = ReturnType<typeof routeServerRequest>["kind"];
|
||||
|
||||
describe("chat inbound routing", () => {
|
||||
it("keeps generated app-server notifications explicitly routed or ignored", () => {
|
||||
it("leaves only deprecated generated app-server notifications unhandled", () => {
|
||||
const unhandled = generatedServerNotificationMethods().filter(
|
||||
(method) => routeServerNotification(notificationFixture(method), activeScope).kind === "unhandled",
|
||||
);
|
||||
|
||||
expect(unhandled).toEqual([]);
|
||||
expect(unhandled).toEqual(["item/fileChange/outputDelta", "thread/compacted"]);
|
||||
});
|
||||
|
||||
it("keeps routed notification methods covered by matching planners", () => {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ function model(name: string, efforts: ReasoningEffort[], overrides: Partial<Mode
|
|||
supportedReasoningEfforts: efforts,
|
||||
defaultReasoningEffort: efforts[0] ?? "medium",
|
||||
inputModalities: ["text"],
|
||||
additionalSpeedTiers: [],
|
||||
serviceTiers: [],
|
||||
defaultServiceTier: null,
|
||||
isDefault: false,
|
||||
|
|
|
|||
|
|
@ -521,7 +521,6 @@ function modelFixture(model: string, fastTierId: string): ModelMetadata {
|
|||
supportedReasoningEfforts: [],
|
||||
defaultReasoningEffort: "medium",
|
||||
inputModalities: [],
|
||||
additionalSpeedTiers: ["fast"],
|
||||
serviceTiers: [{ id: fastTierId, name: "Fast" }],
|
||||
defaultServiceTier: null,
|
||||
isDefault: true,
|
||||
|
|
|
|||
|
|
@ -398,7 +398,6 @@ describe("ChatPanelSessionRuntime actions", () => {
|
|||
supportedReasoningEfforts: [],
|
||||
defaultReasoningEffort: null,
|
||||
inputModalities: [],
|
||||
additionalSpeedTiers: [],
|
||||
serviceTiers: [],
|
||||
defaultServiceTier: null,
|
||||
isDefault: false,
|
||||
|
|
|
|||
|
|
@ -224,7 +224,6 @@ function modelFixture(model: string): ModelMetadata {
|
|||
supportedReasoningEfforts: ["high"],
|
||||
defaultReasoningEffort: "high",
|
||||
inputModalities: [],
|
||||
additionalSpeedTiers: [],
|
||||
serviceTiers: [],
|
||||
defaultServiceTier: null,
|
||||
isDefault: true,
|
||||
|
|
|
|||
|
|
@ -618,7 +618,6 @@ function modelFixture(model: string, fastTierId?: string): ModelMetadata {
|
|||
supportedReasoningEfforts: ["high"],
|
||||
defaultReasoningEffort: "high",
|
||||
inputModalities: [],
|
||||
additionalSpeedTiers: fastTierId ? ["fast"] : [],
|
||||
serviceTiers: fastTierId ? [{ id: fastTierId, name: "Fast" }] : [],
|
||||
defaultServiceTier: null,
|
||||
isDefault: true,
|
||||
|
|
|
|||
|
|
@ -1004,7 +1004,6 @@ function modelMetadata(name: string, efforts: ReasoningEffort[]): ModelMetadata
|
|||
supportedReasoningEfforts: efforts,
|
||||
defaultReasoningEffort: efforts[0] ?? "low",
|
||||
inputModalities: ["text"],
|
||||
additionalSpeedTiers: [],
|
||||
serviceTiers: [],
|
||||
defaultServiceTier: null,
|
||||
isDefault: false,
|
||||
|
|
|
|||
|
|
@ -1142,7 +1142,6 @@ function modelFixture(model: string): ModelMetadata {
|
|||
supportedReasoningEfforts: [],
|
||||
defaultReasoningEffort: "medium",
|
||||
inputModalities: [],
|
||||
additionalSpeedTiers: [],
|
||||
serviceTiers: [],
|
||||
defaultServiceTier: null,
|
||||
isDefault: false,
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ function fastMode(serviceTier: string | null, serviceTiers: ModelMetadata["servi
|
|||
supportedReasoningEfforts: [],
|
||||
defaultReasoningEffort: null,
|
||||
inputModalities: [],
|
||||
additionalSpeedTiers: [],
|
||||
serviceTiers,
|
||||
defaultServiceTier: null,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1037,7 +1037,6 @@ function model(modelId: string, isDefault = false, hidden = false, efforts: Reas
|
|||
defaultReasoningEffort: "medium",
|
||||
inputModalities: ["text"],
|
||||
supportsPersonality: false,
|
||||
additionalSpeedTiers: [],
|
||||
serviceTiers: [],
|
||||
defaultServiceTier: null,
|
||||
} satisfies CatalogModel;
|
||||
|
|
|
|||
Loading…
Reference in a new issue