Codex 0.163 notifications byre doesn't know

This commit is contained in:
Ian Gulliver
2026-10-17 15:39:20 -07:00
parent 5188b33522
commit 67578352ce
3 changed files with 84 additions and 35 deletions
-3
View File
@@ -1,8 +1,5 @@
# Bugs # Bugs
- Codex 0.163 notifications byre doesn't know
The service's codex is 0.163.0, and its app-server sends `thread/readState/changed`, which `internal/codex` rejects as `unrecognised method` (a `protocol_errors` entry in `/api/admin/status`). Regenerate the types with `go generate ./internal/codex` against the installed CLI and handle or ignore the new methods.
# M1 — One agent end to end # M1 — One agent end to end
- Cancel a queued message - Cancel a queued message
+1 -1
View File
@@ -43,7 +43,7 @@ Closing stdin ends the process.
- `turn/started`, `turn/completed` (`turn.status` `completed`, `interrupted` or `failed` with `turn.error`). A failed request to the model also sends an `error` notification first, with `willRetry`. - `turn/started`, `turn/completed` (`turn.status` `completed`, `interrupted` or `failed` with `turn.error`). A failed request to the model also sends an `error` notification first, with `willRetry`.
- `item/started` and `item/completed` with a `ThreadItem`: `userMessage`, `agentMessage` (`text`), `reasoning`, `commandExecution` (`command`, `aggregatedOutput`, `exitCode`), `fileChange`, `mcpToolCall`, `contextCompaction` and others. - `item/started` and `item/completed` with a `ThreadItem`: `userMessage`, `agentMessage` (`text`), `reasoning`, `commandExecution` (`command`, `aggregatedOutput`, `exitCode`), `fileChange`, `mcpToolCall`, `contextCompaction` and others.
- `item/agentMessage/delta` (`itemId`, `delta`) streams an agent message; the deltas join to the completed item's `text`. `item/commandExecution/outputDelta` and the reasoning deltas stream the same way. - `item/agentMessage/delta` (`itemId`, `delta`) streams an agent message; the deltas join to the completed item's `text`. `item/commandExecution/outputDelta` and the reasoning deltas stream the same way.
- `thread/tokenUsage/updated` carries `last` and `total` token counts and `modelContextWindow`; `account/rateLimits/updated` the account's rate-limit windows (the same snapshot `account/rateLimits/read` returns on request, as `rateLimits`); `thread/status/changed`, `mcpServer/startupStatus/updated`, `account/updated` and `remoteControl/status/changed` also arrive. - `thread/tokenUsage/updated` carries `last` and `total` token counts and `modelContextWindow`; `account/rateLimits/updated` the account's rate-limit windows (the same snapshot `account/rateLimits/read` returns on request, as `rateLimits`); `thread/status/changed`, `thread/readState/changed`, `mcpServer/startupStatus/updated`, `account/updated` and `remoteControl/status/changed` also arrive.
- Lines that aren't a JSON object, don't parse, or carry a notification method outside `notificationParams` go to `Options.OnBadLine`; parsed notifications are still delivered as events. `Event.Decode` returns the notification's generated params type. - Lines that aren't a JSON object, don't parse, or carry a notification method outside `notificationParams` go to `Options.OnBadLine`; parsed notifications are still delivered as events. `Event.Decode` returns the notification's generated params type.
Besides `item/tool/call`, server requests (approvals, user input) shouldn't arrive with approvals off; if one does, command and file-change approvals are accepted and anything else gets a JSON-RPC error. Besides `item/tool/call`, server requests (approvals, user input) shouldn't arrive with approvals off; if one does, command and file-change approvals are accepted and anything else gets a JSON-RPC error.
+54 -2
View File
@@ -1,10 +1,10 @@
// Code generated by go run ./gen from the codex-cli 0.159.0 app-server schema. DO NOT EDIT. // Code generated by go run ./gen from the codex-cli 0.163.0 app-server schema. DO NOT EDIT.
package codex package codex
import "encoding/json" import "encoding/json"
const SchemaVersion = "codex-cli 0.159.0" const SchemaVersion = "codex-cli 0.163.0"
const ( const (
MethodInitialize = "initialize" MethodInitialize = "initialize"
@@ -20,6 +20,7 @@ const (
MethodError = "error" MethodError = "error"
MethodThreadStarted = "thread/started" MethodThreadStarted = "thread/started"
MethodThreadStatusChanged = "thread/status/changed" MethodThreadStatusChanged = "thread/status/changed"
MethodThreadReadStateChanged = "thread/readState/changed"
MethodThreadArchived = "thread/archived" MethodThreadArchived = "thread/archived"
MethodThreadDeleted = "thread/deleted" MethodThreadDeleted = "thread/deleted"
MethodThreadUnarchived = "thread/unarchived" MethodThreadUnarchived = "thread/unarchived"
@@ -29,6 +30,7 @@ const (
MethodThreadNameUpdated = "thread/name/updated" MethodThreadNameUpdated = "thread/name/updated"
MethodThreadAttachmentUpdated = "thread/attachment/updated" MethodThreadAttachmentUpdated = "thread/attachment/updated"
MethodThreadGoalUpdated = "thread/goal/updated" MethodThreadGoalUpdated = "thread/goal/updated"
MethodThreadPredictionUpdated = "thread/prediction/updated"
MethodThreadGoalCleared = "thread/goal/cleared" MethodThreadGoalCleared = "thread/goal/cleared"
MethodThreadQueueChanged = "thread/queue/changed" MethodThreadQueueChanged = "thread/queue/changed"
MethodProjectChanged = "project/changed" MethodProjectChanged = "project/changed"
@@ -130,6 +132,7 @@ var notificationParams = map[string]func() any{
MethodError: func() any { return &ErrorNotification{} }, MethodError: func() any { return &ErrorNotification{} },
MethodThreadStarted: func() any { return &ThreadStartedNotification{} }, MethodThreadStarted: func() any { return &ThreadStartedNotification{} },
MethodThreadStatusChanged: func() any { return &ThreadStatusChangedNotification{} }, MethodThreadStatusChanged: func() any { return &ThreadStatusChangedNotification{} },
MethodThreadReadStateChanged: func() any { return &ThreadReadStateChangedNotification{} },
MethodThreadArchived: func() any { return &ThreadArchivedNotification{} }, MethodThreadArchived: func() any { return &ThreadArchivedNotification{} },
MethodThreadDeleted: func() any { return &ThreadDeletedNotification{} }, MethodThreadDeleted: func() any { return &ThreadDeletedNotification{} },
MethodThreadUnarchived: func() any { return &ThreadUnarchivedNotification{} }, MethodThreadUnarchived: func() any { return &ThreadUnarchivedNotification{} },
@@ -139,6 +142,7 @@ var notificationParams = map[string]func() any{
MethodThreadNameUpdated: func() any { return &ThreadNameUpdatedNotification{} }, MethodThreadNameUpdated: func() any { return &ThreadNameUpdatedNotification{} },
MethodThreadAttachmentUpdated: func() any { return &ThreadAttachmentUpdatedNotification{} }, MethodThreadAttachmentUpdated: func() any { return &ThreadAttachmentUpdatedNotification{} },
MethodThreadGoalUpdated: func() any { return &ThreadGoalUpdatedNotification{} }, MethodThreadGoalUpdated: func() any { return &ThreadGoalUpdatedNotification{} },
MethodThreadPredictionUpdated: func() any { return &ThreadPredictionUpdatedNotification{} },
MethodThreadGoalCleared: func() any { return &ThreadGoalClearedNotification{} }, MethodThreadGoalCleared: func() any { return &ThreadGoalClearedNotification{} },
MethodThreadQueueChanged: func() any { return &ThreadQueueChangedNotification{} }, MethodThreadQueueChanged: func() any { return &ThreadQueueChangedNotification{} },
MethodProjectChanged: func() any { return &ProjectChangedNotification{} }, MethodProjectChanged: func() any { return &ProjectChangedNotification{} },
@@ -368,6 +372,7 @@ const (
const ( const (
MessagePhaseCommentary MessagePhase = "commentary" MessagePhaseCommentary MessagePhase = "commentary"
MessagePhasePartialAnswer MessagePhase = "partial_answer"
MessagePhaseFinalAnswer MessagePhase = "final_answer" MessagePhaseFinalAnswer MessagePhase = "final_answer"
) )
@@ -489,6 +494,7 @@ const (
) )
const ( const (
ResponseItemTypeAdditionalTools = "additional_tools"
ResponseItemTypeMessage = "message" ResponseItemTypeMessage = "message"
ResponseItemTypeAgentMessage = "agent_message" ResponseItemTypeAgentMessage = "agent_message"
ResponseItemTypeReasoning = "reasoning" ResponseItemTypeReasoning = "reasoning"
@@ -518,6 +524,11 @@ const (
ModeKindDefault ModeKind = "default" ModeKindDefault ModeKind = "default"
) )
const (
ThreadUnreadPositionTypeThreadStart = "threadStart"
ThreadUnreadPositionTypeTurn = "turn"
)
const ( const (
AdditionalContextKindUntrusted AdditionalContextKind = "untrusted" AdditionalContextKindUntrusted AdditionalContextKind = "untrusted"
AdditionalContextKindApplication AdditionalContextKind = "application" AdditionalContextKindApplication AdditionalContextKind = "application"
@@ -591,6 +602,11 @@ const (
ThreadGoalStatusComplete ThreadGoalStatus = "complete" ThreadGoalStatusComplete ThreadGoalStatus = "complete"
) )
const (
ThreadPredictionResultTypeCompleted = "completed"
ThreadPredictionResultTypeFailed = "failed"
)
const ( const (
ProjectChangeTypeCreated ProjectChangeType = "created" ProjectChangeTypeCreated ProjectChangeType = "created"
ProjectChangeTypeUpdated ProjectChangeType = "updated" ProjectChangeTypeUpdated ProjectChangeType = "updated"
@@ -1079,6 +1095,7 @@ type MisalignmentSteer struct {
type MisalignmentErrorDetails struct { type MisalignmentErrorDetails struct {
DetailedExplanation string `json:"detailedExplanation,omitempty"` DetailedExplanation string `json:"detailedExplanation,omitempty"`
ErrorType string `json:"errorType,omitempty"` ErrorType string `json:"errorType,omitempty"`
ReviewTarget string `json:"reviewTarget,omitempty"`
Steer *MisalignmentSteer `json:"steer,omitempty"` Steer *MisalignmentSteer `json:"steer,omitempty"`
} }
@@ -1297,6 +1314,7 @@ type Turn struct {
ID string `json:"id"` ID string `json:"id"`
Items []ThreadItem `json:"items"` Items []ThreadItem `json:"items"`
ItemsView TurnItemsView `json:"itemsView,omitempty"` ItemsView TurnItemsView `json:"itemsView,omitempty"`
RootTurnID string `json:"rootTurnId,omitempty"`
StartedAt int64 `json:"startedAt,omitempty"` StartedAt int64 `json:"startedAt,omitempty"`
Status TurnStatus `json:"status"` Status TurnStatus `json:"status"`
} }
@@ -1371,10 +1389,12 @@ type ResponsesApiWebSearchAction struct {
} }
type ContentItem struct { type ContentItem struct {
Annotations []json.RawMessage `json:"annotations,omitempty"`
AudioURL string `json:"audio_url,omitempty"` AudioURL string `json:"audio_url,omitempty"`
Detail ImageDetail `json:"detail,omitempty"` Detail ImageDetail `json:"detail,omitempty"`
FileID string `json:"file_id,omitempty"` FileID string `json:"file_id,omitempty"`
ImageURL string `json:"image_url,omitempty"` ImageURL string `json:"image_url,omitempty"`
Logprobs []json.RawMessage `json:"logprobs,omitempty"`
Text string `json:"text,omitempty"` Text string `json:"text,omitempty"`
Type string `json:"type"` Type string `json:"type"`
} }
@@ -1512,6 +1532,7 @@ type ThreadForkParams struct {
DeveloperInstructions string `json:"developerInstructions,omitempty"` DeveloperInstructions string `json:"developerInstructions,omitempty"`
Ephemeral bool `json:"ephemeral,omitempty"` Ephemeral bool `json:"ephemeral,omitempty"`
ExcludeTurns bool `json:"excludeTurns,omitempty"` ExcludeTurns bool `json:"excludeTurns,omitempty"`
ExperimentalPredictionMode bool `json:"experimentalPredictionMode,omitempty"`
LastTurnID string `json:"lastTurnId,omitempty"` LastTurnID string `json:"lastTurnId,omitempty"`
Model string `json:"model,omitempty"` Model string `json:"model,omitempty"`
ModelProvider string `json:"modelProvider,omitempty"` ModelProvider string `json:"modelProvider,omitempty"`
@@ -1552,7 +1573,18 @@ type ThreadReadParams struct {
ThreadID string `json:"threadId"` 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 { type ThreadReadResponse struct {
ReadState *ThreadReadState `json:"readState,omitempty"`
Thread Thread `json:"thread"` Thread Thread `json:"thread"`
} }
@@ -1571,6 +1603,7 @@ type TurnToolOutput struct {
Name string `json:"name"` Name string `json:"name"`
Namespace string `json:"namespace,omitempty"` Namespace string `json:"namespace,omitempty"`
Output FunctionCallOutputBody `json:"output"` Output FunctionCallOutputBody `json:"output"`
Retain bool `json:"retain,omitempty"`
} }
type TurnStartParams struct { type TurnStartParams struct {
@@ -1588,9 +1621,11 @@ type TurnStartParams struct {
Model string `json:"model,omitempty"` Model string `json:"model,omitempty"`
MultiAgentMode MultiAgentMode `json:"multiAgentMode,omitempty"` MultiAgentMode MultiAgentMode `json:"multiAgentMode,omitempty"`
OutputSchema json.RawMessage `json:"outputSchema,omitempty"` OutputSchema json.RawMessage `json:"outputSchema,omitempty"`
ParentTurnID string `json:"parentTurnId,omitempty"`
Permissions string `json:"permissions,omitempty"` Permissions string `json:"permissions,omitempty"`
Personality Personality `json:"personality,omitempty"` Personality Personality `json:"personality,omitempty"`
ResponsesapiClientMetadata map[string]string `json:"responsesapiClientMetadata,omitempty"` ResponsesapiClientMetadata map[string]string `json:"responsesapiClientMetadata,omitempty"`
RootTurnID string `json:"rootTurnId,omitempty"`
RuntimeWorkspaceRoots []AbsolutePathBuf `json:"runtimeWorkspaceRoots,omitempty"` RuntimeWorkspaceRoots []AbsolutePathBuf `json:"runtimeWorkspaceRoots,omitempty"`
SandboxPolicy *SandboxPolicy `json:"sandboxPolicy,omitempty"` SandboxPolicy *SandboxPolicy `json:"sandboxPolicy,omitempty"`
ServiceTier string `json:"serviceTier,omitempty"` ServiceTier string `json:"serviceTier,omitempty"`
@@ -1710,6 +1745,11 @@ type ThreadStatusChangedNotification struct {
ThreadID string `json:"threadId"` ThreadID string `json:"threadId"`
} }
type ThreadReadStateChangedNotification struct {
ReadState ThreadReadState `json:"readState"`
ThreadID string `json:"threadId"`
}
type ThreadArchivedNotification struct { type ThreadArchivedNotification struct {
ThreadID string `json:"threadId"` ThreadID string `json:"threadId"`
} }
@@ -1766,6 +1806,17 @@ type ThreadGoalUpdatedNotification struct {
TurnID string `json:"turnId,omitempty"` TurnID string `json:"turnId,omitempty"`
} }
type ThreadPredictionResult struct {
Text string `json:"text,omitempty"`
Type string `json:"type"`
}
type ThreadPredictionUpdatedNotification struct {
Result ThreadPredictionResult `json:"result"`
SourceTurnID string `json:"sourceTurnId"`
ThreadID string `json:"threadId"`
}
type ThreadGoalClearedNotification struct { type ThreadGoalClearedNotification struct {
ThreadID string `json:"threadId"` ThreadID string `json:"threadId"`
} }
@@ -2119,6 +2170,7 @@ type McpToolCallProgressNotification struct {
type McpServerOauthLoginCompletedNotification struct { type McpServerOauthLoginCompletedNotification struct {
Error string `json:"error,omitempty"` Error string `json:"error,omitempty"`
LoginID string `json:"loginId,omitempty"`
Name string `json:"name"` Name string `json:"name"`
Success bool `json:"success"` Success bool `json:"success"`
ThreadID string `json:"threadId,omitempty"` ThreadID string `json:"threadId,omitempty"`