Remove unused Codex protocol registries and session APIs

This commit is contained in:
Ian Gulliver
2026-10-22 10:38:02 -07:00
parent 406f67a1a0
commit 8fb27f98a2
3 changed files with 110 additions and 223 deletions
+101 -160
View File
@@ -11,8 +11,6 @@ const (
MethodThreadStart = "thread/start"
MethodThreadResume = "thread/resume"
MethodThreadFork = "thread/fork"
MethodThreadCompactStart = "thread/compact/start"
MethodThreadRead = "thread/read"
MethodTurnStart = "turn/start"
MethodTurnSteer = "turn/steer"
MethodTurnInterrupt = "turn/interrupt"
@@ -115,133 +113,92 @@ const (
MethodExecCommandApproval = "execCommandApproval"
)
var clientResults = map[string]func() any{
MethodInitialize: func() any { return &InitializeResponse{} },
MethodThreadStart: func() any { return &ThreadStartResponse{} },
MethodThreadResume: func() any { return &ThreadResumeResponse{} },
MethodThreadFork: func() any { return &ThreadForkResponse{} },
MethodThreadCompactStart: func() any { return &ThreadCompactStartResponse{} },
MethodThreadRead: func() any { return &ThreadReadResponse{} },
MethodTurnStart: func() any { return &TurnStartResponse{} },
MethodTurnSteer: func() any { return &TurnSteerResponse{} },
MethodTurnInterrupt: func() any { return &TurnInterruptResponse{} },
MethodAccountRateLimitsRead: func() any { return &GetAccountRateLimitsResponse{} },
}
var notificationParams = map[string]func() any{
MethodError: func() any { return &ErrorNotification{} },
MethodThreadStarted: func() any { return &ThreadStartedNotification{} },
MethodThreadStatusChanged: func() any { return &ThreadStatusChangedNotification{} },
MethodThreadReadStateChanged: func() any { return &ThreadReadStateChangedNotification{} },
MethodThreadArchived: func() any { return &ThreadArchivedNotification{} },
MethodThreadDeleted: func() any { return &ThreadDeletedNotification{} },
MethodThreadUnarchived: func() any { return &ThreadUnarchivedNotification{} },
MethodThreadClosed: func() any { return &ThreadClosedNotification{} },
MethodThreadReverted: func() any { return &ThreadRevertedNotification{} },
MethodSkillsChanged: func() any { return &SkillsChangedNotification{} },
MethodThreadNameUpdated: func() any { return &ThreadNameUpdatedNotification{} },
MethodThreadAttachmentUpdated: func() any { return &ThreadAttachmentUpdatedNotification{} },
MethodThreadGoalUpdated: func() any { return &ThreadGoalUpdatedNotification{} },
MethodThreadPredictionUpdated: func() any { return &ThreadPredictionUpdatedNotification{} },
MethodThreadGoalCleared: func() any { return &ThreadGoalClearedNotification{} },
MethodThreadQueueChanged: func() any { return &ThreadQueueChangedNotification{} },
MethodProjectChanged: func() any { return &ProjectChangedNotification{} },
MethodThreadProjectUpdated: func() any { return &ThreadProjectUpdatedNotification{} },
MethodThreadEnvironmentConnected: func() any { return &EnvironmentConnectionNotification{} },
MethodThreadEnvironmentDisconnected: func() any { return &EnvironmentConnectionNotification{} },
MethodThreadSettingsUpdated: func() any { return &ThreadSettingsUpdatedNotification{} },
MethodThreadTokenUsageUpdated: func() any { return &ThreadTokenUsageUpdatedNotification{} },
MethodTurnStarted: func() any { return &TurnStartedNotification{} },
MethodHookStarted: func() any { return &HookStartedNotification{} },
MethodTurnCompleted: func() any { return &TurnCompletedNotification{} },
MethodHookCompleted: func() any { return &HookCompletedNotification{} },
MethodTurnDiffUpdated: func() any { return &TurnDiffUpdatedNotification{} },
MethodTurnPlanUpdated: func() any { return &TurnPlanUpdatedNotification{} },
MethodItemStarted: func() any { return &ItemStartedNotification{} },
MethodItemAutoApprovalReviewStarted: func() any { return &ItemGuardianApprovalReviewStartedNotification{} },
MethodItemAutoApprovalReviewCompleted: func() any { return &ItemGuardianApprovalReviewCompletedNotification{} },
MethodAutoApprovalReviewStrictReviewRequired: func() any { return &StrictReviewRequiredNotification{} },
MethodItemCompleted: func() any { return &ItemCompletedNotification{} },
MethodItemAgentMessageDelta: func() any { return &AgentMessageDeltaNotification{} },
MethodItemPlanDelta: func() any { return &PlanDeltaNotification{} },
MethodCommandExecOutputDelta: func() any { return &CommandExecOutputDeltaNotification{} },
MethodProcessOutputDelta: func() any { return &ProcessOutputDeltaNotification{} },
MethodProcessExited: func() any { return &ProcessExitedNotification{} },
MethodItemCommandExecutionOutputDelta: func() any { return &CommandExecutionOutputDeltaNotification{} },
MethodItemCommandExecutionTerminalInteraction: func() any { return &TerminalInteractionNotification{} },
MethodItemFileChangeOutputDelta: func() any { return &FileChangeOutputDeltaNotification{} },
MethodItemFileChangePatchUpdated: func() any { return &FileChangePatchUpdatedNotification{} },
MethodServerRequestResolved: func() any { return &ServerRequestResolvedNotification{} },
MethodItemMcpToolCallProgress: func() any { return &McpToolCallProgressNotification{} },
MethodMcpServerOauthLoginCompleted: func() any { return &McpServerOauthLoginCompletedNotification{} },
MethodMcpServerStartupStatusUpdated: func() any { return &McpServerStatusUpdatedNotification{} },
MethodMcpServerEventStreamNotification: func() any { return &McpServerEventStreamNotification{} },
MethodAccountUpdated: func() any { return &AccountUpdatedNotification{} },
MethodAccountGatewayOAuthChanged: func() any { return &GatewayOAuthChangedNotification{} },
MethodAccountRateLimitsUpdated: func() any { return &AccountRateLimitsUpdatedNotification{} },
MethodAppListUpdated: func() any { return &AppListUpdatedNotification{} },
MethodRemoteControlStatusChanged: func() any { return &RemoteControlStatusChangedNotification{} },
MethodExternalAgentConfigImportProgress: func() any { return &ExternalAgentConfigImportProgressNotification{} },
MethodExternalAgentConfigImportCompleted: func() any { return &ExternalAgentConfigImportCompletedNotification{} },
MethodFsChanged: func() any { return &FsChangedNotification{} },
MethodItemReasoningSummaryTextDelta: func() any { return &ReasoningSummaryTextDeltaNotification{} },
MethodItemReasoningSummaryPartAdded: func() any { return &ReasoningSummaryPartAddedNotification{} },
MethodItemReasoningTextDelta: func() any { return &ReasoningTextDeltaNotification{} },
MethodThreadCompacted: func() any { return &ContextCompactedNotification{} },
MethodModelRerouted: func() any { return &ModelReroutedNotification{} },
MethodModelVerification: func() any { return &ModelVerificationNotification{} },
MethodModelProviderAuthRecoveryStarted: func() any { return &AuthRecoveryNotification{} },
MethodModelProviderAuthRecoveryCompleted: func() any { return &AuthRecoveryNotification{} },
MethodTurnModerationMetadata: func() any { return &TurnModerationMetadataNotification{} },
MethodModelSafetyBufferingUpdated: func() any { return &ModelSafetyBufferingUpdatedNotification{} },
MethodWarning: func() any { return &WarningNotification{} },
MethodGuardianWarning: func() any { return &GuardianWarningNotification{} },
MethodDeprecationNotice: func() any { return &DeprecationNoticeNotification{} },
MethodConfigWarning: func() any { return &ConfigWarningNotification{} },
MethodFuzzyFileSearchSessionUpdated: func() any { return &FuzzyFileSearchSessionUpdatedNotification{} },
MethodFuzzyFileSearchSessionCompleted: func() any { return &FuzzyFileSearchSessionCompletedNotification{} },
MethodThreadRealtimeStarted: func() any { return &ThreadRealtimeStartedNotification{} },
MethodThreadRealtimeItemAdded: func() any { return &ThreadRealtimeItemAddedNotification{} },
MethodThreadRealtimeItemStarted: func() any { return &ThreadRealtimeItemStartedNotification{} },
MethodThreadRealtimeItemTranscriptDelta: func() any { return &ThreadRealtimeItemTranscriptDeltaNotification{} },
MethodThreadRealtimeItemCompleted: func() any { return &ThreadRealtimeItemCompletedNotification{} },
MethodThreadRealtimeTranscriptDelta: func() any { return &ThreadRealtimeTranscriptDeltaNotification{} },
MethodThreadRealtimeTranscriptDone: func() any { return &ThreadRealtimeTranscriptDoneNotification{} },
MethodThreadRealtimeOutputAudioDelta: func() any { return &ThreadRealtimeOutputAudioDeltaNotification{} },
MethodThreadRealtimeSdp: func() any { return &ThreadRealtimeSdpNotification{} },
MethodThreadRealtimeError: func() any { return &ThreadRealtimeErrorNotification{} },
MethodThreadRealtimeClosed: func() any { return &ThreadRealtimeClosedNotification{} },
MethodWindowsWorldWritableWarning: func() any { return &WindowsWorldWritableWarningNotification{} },
MethodWindowsSandboxSetupCompleted: func() any { return &WindowsSandboxSetupCompletedNotification{} },
MethodAccountLoginCompleted: func() any { return &AccountLoginCompletedNotification{} },
}
var serverRequestParams = map[string]func() any{
MethodItemCommandExecutionRequestApproval: func() any { return &CommandExecutionRequestApprovalParams{} },
MethodItemFileChangeRequestApproval: func() any { return &FileChangeRequestApprovalParams{} },
MethodItemToolRequestUserInput: func() any { return &ToolRequestUserInputParams{} },
MethodMcpServerElicitationRequest: func() any { return &McpServerElicitationRequestParams{} },
MethodItemPermissionsRequestApproval: func() any { return &PermissionsRequestApprovalParams{} },
MethodItemToolCall: func() any { return &DynamicToolCallParams{} },
MethodAccountChatgptAuthTokensRefresh: func() any { return &ChatgptAuthTokensRefreshParams{} },
MethodAttestationGenerate: func() any { return &AttestationGenerateParams{} },
MethodCurrentTimeRead: func() any { return &CurrentTimeReadParams{} },
MethodApplyPatchApproval: func() any { return &ApplyPatchApprovalParams{} },
MethodExecCommandApproval: func() any { return &ExecCommandApprovalParams{} },
}
var serverRequestResponses = map[string]func() any{
MethodItemCommandExecutionRequestApproval: func() any { return &CommandExecutionRequestApprovalResponse{} },
MethodItemFileChangeRequestApproval: func() any { return &FileChangeRequestApprovalResponse{} },
MethodItemToolRequestUserInput: func() any { return &ToolRequestUserInputResponse{} },
MethodMcpServerElicitationRequest: func() any { return &McpServerElicitationRequestResponse{} },
MethodItemPermissionsRequestApproval: func() any { return &PermissionsRequestApprovalResponse{} },
MethodItemToolCall: func() any { return &DynamicToolCallResponse{} },
MethodAccountChatgptAuthTokensRefresh: func() any { return &ChatgptAuthTokensRefreshResponse{} },
MethodAttestationGenerate: func() any { return &AttestationGenerateResponse{} },
MethodCurrentTimeRead: func() any { return &CurrentTimeReadResponse{} },
MethodApplyPatchApproval: func() any { return &ApplyPatchApprovalResponse{} },
MethodExecCommandApproval: func() any { return &ExecCommandApprovalResponse{} },
var notificationMethods = map[string]struct{}{
MethodError: {},
MethodThreadStarted: {},
MethodThreadStatusChanged: {},
MethodThreadReadStateChanged: {},
MethodThreadArchived: {},
MethodThreadDeleted: {},
MethodThreadUnarchived: {},
MethodThreadClosed: {},
MethodThreadReverted: {},
MethodSkillsChanged: {},
MethodThreadNameUpdated: {},
MethodThreadAttachmentUpdated: {},
MethodThreadGoalUpdated: {},
MethodThreadPredictionUpdated: {},
MethodThreadGoalCleared: {},
MethodThreadQueueChanged: {},
MethodProjectChanged: {},
MethodThreadProjectUpdated: {},
MethodThreadEnvironmentConnected: {},
MethodThreadEnvironmentDisconnected: {},
MethodThreadSettingsUpdated: {},
MethodThreadTokenUsageUpdated: {},
MethodTurnStarted: {},
MethodHookStarted: {},
MethodTurnCompleted: {},
MethodHookCompleted: {},
MethodTurnDiffUpdated: {},
MethodTurnPlanUpdated: {},
MethodItemStarted: {},
MethodItemAutoApprovalReviewStarted: {},
MethodItemAutoApprovalReviewCompleted: {},
MethodAutoApprovalReviewStrictReviewRequired: {},
MethodItemCompleted: {},
MethodItemAgentMessageDelta: {},
MethodItemPlanDelta: {},
MethodCommandExecOutputDelta: {},
MethodProcessOutputDelta: {},
MethodProcessExited: {},
MethodItemCommandExecutionOutputDelta: {},
MethodItemCommandExecutionTerminalInteraction: {},
MethodItemFileChangeOutputDelta: {},
MethodItemFileChangePatchUpdated: {},
MethodServerRequestResolved: {},
MethodItemMcpToolCallProgress: {},
MethodMcpServerOauthLoginCompleted: {},
MethodMcpServerStartupStatusUpdated: {},
MethodMcpServerEventStreamNotification: {},
MethodAccountUpdated: {},
MethodAccountGatewayOAuthChanged: {},
MethodAccountRateLimitsUpdated: {},
MethodAppListUpdated: {},
MethodRemoteControlStatusChanged: {},
MethodExternalAgentConfigImportProgress: {},
MethodExternalAgentConfigImportCompleted: {},
MethodFsChanged: {},
MethodItemReasoningSummaryTextDelta: {},
MethodItemReasoningSummaryPartAdded: {},
MethodItemReasoningTextDelta: {},
MethodThreadCompacted: {},
MethodModelRerouted: {},
MethodModelVerification: {},
MethodModelProviderAuthRecoveryStarted: {},
MethodModelProviderAuthRecoveryCompleted: {},
MethodTurnModerationMetadata: {},
MethodModelSafetyBufferingUpdated: {},
MethodWarning: {},
MethodGuardianWarning: {},
MethodDeprecationNotice: {},
MethodConfigWarning: {},
MethodFuzzyFileSearchSessionUpdated: {},
MethodFuzzyFileSearchSessionCompleted: {},
MethodThreadRealtimeStarted: {},
MethodThreadRealtimeItemAdded: {},
MethodThreadRealtimeItemStarted: {},
MethodThreadRealtimeItemTranscriptDelta: {},
MethodThreadRealtimeItemCompleted: {},
MethodThreadRealtimeTranscriptDelta: {},
MethodThreadRealtimeTranscriptDone: {},
MethodThreadRealtimeOutputAudioDelta: {},
MethodThreadRealtimeSdp: {},
MethodThreadRealtimeError: {},
MethodThreadRealtimeClosed: {},
MethodWindowsWorldWritableWarning: {},
MethodWindowsSandboxSetupCompleted: {},
MethodAccountLoginCompleted: {},
}
const (
@@ -524,11 +481,6 @@ const (
ModeKindDefault ModeKind = "default"
)
const (
ThreadUnreadPositionTypeThreadStart = "threadStart"
ThreadUnreadPositionTypeTurn = "turn"
)
const (
AdditionalContextKindUntrusted AdditionalContextKind = "untrusted"
AdditionalContextKindApplication AdditionalContextKind = "application"
@@ -588,6 +540,11 @@ const (
RateLimitReachedTypeWorkspaceMemberUsageLimitReached RateLimitReachedType = "workspace_member_usage_limit_reached"
)
const (
ThreadUnreadPositionTypeThreadStart = "threadStart"
ThreadUnreadPositionTypeTurn = "turn"
)
const (
ThreadAttachmentOperationCreated ThreadAttachmentOperation = "created"
ThreadAttachmentOperationDeleted ThreadAttachmentOperation = "deleted"
@@ -1562,32 +1519,6 @@ type ThreadForkResponse struct {
Thread Thread `json:"thread"`
}
type ThreadCompactStartParams struct {
ThreadID string `json:"threadId"`
}
type ThreadCompactStartResponse = map[string]any
type ThreadReadParams struct {
IncludeTurns bool `json:"includeTurns,omitempty"`
ThreadID string `json:"threadId"`
}
type ThreadUnreadPosition struct {
TurnID string `json:"turnId,omitempty"`
Type string `json:"type"`
}
type ThreadReadState struct {
FirstUnread *ThreadUnreadPosition `json:"firstUnread,omitempty"`
Revision string `json:"revision"`
}
type ThreadReadResponse struct {
ReadState *ThreadReadState `json:"readState,omitempty"`
Thread Thread `json:"thread"`
}
type AdditionalContextKind string
type AdditionalContextEntry struct {
@@ -1745,6 +1676,16 @@ type ThreadStatusChangedNotification struct {
ThreadID string `json:"threadId"`
}
type ThreadUnreadPosition struct {
TurnID string `json:"turnId,omitempty"`
Type string `json:"type"`
}
type ThreadReadState struct {
FirstUnread *ThreadUnreadPosition `json:"firstUnread,omitempty"`
Revision string `json:"revision"`
}
type ThreadReadStateChangedNotification struct {
ReadState ThreadReadState `json:"readState"`
ThreadID string `json:"threadId"`