aiterm-mcp 0.63.9 → 0.63.10

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
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.63.10] - 2026-11-06
11
+
12
+ - Resume a killed working Codex conversation whose native metadata has not yet bound its vendor ID, using only its unique launch-marked, cwd-matching, non-fork, complete retained root rollout and same-turn settings.
13
+ - Preserve explicitly recorded vendor-default effort as unspecified, instead of guessing an effort or refusing all default-effort conversations. Retain the model, same-conversation proof, native absence and configuration guards. Mixed, partial or missing evidence remains unavailable.
14
+ - This extends private resume recipe/template records with an optional vendor-default origin. Use 0.63.10 or later for those records; older versions do not support them. Retained configuration reads are bounded to 16 MiB; larger roots remain unavailable.
15
+
10
16
  ## [0.63.9] - 2026-11-06
11
17
 
12
18
  - Let resume-only launch reconnect a saved working Claude/Codex conversation after confirmed native-session loss. Refresh the existing saved configuration, preserve same-conversation proof, and never replay the old input or fall through to fresh launch.
@@ -3047,7 +3053,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
3047
3053
  `ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
3048
3054
  provenance.
3049
3055
 
3050
- [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.9...HEAD
3056
+ [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.10...HEAD
3057
+ [0.63.10]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.9...v0.63.10
3051
3058
  [0.63.9]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.8...v0.63.9
3052
3059
  [0.63.8]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.7...v0.63.8
3053
3060
  [0.63.7]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.6...v0.63.7
package/README.ja.md CHANGED
@@ -215,7 +215,7 @@ runtime-error store は canonical dotagents config の `collection.enabled: true
215
215
  場合だけ収集し、既定OFF、network送信は行いません。tag起点CIのnpm provenance(OIDC Trusted
216
216
  Publishing)で公開し、GitHub Release が Official MCP Registry を再登録します。
217
217
 
218
- **状態:** 開発継続中 · 現行公開版 **v0.63.9** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
218
+ **状態:** 開発継続中 · 現行公開版 **v0.63.10** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
219
219
 
220
220
  ### 更新と巻き戻し
221
221
 
package/README.md CHANGED
@@ -227,7 +227,7 @@ collection is off by default and performs no network I/O. It ships via
227
227
  tag-triggered CI with npm provenance (OIDC Trusted Publishing); the GitHub
228
228
  Release re-registers the Official MCP Registry entry.
229
229
 
