@leo000001/codex-mcp 0.2.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
12
12
  - `approvalPolicy`, `sandbox`, and `effort` are now **required** parameters in the `codex` tool — callers must explicitly set based on their own permission level and task complexity
13
13
  - `effort` parameter promoted from `advanced.effort` to top-level parameter in the `codex` tool
14
14
  - `codex_reply` parameter `sandboxPolicy` renamed to `sandbox`
15
+ - `codex_check` parameter `execpolicyAmendment` renamed to `execpolicy_amendment` to match app-server protocol field naming
15
16
 
16
17
  ### Changed
17
18
 
@@ -23,6 +24,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
23
24
  - Approval and user-input timeout timers now call `.unref()` to avoid blocking process exit
24
25
  - Documentation aligned with implementation details for event eviction and e2e guidance
25
26
  - Tool input defaults are now defined in schema (`cursor`, `maxEvents`, `includeSensitive`, `advanced.approvalTimeoutMs`) and client-facing text avoids duplicated default descriptions
27
+ - `codex_session` adds `clean_background_terminals` action to call `thread/background_terminals/clean`
28
+ - Approval action payloads now expose `approvalId` when provided by app-server
29
+ - Documentation was de-duplicated by splitting responsibilities between `AGENTS.md` (execution handbook) and `docs/DESIGN.md` (single source upgrade playbook), and a one-shot schema refresh runbook/record was added (`2026-02-21`, no schema diff)
30
+ - `src/app-server/protocol.ts` is now aligned to current v2 schema coverage for thread/turn params (`dynamicTools`, `persistExtendedHistory`, `collaborationMode`, richer `SandboxPolicy`, strict `UserInput` union, `turn/steer` params)
31
+ - `codex_check` input validation is now action-aware at schema level (`poll` vs `respond_permission` vs `respond_user_input`), including conditional `execpolicy_amendment` rules and forbidden-field checks
32
+ - Auth refresh request handling now uses explicit unsupported semantics (`-32000`) instead of `-32601` for `account/chatgptAuthTokens/refresh`
33
+ - Compatibility policy is now explicitly strict: removed non-essential alias compatibility (`approval_id`, `network_approval_context`, `questionId`) and documented a single necessary-compatibility whitelist (v1/v2 thread/turn id extraction)
34
+ - Command approval context is now surfaced directly in `actions[]` / `approval_request` payloads (`commandActions`, `proposedExecpolicyAmendment`) for richer client-side approval UX
35
+ - `turn/started` and `turn/completed` notification handling now only uses canonical `turn.id` shape (plus runtime `activeTurnId` fallback), and corresponding v1 top-level `turnId` compatibility tests were removed
36
+ - `compat-report` now correctly advertises `respondApprovalAlias: false` to match strict no-alias behavior
37
+ - Upgrade-policy docs were further de-duplicated: `docs/DESIGN.md` remains the single detailed compatibility source, and `AGENTS.md` now stays as a concise execution gate
26
38
 
27
39
  ## [0.1.0] - 2026-02-15
28
40
 
package/README.md CHANGED
@@ -180,12 +180,12 @@ Send a follow-up message to an existing session.
180
180
 
181
181
  ### `codex_session` — Manage sessions
182
182
 
183
- List, inspect, cancel, interrupt, or fork sessions.
183
+ List, inspect, cancel, interrupt, fork sessions, or clean background terminals.
184
184
 
185
185
  | Parameter | Type | Required | Description |
186
186
  | ------------------ | ------- | ----------------------------- | ---------------------------------------------------------------------- |
187
- | `action` | string | Yes | `"list"`, `"get"`, `"cancel"`, `"interrupt"`, or `"fork"` |
188
- | `sessionId` | string | For get/cancel/interrupt/fork | Target session ID |
187
+ | `action` | string | Yes | `"list"`, `"get"`, `"cancel"`, `"interrupt"`, `"fork"`, or `"clean_background_terminals"` |
188
+ | `sessionId` | string | For get/cancel/interrupt/fork/clean_background_terminals | Target session ID |
189
189
  | `includeSensitive` | boolean | No | Include `cwd`/`profile`/`config`/`threadId` in `get`. Default: `false` |
