You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
turn.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
25176
-
turn.error = "Session was cancelled before this turn started.";
25176
+
turn.error = reason ? `Session cancelled: ${reason}` : "Session was cancelled before this turn started.";
25177
25177
this.notifyTurn(turn);
25178
25178
}
25179
25179
session.queuedTurns = [];
@@ -25736,8 +25736,8 @@ var usageGuide = [
25736
25736
"Tool choice:",
25737
25737
"- Use codex_task for one delegated Codex task. It is the native Claude-like front door: description plus prompt, read-only by default, and answer-first result. Call codex_task multiple times in one assistant turn when independent investigations can run in parallel.",
25738
25738
"- Use codex_task_group when the work can be split into independent concurrent tasks and Claude wants one combined response with rolled-up per-task findings.",
25739
-
"- Use codex_followup when Claude already has a session_id from codex_task or codex_task_group and wants to continue, steer, or wait on that same Codex context.",
25740
-
"- Set codex_task background true for long-running work so Claude gets a session_id immediately, then use codex_followup mode waitor steer.",
25739
+
"- Use codex_followup when Claude already has a session_id from codex_task or codex_task_group and wants to continue, steer, wait on, or cancel that same Codex context.",
25740
+
"- Set codex_task background true for long-running work so Claude gets a session_id immediately, then use codex_followup mode wait, steer, or cancel.",
25741
25741
"- Diagnostics are resources by default: read codex://status, codex://doctor, or codex://usage when a prior call failed or availability is uncertain.",
25742
25742
"- Debug tools such as codex_status, codex_doctor, codex_usage_guide, codex_choose_tool, and codex_export_debug_bundle are hidden unless CODEX_SUBAGENTS_ENABLE_DEBUG_TOOLS=1.",
25743
25743
"- Legacy/manual tools such as ask_codex, run_agent, run_agents, and old session names are hidden unless CODEX_SUBAGENTS_ENABLE_LEGACY_TOOLS=1.",
@@ -25748,6 +25748,7 @@ var usageGuide = [
25748
25748
"- If the user explicitly asks for non-sandbox/full local capabilities, set full_access true. This maps to Codex's --dangerously-bypass-approvals-and-sandbox flag and allows DNS/network plus unrestricted file and git writes.",
25749
25749
"- Approvals are non-interactive; do not expect Codex to ask permission.",
25750
25750
'- If codex_followup mode wait returns completed false with timeoutReason "wait_timeout", the session is still running unless its status says otherwise.',
25751
+
"- Use codex_followup mode cancel to stop a background or actively running Codex session early. The response includes whatever partial output streamed before the interrupt.",
25751
25752
'- If a tool returns error.kind "backpressure", reduce max_parallel or wait before retrying. codex://status exposes current queue/session limits.',
25752
25753
"- If a response mentions outputArtifacts, use the artifact paths for full retained output instead of asking Codex to resend huge stdout/stderr.",
25753
25754
'- Do not use model_preset "spark" by default. Use Spark only when the user asks for Spark or when a quick focused sidecar check is clearly more appropriate than the default Codex model.',
@@ -26336,17 +26337,22 @@ function nativeTaskPrompt(args) {
26336
26337
26337
26338
${args.prompt}`;
26338
26339
}
26339
-
function sessionProgressPayload(session, preferredResult) {
26340
-
if (!session || typeof session !== "object") return {};
26340
+
function sessionPartialMessage(session, preferredResult) {
26341
+
if (!session || typeof session !== "object") return void 0;
result: `Codex task started in the background. Session: ${session2.id}`,
27006
27012
session_id: session2.id,
27007
27013
turn,
27008
-
hint: "Use codex_followup mode waitor steer with this session_id."
27014
+
hint: "Use codex_followup mode wait, steer, or cancel with this session_id."
27009
27015
};
27010
27016
if (args.advanced?.include_diagnostics) {
27011
27017
payload.diagnostics = {
@@ -27227,7 +27233,7 @@ var nativeTaskGroupTaskSchema = external_exports.object({
27227
27233
keep_session: external_exports.boolean().default(false).describe("Return this task's session_id after completion so Claude can follow up. Leave false for native Task-like one-shot work."),
27228
27234
...nativeBaseInputSchema
27229
27235
});
27230
-
var followupModeSchema = external_exports.enum(["queue", "steer", "wait"]);
27236
+
var followupModeSchema = external_exports.enum(["queue", "steer", "wait", "cancel"]);
27231
27237
registerTool(
27232
27238
"codex_task_group",
27233
27239
{
@@ -27297,12 +27303,13 @@ registerTool(
27297
27303
"codex_followup",
27298
27304
{
27299
27305
title: "Followup",
27300
-
description: "Continue, steer, or poll a Codex session from a prior background or keep_session task. Use queue for another prompt in the same context, steer to redirect active work, and wait to check whether the current work has finished.",
27306
+
description: "Continue, steer, poll, or cancel a Codex session from a prior background or keep_session task. Use queue for another prompt, steer to redirect active work, wait to check completion, and cancel to stop running work.",
27301
27307
inputSchema: {
27302
27308
session_id: external_exports.string().trim().min(1).describe("session_id returned by codex_task or codex_task_group."),
27303
-
prompt: external_exports.string().min(1).optional().describe("Follow-up or steering prompt. Required for mode queue and mode steer; omit for mode wait."),
27309
+
prompt: external_exports.string().min(1).optional().describe("Follow-up or steering prompt. Required for mode queue and mode steer; omit for mode wait or cancel."),
27304
27310
description: external_exports.string().trim().min(1).optional().describe("Optional short label for this follow-up turn."),
27305
-
mode: followupModeSchema.default("queue").describe("queue continues the Codex context, steer redirects active work, wait collects an existing result."),
27311
+
reason: external_exports.string().trim().min(1).max(500).optional().describe("Optional reason for mode cancel; logged and echoed in the response."),
27312
+
mode: followupModeSchema.default("queue").describe("queue continues the Codex context, steer redirects active work, wait collects an existing result, cancel stops running work."),
27306
27313
interrupt_current: external_exports.boolean().default(false).describe("For mode steer, cancel the active Codex turn and run this steering prompt next. Leave false unless the user explicitly wants interruption."),
27307
27314
background: external_exports.boolean().default(false).describe("Return after queueing or steering instead of waiting for the Codex turn to finish."),
27308
27315
turn_id: external_exports.string().trim().min(1).optional().describe("For mode wait, optionally wait for one specific turn."),
result: partialMessage || (wasActive ? "Codex was cancelled mid-turn; no partial output was captured." : "Codex session was already idle when cancelled."),
0 commit comments