230
- **Status:** actively maintained · current public release **v0.63.9** · runs on Linux · WSL2 · macOS · native Windows (tmux on POSIX, the tmux-CLI-compatible [psmux](https://github.com/psmux/psmux) on native Windows — no WSL required) · MIT · see the [CHANGELOG](CHANGELOG.md).
230
+ **Status:** actively maintained · current public release **v0.63.10** · runs on Linux · WSL2 · macOS · native Windows (tmux on POSIX, the tmux-CLI-compatible [psmux](https://github.com/psmux/psmux) on native Windows — no WSL required) · MIT · see the [CHANGELOG](CHANGELOG.md).
231
231
 
232
232
  ### Update and rollback
233
233
 
@@ -9,7 +9,7 @@ const absolute = z.string().min(1).refine(value => path.isAbsolute(value) && !va
9
9
  export const agentResumeRecipeSchema = z.object({
10
10
  schema: z.literal("aiterm.agent-resume.v1"), launch_id: launchId,
11
11
  kind: z.enum(["claude", "codex"]), vendor_session_id: z.string().regex(/^[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$/i),
12
- executable: absolute, cwd: absolute, configuration_root: absolute, model: z.string().nullable(), reasoning_effort: z.string().nullable(), fast: z.boolean(),
12
+ executable: absolute, cwd: absolute, configuration_root: absolute, model: z.string().nullable(), reasoning_effort: z.string().nullable(), reasoning_effort_source: z.literal("vendor_default").optional(), fast: z.boolean(),
13
13
  environment: z.record(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/), z.string().refine(value => !value.includes("\0")).nullable()),
14
14
  }).strict();
15
15
  const identity = z.object({ pid: z.number().int().positive(), process_group_id: z.number().int().positive().nullable(),
@@ -161,7 +161,8 @@ export function finishAgentResumeConfiguration(meta, before, model, effort) {
161
161
  const complete = !!model && !!effort;
162
162
  const known = before.state === "confirmed" && (!model || model === before.model || effort !== null);
163
163
  writeAgentResumeTemplate(meta, { ...before, model: model ?? before.model, reasoning_effort: effort ?? before.reasoning_effort,
164
- state: complete || known ? "confirmed" : "unconfirmed" });
164
+ state: complete || known ? "confirmed" : "unconfirmed",
165
+ ...(effort ? { reasoning_effort_source: undefined } : {}) });
165
166
  }
166
167
  export function refreshAgentResumeRecipe(meta) {
167
168
  const template = readAgentResumeTemplate(meta);
@@ -170,11 +171,11 @@ export function refreshAgentResumeRecipe(meta) {
170
171
  return recipe?.model && recipe.reasoning_effort
171
172
  && (meta.kind !== "claude" || Object.hasOwn(recipe.environment, "CLAUDE_CONFIG_DIR")) ? recipe : null;
172
173
  }
173
- if (template.state !== "confirmed" || !template.model || !template.reasoning_effort || template.model !== meta.model
174
+ if (template.state !== "confirmed" || !template.model || (!template.reasoning_effort && !(meta.kind === "codex" && template.reasoning_effort === null && template.reasoning_effort_source === "vendor_default")) || template.model !== meta.model
174
175
  || template.executable !== meta.agent_executable || template.cwd !== meta.cwd || typeof meta.fast !== "boolean")
175
176
  return null;
176
177
  if (meta.kind === "claude" && (!Object.hasOwn(template.environment, "CLAUDE_CONFIG_DIR")
177
- || !["low", "medium", "high", "xhigh", "max"].includes(template.reasoning_effort)))
178
+ || !["low", "medium", "high", "xhigh", "max"].includes(template.reasoning_effort ?? "")))
178
179
  return null;
179
180
  const { state, ...settings } = template;
180
181
  const candidate = agentResumeRecipeSchema.safeParse({ ...settings, schema: "aiterm.agent-resume.v1",
package/dist/core.js CHANGED
@@ -61,7 +61,7 @@ import { FastModeError, fastModeFailure } from "./fast-mode.js";
61
61
  import { readFileOrNull, restoreJsonSetting, withUserConfigLock, restoreUserDefaults, keepingUserDefaults, USER_DEFAULT_SETTLE_MS } from "./user-config.js";
62
62
  import { isDeepStrictEqual } from "node:util";
63
63
  import { grokAuthPlan, grokAuthStatus, grokAuthPane, GROK_MODEL_DEFAULTS, realGrokHome, resolveAndValidateGrokAuth, assertGrokModelAvailable, grokModelChoices, grokModelFromFooter, grokFooterModelName, grokModelDefaultsFromBody, restoreGrokModelDefaults, grokEventsTranscript, grokSessionDirectory, latestGrokCompletion, grokTurnSettled, observeGrokDone, buildGrokAgentCmd, grokAgentArgv, grokLaunchNote, grokEnvTokens, grokEnvEntries, grokTuiReady, grokPaneObservation, GROK_INTERRUPT_KEY, grokRateLimitDialog, grokPromptAwaitingAccept, grokUnacceptedPromptRestored, grokStartupAction, grokFooterHasConfiguration, grokTranscriptText, createGrokAgentMetadata, } from "./harnesses/grok.js";
64
- import { codexAuthPlan, codexAuthStatus, codexAuthPane, realCodexHome, readCodexConfigPins, bindCodexTranscriptSession, latestCodexCompletion, codexTurnSettled, codexCompletedTurnId, captureCodexRecoveryProof, captureCodexResumeProof, readCodexResumeProof, codexResumeProofDigest, codexRootTranscript, codexRunningTurn, codexInterruptionRecord, observeCodexDone, buildCodexAgentCmd, codexAgentArgv, codexResumeArgv, codexLaunchNote, codexPaneObservation, CODEX_INTERRUPT_KEY, codexHelperProcess, codexRateLimitModelSwitchDialog, codexApprovalDialog, codexStartupAction, codexModelChoice, codexEffortChoice, codexMoreReasoningChoice, codexTranscriptText, createCodexAgentMetadata, codexModelChoices, codexFastCommandOffered, codexFooterShowsFast, codexServiceTierNotices, restoreCodexDefaults, restoreCodexDefaultInFile, } from "./harnesses/codex.js";
64
+ import { codexAuthPlan, codexAuthStatus, codexAuthPane, realCodexHome, readCodexConfigPins, bindCodexTranscriptSession, latestCodexCompletion, codexTurnSettled, codexCompletedTurnId, codexWorkingResumeConfiguration, captureCodexRecoveryProof, captureCodexResumeProof, readCodexResumeProof, codexResumeProofDigest, codexRootTranscript, codexRunningTurn, codexInterruptionRecord, observeCodexDone, buildCodexAgentCmd, codexAgentArgv, codexResumeArgv, codexLaunchNote, codexPaneObservation, CODEX_INTERRUPT_KEY, codexHelperProcess, codexRateLimitModelSwitchDialog, codexApprovalDialog, codexStartupAction, codexModelChoice, codexEffortChoice, codexMoreReasoningChoice, codexTranscriptText, createCodexAgentMetadata, codexModelChoices, codexFastCommandOffered, codexFooterShowsFast, codexServiceTierNotices, restoreCodexDefaults, restoreCodexDefaultInFile, } from "./harnesses/codex.js";
65
65
  import { claudeAuthPlan, claudeAuthStatus, claudeAuthPane, OPERATION_ID_RE, CLAUDE_RESULT_MAX_BYTES, CLAUDE_EFFORTS, agentClaudeOperationPath, agentClaudeApprovalReceiptPath, agentClaudeDispatchReceiptPath, validateOperationId, readClaudeResultText, assertClaudeAuthenticationReady, claudeModelChoices, claudeConfigDir, claudeFastIndicatorShown, claudeFastResult, buildClaudeAgentCmd, claudeAgentArgv, claudeResumeArgv, claudeLaunchNote, claudePaneObservation, CLAUDE_INTERRUPT_KEY, claudeUsageLimit, claudeLiveSelectMenu, claudeStartupAction, createClaudeAgentMetadata, claudeSessionTranscriptPath, claudeApiErrorFromLine, claudeApiErrorAfter, claudeFailureCategory, } from "./harnesses/claude.js";
66
66
  import { cursorAuthPlan, cursorAuthStatus, cursorAuthPane, bindCursorTranscriptSession, cursorTurnBoundary, latestCursorCompletion, observeCursorDone, cursorTranscriptText, assertCursorAuthenticationReady, assertCursorModelAvailable, cursorModelChoices, cursorModelIsFastVariant, cursorFastParameter, cursorHeaderShowsFast, cursorPickerView, cursorEffortSelected, cursorParameterRows, cursorUserConfigPath, CURSOR_DEFAULT_MODEL_KEYS, realCursorHome, buildCursorAgentCmd, cursorAgentArgv, cursorPromptWithLineage, createCursorAgentMetadata, cursorLaunchNote, cursorEffortNavigation, cursorTuiReady, cursorPaneObservation, CURSOR_INTERRUPT_KEY, cursorPromptHooksRunning, cursorUsageLimit, CURSOR_SUBMIT_SEQUENCE, validateCursorModelEffort, } from "./harnesses/cursor.js";
67
67
  import { interimFromNow, readInterimWords, recordInterimBoundary } from "./interim-words.js";
@@ -6340,7 +6340,8 @@ function confirmedAgentResumeRecipe(meta, lifecycle) {
6340
6340
  || recipe.vendor_session_id !== meta.vendor_session_id || lifecycle.recipe_digest !== agentResumeRecipeDigest(recipe)
6341
6341
  || recipe.model !== meta.model || recipe.fast !== meta.fast || recipe.cwd !== meta.cwd || recipe.executable !== meta.agent_executable
6342
6342
  || recipe.configuration_root !== (meta.kind === "codex" ? meta.codex_home : meta.claude_home ?? claudeConfigDir())
6343
- || !recipe.model || !recipe.reasoning_effort || !isUsableAgentExecutableFile(recipe.executable)
6343
+ || !recipe.model || (!recipe.reasoning_effort && !(meta.kind === "codex" && recipe.reasoning_effort === null && recipe.reasoning_effort_source === "vendor_default"))
6344
+ || (recipe.reasoning_effort_source !== undefined && (meta.kind !== "codex" || recipe.reasoning_effort !== null)) || !isUsableAgentExecutableFile(recipe.executable)
6344
6345
  || !fs.statSync(recipe.cwd).isDirectory())
6345
6346
  throw unavailable();
6346
6347
  if (meta.kind === "claude" && !Object.hasOwn(recipe.environment, "CLAUDE_CONFIG_DIR"))
@@ -6510,7 +6511,8 @@ async function completeFailedCodexResume(meta, readyTimeout) {
6510
6511
  // Do not recapture startup processes: this same native may already own children.
6511
6512
  writeAgentResumeTemplate(meta, { schema: "aiterm.agent-resume-template.v1", launch_id: meta.launch_id,
6512
6513
  state: "confirmed", kind: "codex", executable: recipe.executable, cwd: recipe.cwd,
6513
- configuration_root: recipe.configuration_root, model: recipe.model, reasoning_effort: recipe.reasoning_effort, environment: recipe.environment });
6514
+ configuration_root: recipe.configuration_root, model: recipe.model, reasoning_effort: recipe.reasoning_effort, environment: recipe.environment,
6515
+ ...(recipe.reasoning_effort_source ? { reasoning_effort_source: recipe.reasoning_effort_source } : {}) });
6514
6516
  verify();
6515
6517
  writeAgentResumeResolution(meta, { schema: "aiterm.agent-resume-resolution.v1", launch_id: meta.launch_id,
6516
6518
  previous_launch_id: source.launch_id, vendor_session_id: recipe.vendor_session_id,
@@ -6551,9 +6553,30 @@ function prepareWorkingAgentResume(meta) {
6551
6553
  if (native.state !== "known" || native.sessions.some(row => row.session_id === meta.aiterm_session))
6552
6554
  throw unavailable();
6553
6555
  };
6554
- if ((meta.kind !== "claude" && meta.kind !== "codex") || !meta.vendor_session_id || readAgentResumeAttempt(meta))
6556
+ if ((meta.kind !== "claude" && meta.kind !== "codex") || readAgentResumeAttempt(meta))
6555
6557
  throw unavailable();
6556
6558
  absent();
6559
+ const template = readAgentResumeTemplate(meta);
6560
+ if (meta.kind === "codex" && (!meta.vendor_session_id || !template?.model || !template.reasoning_effort)) {
6561
+ const retained = codexWorkingResumeConfiguration(meta);
6562
+ if (!retained || !template || template.state !== "confirmed"
6563
+ || (meta.vendor_session_id && meta.vendor_session_id !== retained.session_id)
6564
+ || (meta.model && meta.model !== retained.model) || (template.model && template.model !== retained.model)
6565
+ || template.reasoning_effort !== retained.effort || template.cwd !== meta.cwd || template.executable !== meta.agent_executable
6566
+ || template.configuration_root !== meta.codex_home)
6567
+ throw unavailable();
6568
+ withExecutionPreparation(meta.aiterm_session, () => {
6569
+ bindCodexTranscriptSession(meta);
6570
+ if (meta.vendor_session_id !== retained.session_id)
6571
+ throw unavailable();
6572
+ meta.model = retained.model;
6573
+ writeAgentMetadata(meta);
6574
+ writeAgentResumeTemplate(meta, { ...template, model: retained.model,
6575
+ ...(retained.effort === null ? { reasoning_effort_source: "vendor_default" } : {}) });
6576
+ });
6577
+ }
6578
+ if (!meta.vendor_session_id)
6579
+ throw unavailable();
6557
6580
  const recipe = refreshAgentResumeRecipe(meta);
6558
6581
  if (!recipe)
6559
6582
  throw unavailable();
@@ -6638,7 +6661,7 @@ async function resumeAgentInLock(name, readyTimeout = AGENT_TUI_READY_TIMEOUT_MS
6638
6661
  const lineage = { agentRole: "subagent", parentSessionId: previous.parent_session_id,
6639
6662
  delegationDepth: previous.delegation_depth, lineage: previous.lineage, delegationAllowed: true };
6640
6663
  let native = null, published = false;
6641
- return await withNativeSessionCreation(name, receipt => {
6664
+ const resume = () => withNativeSessionCreation(name, receipt => {
6642
6665
  phase = "native_identity";
6643
6666
  const [server, pane] = processStartIdentities([receipt.server_pid, receipt.pane_pid], process.platform);
6644
6667
  if (!next || !server || !pane)
@@ -6734,7 +6757,8 @@ async function resumeAgentInLock(name, readyTimeout = AGENT_TUI_READY_TIMEOUT_MS
6734
6757
  phase = "ready_save";
6735
6758
  writeAgentResumeTemplate(resumed, { schema: "aiterm.agent-resume-template.v1", launch_id: resumed.launch_id, state: "confirmed",
6736
6759
  kind: recipe.kind, executable: recipe.executable, cwd: recipe.cwd, configuration_root: recipe.configuration_root,
6737
- model: recipe.model, reasoning_effort: recipe.reasoning_effort, environment: recipe.environment });
6760
+ model: recipe.model, reasoning_effort: recipe.reasoning_effort, environment: recipe.environment,
6761
+ ...(recipe.reasoning_effort_source ? { reasoning_effort_source: recipe.reasoning_effort_source } : {}) });
6738
6762
  writeAgentResumeRecipe(resumed, { ...recipe, launch_id: resumed.launch_id });
6739
6763
  writeAgentResumeAttempt(previous, { ...attempt, state: "ready", at: new Date().toISOString() });
6740
6764
  return resumed;
@@ -6751,6 +6775,9 @@ async function resumeAgentInLock(name, readyTimeout = AGENT_TUI_READY_TIMEOUT_MS
6751
6775
  throw new AgentResumeError("AGENT_RESUME_FAILED", `同じ会話への復帰を確認できません。本文は送信していません。再送せず席の状態を確認してください。${error instanceof ExecutionError ? ` ${error.code}` : ""}`, name, next?.launch_id ?? previous.launch_id);
6752
6776
  }
6753
6777
  });
6778
+ return await (recipe.reasoning_effort_source === "vendor_default"
6779
+ ? keepingCodexDefaults(recipe.executable, recipe.configuration_root, ["model", "model_reasoning_effort"], resume)
6780
+ : resume());
6754
6781
  }
6755
6782
  catch (error) {
6756
6783
  recordFailure(error);
@@ -620,6 +620,43 @@ function codexNativeRootRecord(meta, requireBoundary) {
620
620
  return null;
621
621
  }
622
622
  }
623
+ /** Read configuration from the unique launch-bound working root without writing it. */
624
+ export function codexWorkingResumeConfiguration(meta) {
625
+ const root = codexNativeRootRecord(meta, false);
626
+ if (!root || !root.boundary || root.end < 1 || root.end > CODEX_TRANSCRIPT_INCREMENT_MAX_BYTES)
627
+ return null;
628
+ try {
629
+ const before = fs.statSync(root.path), text = fs.readFileSync(root.path, "utf8");
630
+ if (!text.endsWith("\n"))
631
+ return null;
632
+ let settings = null;
633
+ for (const line of text.trimEnd().split("\n")) {
634
+ const record = JSON.parse(line);
635
+ if (record.type === "session_meta" && record.payload?.cwd !== meta.cwd)
636
+ return null;
637
+ if (record.type !== "turn_context" || record.payload?.turn_id !== root.boundary.turn_id)
638
+ continue;
639
+ const context = record.payload, saved = context.collaboration_mode?.settings;
640
+ const effort = saved && Object.hasOwn(saved, "reasoning_effort") ? saved.reasoning_effort
641
+ : Object.hasOwn(context, "effort") ? context.effort : undefined;
642
+ if (context.cwd !== meta.cwd || typeof context.model !== "string" || !context.model
643
+ || (saved?.model != null && saved.model !== context.model)
644
+ || (effort !== null && (typeof effort !== "string" || !["none", "minimal", "low", "medium", "high", "xhigh", "max"].includes(effort)))
645
+ || settings)
646
+ return null;
647
+ settings = { model: context.model, effort };
648
+ }
649
+ const after = fs.statSync(root.path);
650
+ if (!settings || before.dev !== root.file.device || before.ino !== root.file.inode || before.size !== root.end
651
+ || before.dev !== after.dev || before.ino !== after.ino || before.size !== after.size
652
+ || before.mtimeMs !== after.mtimeMs || before.ctimeMs !== after.ctimeMs)
653
+ return null;
654
+ return { session_id: root.session_id, ...settings };
655
+ }
656
+ catch {
657
+ return null;
658
+ }
659
+ }
623
660
  export function codexInterruptionRecord(meta) {
624
661
  const value = codexNativeRootRecord(meta, true);
625
662
  if (!value || !value.boundary || value.event_cursor === null)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiterm-mcp",
3
- "version": "0.63.9",
3
+ "version": "0.63.10",
4
4
  "mcpName": "io.github.kitepon/aiterm-mcp",
5
5
  "description": "Persistent terminal MCP with one harness-based launcher for Claude Code, Codex CLI, Grok CLI, Cursor Agent CLI, and Antigravity CLI, plus durable PTYs for SSH, containers, and REPLs.",
6
6
  "keywords": [