190
190
 
191
191
  **Returns:**
@@ -193,6 +193,7 @@ List, inspect, cancel, interrupt, or fork sessions.
193
193
  - `action="get"` → `PublicSessionInfo` (or `SensitiveSessionInfo` when `includeSensitive=true`)
194
194
  - `action="cancel"|"interrupt"` → `{ success: true, message }`
195
195
  - `action="fork"` → `{ sessionId, threadId, status: "idle", pollInterval }`
196
+ - `action="clean_background_terminals"` → `{ success: true, message }`
196
197
 
197
198
  ```json
198
199
  { "action": "list" }
@@ -200,6 +201,7 @@ List, inspect, cancel, interrupt, or fork sessions.
200
201
  { "action": "cancel", "sessionId": "sess_abc123" }
201
202
  { "action": "interrupt", "sessionId": "sess_abc123" }
202
203
  { "action": "fork", "sessionId": "sess_abc123" }
204
+ { "action": "clean_background_terminals", "sessionId": "sess_abc123" }
203
205
  ```
204
206
 
205
207
  ### `codex_check` — Poll events & respond
@@ -216,9 +218,9 @@ Query a running session for events, respond to approval requests, or answer user
216
218
  | `pollOptions` | object | No | Optional controls: `includeEvents` (default `true`), `includeActions` (default `true`), `includeResult` (default `true`), `maxBytes` (default unlimited) |
217
219
  | `requestId` | string | For respond_permission/user_input | Request ID from `actions[]` |
218
220
  | `decision` | string | For respond_permission | For command approvals: `"accept"`, `"acceptForSession"`, `"acceptWithExecpolicyAmendment"`, `"decline"`, `"cancel"`; for file changes: `"accept"`, `"acceptForSession"`, `"decline"`, `"cancel"` |
219
- | `execpolicyAmendment` | string[] | For acceptWithExecpolicyAmendment | Exec policy amendment list (required when `decision="acceptWithExecpolicyAmendment"`) |
221
+ | `execpolicy_amendment` | string[] | For acceptWithExecpolicyAmendment | Exec policy amendment list (required when `decision="acceptWithExecpolicyAmendment"`) |
220
222
  | `denyMessage` | string | No | Internal note on deny (not sent to app-server) |
221
- | `answers` | object | For respond_user_input | For `respond_user_input`: `questionId -> { answers: string[] }` |
223
+ | `answers` | object | For respond_user_input | For `respond_user_input`: `question-id -> { answers: string[] }` |
222
224
 
223
225
  **Returns (poll and respond_*):** `{ sessionId, status, pollInterval?, cursorResetTo?, events, nextCursor, actions?, result? }`
224
226
 
@@ -264,11 +266,14 @@ Approvals/results/errors are pinned to reduce eviction risk.
264
266
  When the agent requests approval or user input, `poll` includes an `actions[]` list. Respond with:
265
267
 
266
268
  - `respond_permission`: `decision` is one of `accept`, `acceptForSession`, `decline`, `cancel`.
267
- - For command approvals, `acceptWithExecpolicyAmendment` is supported and requires `execpolicyAmendment`.
268
- - `respond_user_input`: send `answers` keyed by `questionId`.
269
+ - For command approvals, `acceptWithExecpolicyAmendment` is supported and requires `execpolicy_amendment`.
270
+ - `respond_user_input`: send `answers` keyed by the question `id`.
271
+ - For command approvals, `actions[]` may include `commandActions` and `proposedExecpolicyAmendment` for richer review UI.
269
272
 
270
273
  Pending approvals auto-decline after `advanced.approvalTimeoutMs`.
271
274
 
275
+ Auth callback note: if app-server sends `account/chatgptAuthTokens/refresh`, codex-mcp returns JSON-RPC error `-32000` because external ChatGPT token refresh is out of scope for this server.
276
+
272
277
  ## Session Lifecycle & Cleanup
273
278
 
274
279
  Sessions auto-clean up in the background: