Update Codex app-server bindings for 0.139.0

This commit is contained in:
murashit 2026-06-11 18:40:38 +09:00
parent 4f723d4784
commit fc7a5462a3
30 changed files with 125 additions and 32 deletions

View file

@ -73,7 +73,7 @@ Codex Panel acts as a local Obsidian client for Codex App Server:
| Key | Version | Policy |
| ------------------------ | --------- | ---------------------------------------------------------- |
| `obsidian.minAppVersion` | `1.12.0` | Track the latest patch for this Obsidian minor. |
| `codex.testedCliVersion` | `0.137.0` | Track app-server compatibility by Codex CLI minor version. |
| `codex.testedCliVersion` | `0.139.0` | Track app-server compatibility by Codex CLI minor version. |
Codex Panel depends on the experimental `codex app-server` API.

View file

@ -96,6 +96,7 @@ export function messageThreadId(message: ServerNotification | ServerRequest): st
case "item/reasoning/summaryTextDelta":
case "item/reasoning/summaryPartAdded":
case "item/reasoning/textDelta":
case "turn/moderationMetadata":
case "thread/compacted":
case "model/rerouted":
case "model/verification":
@ -121,7 +122,6 @@ export function messageThreadId(message: ServerNotification | ServerRequest): st
case "process/outputDelta":
case "process/exited":
case "mcpServer/oauthLogin/completed":
case "mcpServer/startupStatus/updated":
case "account/updated":
case "account/rateLimits/updated":
case "app/list/updated":
@ -140,6 +140,8 @@ export function messageThreadId(message: ServerNotification | ServerRequest): st
case "applyPatchApproval":
case "execCommandApproval":
return null;
case "mcpServer/startupStatus/updated":
return message.params.threadId ?? null;
}
}
@ -170,6 +172,7 @@ export function messageTurnId(message: ServerNotification | ServerRequest): stri
case "item/reasoning/summaryTextDelta":
case "item/reasoning/summaryPartAdded":
case "item/reasoning/textDelta":
case "turn/moderationMetadata":
case "thread/compacted":
case "model/rerouted":
case "model/verification":

View file

@ -7,7 +7,7 @@ import {
} from "../../../app-server/runtime-policy";
import type { ThreadSettingsUpdate } from "../../../app-server/thread-settings";
import type { CollaborationMode } from "./turn-settings";
import type { ReasoningEffort } from "../../../domain/catalog/metadata";
import { normalizeReasoningEffort, type ReasoningEffort } from "../../../domain/catalog/metadata";
import {
resetRuntimeSettingToConfig,
setPendingRuntimeSetting,
@ -106,7 +106,10 @@ export function commitPendingThreadSettingsRuntimeState(state: ChatRuntimeState,
...state,
...("model" in update ? { activeModel: update.model ?? null, requestedModel: unchangedRuntimeSetting<string>() } : {}),
...("effort" in update
? { activeReasoningEffort: update.effort ?? null, requestedReasoningEffort: unchangedRuntimeSetting<ReasoningEffort>() }
? {
activeReasoningEffort: normalizeReasoningEffort(update.effort),
requestedReasoningEffort: unchangedRuntimeSetting<ReasoningEffort>(),
}
: {}),
...("serviceTier" in update
? { activeServiceTier: parseServiceTier(update.serviceTier), requestedServiceTier: unchangedRuntimeSetting<RequestedServiceTier>() }

View file

@ -2,7 +2,7 @@ import type { AppServerInitialization } from "../../../app-server/initialization
import type { Thread } from "../../../domain/threads/model";
import type { ThreadTokenUsage } from "../../../app-server/runtime-metrics";
import { parseServiceTier, type ServiceTier } from "../../../app-server/runtime-policy";
import type { ReasoningEffort } from "../../../domain/catalog/metadata";
import { normalizeReasoningEffort, type ReasoningEffort } from "../../../domain/catalog/metadata";
import type { ChatRuntimeState } from "../runtime/state";
import type { CollaborationMode } from "../runtime/turn-settings";
import type { DisplayItem } from "../display/types";
@ -38,7 +38,7 @@ export interface ActiveThreadSettingsAppliedAction {
export interface ActiveThreadSettingsAppliedActionSettings {
cwd: string;
model: string | null;
effort: ReasoningEffort | null;
effort: string | null;
collaborationMode: { mode: CollaborationMode };
serviceTier: string | null;
approvalPolicy: ChatRuntimeState["activeApprovalPolicy"];
@ -161,7 +161,7 @@ export function activeThreadSettingsAppliedAction(settings: ActiveThreadSettings
type: "active-thread/settings-applied",
cwd: settings.cwd,
model: settings.model,
reasoningEffort: settings.effort,
reasoningEffort: normalizeReasoningEffort(settings.effort),
collaborationMode: settings.collaborationMode.mode,
serviceTier: parseServiceTier(settings.serviceTier),
approvalPolicy: settings.approvalPolicy,

View file

@ -1,7 +1,7 @@
import { parseServiceTier, type ApprovalPolicy } from "../../../app-server/runtime-policy";
import { upsertThread } from "../../../domain/threads/model";
import { threadFromAppServerThread } from "../../../app-server/thread-model";
import type { ReasoningEffort } from "../../../domain/catalog/metadata";
import { normalizeReasoningEffort } from "../../../domain/catalog/metadata";
import type { Thread } from "../../../domain/threads/model";
import type { ThreadStartResponse } from "../../../generated/app-server/v2/ThreadStartResponse";
import type { ThreadResumeResponse } from "../../../generated/app-server/v2/ThreadResumeResponse";
@ -17,7 +17,7 @@ interface ThreadActivationResponse {
approvalPolicy: ApprovalPolicy | null;
approvalsReviewer: ChatRuntimeState["activeApprovalsReviewer"];
activePermissionProfile: ChatRuntimeState["activePermissionProfile"];
reasoningEffort: ReasoningEffort | null;
reasoningEffort: string | null;
}
export interface ResumedThreadActionParams {
@ -80,7 +80,7 @@ export function resumedThreadAction(params: ResumedThreadActionParams): ActiveTh
thread: response.thread,
cwd: response.cwd,
model: response.model,
reasoningEffort: response.reasoningEffort,
reasoningEffort: normalizeReasoningEffort(response.reasoningEffort),
serviceTier: parseServiceTier(response.serviceTier),
approvalPolicy: response.approvalPolicy,
approvalsReviewer: response.approvalsReviewer,

View file

@ -0,0 +1,5 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type AgentMessageInputContent = { "type": "encrypted_content", encrypted_content: string, };

View file

@ -5,4 +5,4 @@
/**
* Authentication mode for OpenAI-backed providers.
*/
export type AuthMode = "apikey" | "chatgpt" | "chatgptAuthTokens" | "agentIdentity";
export type AuthMode = "apikey" | "chatgpt" | "chatgptAuthTokens" | "agentIdentity" | "personalAccessToken";

File diff suppressed because one or more lines are too long

View file

@ -5,4 +5,4 @@
/**
* See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning
*/
export type ReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
export type ReasoningEffort = string;

View file

@ -1,6 +1,7 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AgentMessageInputContent } from "./AgentMessageInputContent";
import type { ContentItem } from "./ContentItem";
import type { FunctionCallOutputBody } from "./FunctionCallOutputBody";
import type { LocalShellAction } from "./LocalShellAction";
@ -10,7 +11,7 @@ import type { ReasoningItemContent } from "./ReasoningItemContent";
import type { ReasoningItemReasoningSummary } from "./ReasoningItemReasoningSummary";
import type { WebSearchAction } from "./WebSearchAction";
export type ResponseItem = { "type": "message", role: string, content: Array<ContentItem>, phase?: MessagePhase, } | { "type": "reasoning", summary: Array<ReasoningItemReasoningSummary>, content?: Array<ReasoningItemContent>, encrypted_content: string | null, } | { "type": "local_shell_call",
export type ResponseItem = { "type": "message", role: string, content: Array<ContentItem>, phase?: MessagePhase, } | { "type": "agent_message", author: string, recipient: string, content: Array<AgentMessageInputContent>, } | { "type": "reasoning", summary: Array<ReasoningItemReasoningSummary>, content?: Array<ReasoningItemContent>, encrypted_content: string | null, } | { "type": "local_shell_call",
/**
* Set when using the Responses API.
*/

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,7 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
export type { AbsolutePathBuf } from "./AbsolutePathBuf";
export type { AgentMessageInputContent } from "./AgentMessageInputContent";
export type { AgentPath } from "./AgentPath";
export type { ApplyPatchApprovalParams } from "./ApplyPatchApprovalParams";
export type { ApplyPatchApprovalResponse } from "./ApplyPatchApprovalResponse";

View file

@ -0,0 +1,5 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type AccountTokenUsageDailyBucket = { startDate: string, tokens: bigint, };

View file

@ -0,0 +1,5 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type AccountTokenUsageSummary = { lifetimeTokens: bigint | null, peakDailyTokens: bigint | null, longestRunningTurnSec: bigint | null, currentStreakDays: bigint | null, longestStreakDays: bigint | null, };

View file

@ -0,0 +1,6 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AppTemplateUnavailableReason } from "./AppTemplateUnavailableReason";
export type AppTemplateSummary = { templateId: string, name: string, description: string | null, canonicalConnectorId: string | null, logoUrl: string | null, logoUrlDark: string | null, materializedAppIds: Array<string>, reason: AppTemplateUnavailableReason | null, };

View file

@ -0,0 +1,5 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type AppTemplateUnavailableReason = "NOT_CONFIGURED_FOR_WORKSPACE" | "NO_ACTIVE_WORKSPACE";

View file

@ -11,4 +11,4 @@ import type { ResidencyRequirement } from "./ResidencyRequirement";
import type { SandboxMode } from "./SandboxMode";
import type { WindowsSandboxSetupMode } from "./WindowsSandboxSetupMode";
export type ConfigRequirements = { allowedApprovalPolicies: Array<AskForApproval> | null, allowedApprovalsReviewers: Array<ApprovalsReviewer> | null, allowedSandboxModes: Array<SandboxMode> | null, allowedWindowsSandboxImplementations: Array<WindowsSandboxSetupMode> | null, allowedPermissions: Array<string> | null, allowedWebSearchModes: Array<WebSearchMode> | null, allowManagedHooksOnly: boolean | null, allowAppshots: boolean | null, computerUse: ComputerUseRequirements | null, featureRequirements: { [key in string]?: boolean } | null, hooks: ManagedHooksRequirements | null, enforceResidency: ResidencyRequirement | null, network: NetworkRequirements | null, };
export type ConfigRequirements = { allowedApprovalPolicies: Array<AskForApproval> | null, allowedApprovalsReviewers: Array<ApprovalsReviewer> | null, allowedSandboxModes: Array<SandboxMode> | null, allowedWindowsSandboxImplementations: Array<WindowsSandboxSetupMode> | null, allowedPermissionProfiles: { [key in string]?: boolean } | null, defaultPermissions: string | null, allowedWebSearchModes: Array<WebSearchMode> | null, allowManagedHooksOnly: boolean | null, allowAppshots: boolean | null, computerUse: ComputerUseRequirements | null, featureRequirements: { [key in string]?: boolean } | null, hooks: ManagedHooksRequirements | null, enforceResidency: ResidencyRequirement | null, network: NetworkRequirements | null, };

View file

@ -0,0 +1,7 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AccountTokenUsageDailyBucket } from "./AccountTokenUsageDailyBucket";
import type { AccountTokenUsageSummary } from "./AccountTokenUsageSummary";
export type GetAccountTokenUsageResponse = { summary: AccountTokenUsageSummary, dailyUsageBuckets: Array<AccountTokenUsageDailyBucket> | null, };

View file

@ -3,4 +3,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { McpServerStartupState } from "./McpServerStartupState";
export type McpServerStatusUpdatedNotification = { name: string, status: McpServerStartupState, error: string | null, };
export type McpServerStatusUpdatedNotification = { threadId: string | null, name: string, status: McpServerStartupState, error: string | null, };

View file

@ -3,8 +3,9 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AbsolutePathBuf } from "../AbsolutePathBuf";
import type { AppSummary } from "./AppSummary";
import type { AppTemplateSummary } from "./AppTemplateSummary";
import type { PluginHookSummary } from "./PluginHookSummary";
import type { PluginSummary } from "./PluginSummary";
import type { SkillSummary } from "./SkillSummary";
export type PluginDetail = { marketplaceName: string, marketplacePath: AbsolutePathBuf | null, summary: PluginSummary, description: string | null, skills: Array<SkillSummary>, hooks: Array<PluginHookSummary>, apps: Array<AppSummary>, mcpServers: Array<string>, };
export type PluginDetail = { marketplaceName: string, marketplacePath: AbsolutePathBuf | null, summary: PluginSummary, description: string | null, skills: Array<SkillSummary>, hooks: Array<PluginHookSummary>, apps: Array<AppSummary>, appTemplates: Array<AppTemplateSummary>, mcpServers: Array<string>, };

View file

@ -0,0 +1,5 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type RemoteControlPairingStatusParams = { pairingCode?: string | null, manualPairingCode?: string | null, };

View file

@ -0,0 +1,5 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type RemoteControlPairingStatusResponse = { claimed: boolean, };

View file

@ -2,6 +2,7 @@
// This file was mechanically normalized after generation by scripts/generate-app-server-types.mjs.
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AbsolutePathBuf } from "../AbsolutePathBuf";
import type { JsonValue } from "../serde_json/JsonValue";
import type { ApprovalsReviewer } from "./ApprovalsReviewer";
import type { AskForApproval } from "./AskForApproval";
@ -29,10 +30,9 @@ path?: string | null,
*/
model?: string | null, modelProvider?: string | null, serviceTier?: string | null, cwd?: string | null,
/**
* Replace the thread's runtime workspace roots. Relative paths are
* resolved against the effective cwd for the thread.
* Replace the thread's runtime workspace roots. Paths must be absolute.
*/
runtimeWorkspaceRoots?: Array<string> | null, approvalPolicy?: AskForApproval | null,
runtimeWorkspaceRoots?: Array<AbsolutePathBuf> | null, approvalPolicy?: AskForApproval | null,
/**
* Override where approval requests are routed for review on this thread
* and subsequent turns.

View file

@ -2,6 +2,7 @@
// This file was mechanically normalized after generation by scripts/generate-app-server-types.mjs.
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AbsolutePathBuf } from "../AbsolutePathBuf";
import type { Personality } from "../Personality";
import type { ResponseItem } from "../ResponseItem";
import type { JsonValue } from "../serde_json/JsonValue";
@ -45,10 +46,9 @@ path?: string | null,
*/
model?: string | null, modelProvider?: string | null, serviceTier?: string | null, cwd?: string | null,
/**
* Replace the thread's runtime workspace roots. Relative paths are
* resolved against the effective cwd for the thread.
* Replace the thread's runtime workspace roots. Paths must be absolute.
*/
runtimeWorkspaceRoots?: Array<string> | null, approvalPolicy?: AskForApproval | null,
runtimeWorkspaceRoots?: Array<AbsolutePathBuf> | null, approvalPolicy?: AskForApproval | null,
/**
* Override where approval requests are routed for review on this thread
* and subsequent turns.

View file

@ -2,6 +2,7 @@
// This file was mechanically normalized after generation by scripts/generate-app-server-types.mjs.
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AbsolutePathBuf } from "../AbsolutePathBuf";
import type { Personality } from "../Personality";
import type { JsonValue } from "../serde_json/JsonValue";
import type { ApprovalsReviewer } from "./ApprovalsReviewer";
@ -14,10 +15,9 @@ import type { TurnEnvironmentParams } from "./TurnEnvironmentParams";
export type ThreadStartParams = { model?: string | null, modelProvider?: string | null, serviceTier?: string | null, cwd?: string | null,
/**
* Replace the thread's runtime workspace roots. Relative paths are
* resolved against the effective cwd for the thread.
* Replace the thread's runtime workspace roots. Paths must be absolute.
*/
runtimeWorkspaceRoots?: Array<string> | null, approvalPolicy?: AskForApproval | null,
runtimeWorkspaceRoots?: Array<AbsolutePathBuf> | null, approvalPolicy?: AskForApproval | null,
/**
* Override where approval requests are routed for review on this thread
* and subsequent turns.

View file

@ -0,0 +1,6 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { JsonValue } from "../serde_json/JsonValue";
export type TurnModerationMetadataNotification = { threadId: string, turnId: string, metadata: JsonValue, };

View file

@ -2,6 +2,7 @@
// This file was mechanically normalized after generation by scripts/generate-app-server-types.mjs.
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AbsolutePathBuf } from "../AbsolutePathBuf";
import type { CollaborationMode } from "../CollaborationMode";
import type { Personality } from "../Personality";
import type { ReasoningEffort } from "../ReasoningEffort";
@ -24,7 +25,7 @@ responsesapiClientMetadata?: { [key in string]?: string } | null,
*/
additionalContext?: { [key in string]?: AdditionalContextEntry } | null,
/**
* Optional turn-scoped environments.
* Optional environments for this turn and subsequent turns.
*
* Omitted uses the thread sticky environments. Empty disables
* environment access for this turn. Non-empty selects the first
@ -37,10 +38,9 @@ environments?: Array<TurnEnvironmentParams> | null,
cwd?: string | null,
/**
* Replace the thread's runtime workspace roots for this turn and
* subsequent turns. Relative paths are resolved against the effective
* cwd for the turn.
* subsequent turns. Paths must be absolute.
*/
runtimeWorkspaceRoots?: Array<string> | null,
runtimeWorkspaceRoots?: Array<AbsolutePathBuf> | null,
/**
* Override the approval policy for this turn and subsequent turns.
*/

View file

@ -3,6 +3,8 @@
export type { Account } from "./Account";
export type { AccountLoginCompletedNotification } from "./AccountLoginCompletedNotification";
export type { AccountRateLimitsUpdatedNotification } from "./AccountRateLimitsUpdatedNotification";
export type { AccountTokenUsageDailyBucket } from "./AccountTokenUsageDailyBucket";
export type { AccountTokenUsageSummary } from "./AccountTokenUsageSummary";
export type { AccountUpdatedNotification } from "./AccountUpdatedNotification";
export type { ActivePermissionProfile } from "./ActivePermissionProfile";
export type { AddCreditsNudgeCreditType } from "./AddCreditsNudgeCreditType";
@ -21,6 +23,8 @@ export type { AppMetadata } from "./AppMetadata";
export type { AppReview } from "./AppReview";
export type { AppScreenshot } from "./AppScreenshot";
export type { AppSummary } from "./AppSummary";
export type { AppTemplateSummary } from "./AppTemplateSummary";
export type { AppTemplateUnavailableReason } from "./AppTemplateUnavailableReason";
export type { AppToolApproval } from "./AppToolApproval";
export type { AppToolsConfig } from "./AppToolsConfig";
export type { ApprovalsReviewer } from "./ApprovalsReviewer";
@ -143,6 +147,7 @@ export type { FsWriteFileResponse } from "./FsWriteFileResponse";
export type { GetAccountParams } from "./GetAccountParams";
export type { GetAccountRateLimitsResponse } from "./GetAccountRateLimitsResponse";
export type { GetAccountResponse } from "./GetAccountResponse";
export type { GetAccountTokenUsageResponse } from "./GetAccountTokenUsageResponse";
export type { GitInfo } from "./GitInfo";
export type { GrantedPermissionProfile } from "./GrantedPermissionProfile";
export type { GuardianApprovalReview } from "./GuardianApprovalReview";
@ -344,6 +349,8 @@ export type { RemoteControlDisableResponse } from "./RemoteControlDisableRespons
export type { RemoteControlEnableResponse } from "./RemoteControlEnableResponse";
export type { RemoteControlPairingStartParams } from "./RemoteControlPairingStartParams";
export type { RemoteControlPairingStartResponse } from "./RemoteControlPairingStartResponse";
export type { RemoteControlPairingStatusParams } from "./RemoteControlPairingStatusParams";
export type { RemoteControlPairingStatusResponse } from "./RemoteControlPairingStatusResponse";
export type { RemoteControlStatusChangedNotification } from "./RemoteControlStatusChangedNotification";
export type { RemoteControlStatusReadResponse } from "./RemoteControlStatusReadResponse";
export type { RequestPermissionProfile } from "./RequestPermissionProfile";
@ -497,6 +504,7 @@ export type { TurnError } from "./TurnError";
export type { TurnInterruptParams } from "./TurnInterruptParams";
export type { TurnInterruptResponse } from "./TurnInterruptResponse";
export type { TurnItemsView } from "./TurnItemsView";
export type { TurnModerationMetadataNotification } from "./TurnModerationMetadataNotification";
export type { TurnPlanStep } from "./TurnPlanStep";
export type { TurnPlanStepStatus } from "./TurnPlanStepStatus";
export type { TurnPlanUpdatedNotification } from "./TurnPlanUpdatedNotification";

View file

@ -676,6 +676,7 @@ describe("ChatInboundController", () => {
controller.handleNotification({
method: "mcpServer/startupStatus/updated",
params: {
threadId: null,
name: "github",
status: "failed",
error: "missing token",

View file

@ -141,6 +141,16 @@ describe("chat inbound routing", () => {
);
expect(routeServerNotification(rawResponseItemCompletedNotification("thread-other", "turn-active"), activeScope).kind).toBe("inactive");
expect(routeServerNotification(rawResponseItemCompletedNotification("thread-active", "turn-other"), activeScope).kind).toBe("inactive");
expect(routeServerNotification(turnModerationMetadataNotification("thread-active", "turn-active"), activeScope).kind).toBe("unhandled");
expect(routeServerNotification(turnModerationMetadataNotification("thread-other", "turn-active"), activeScope).kind).toBe("inactive");
expect(routeServerNotification(turnModerationMetadataNotification("thread-active", "turn-other"), activeScope).kind).toBe("inactive");
});
it("scopes MCP startup status notifications when app-server provides a thread id", () => {
expect(messageThreadId(mcpStartupStatusNotificationForThread("thread-active"))).toBe("thread-active");
expect(routeServerNotification(mcpStartupStatusNotificationForThread("thread-active"), activeScope).kind).toBe("diagnosticStatus");
expect(routeServerNotification(mcpStartupStatusNotificationForThread("thread-other"), activeScope).kind).toBe("inactive");
});
});
@ -276,9 +286,23 @@ function serverRequestResolvedNotification(): ServerNotification {
}
function mcpStartupStatusNotification(): ServerNotification {
return mcpStartupStatusNotificationForThread(null);
}
function mcpStartupStatusNotificationForThread(threadId: string | null): ServerNotification {
return {
method: "mcpServer/startupStatus/updated",
params: { name: "github", status: "failed", error: "missing token" },
params: { threadId, name: "github", status: "failed", error: "missing token" },
};
}
function turnModerationMetadataNotification(
threadId: string,
turnId: string,
): Extract<ServerNotification, { method: "turn/moderationMetadata" }> {
return {
method: "turn/moderationMetadata",
params: { threadId, turnId, metadata: { blocked: false } },
};
}