aiterm-mcp 0.70.22 → 0.70.23

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,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.70.23] - 2026-11-11
11
+
12
+ - A Claude seat that is signed out now reports failure category `authentication`. The real signed-out API error record of Claude Code 2.1.310/2.1.319 carries `error: "authentication_failed"` and no `apiErrorStatus`; that record, a 401, or (for a record with neither) the CLI's login line is now `authentication`, and the parent-delivery record accepts the value.
13
+ - Resuming a hibernated Claude seat through `agent_launch` with `env_vars` no longer conflicts on its login or config directory. `CLAUDE_CODE_OAUTH_TOKEN` is the seat's login, not a setting: it is left out of the env-name comparison, the launch's value (private env line, then process env) goes into the resumed seat, and a login that is not named or has no value is unset. `CLAUDE_CONFIG_DIR`, which Aiterm adds to every Claude recipe, is left out of the comparison too; before, every `env_vars` resume conflicted on it. On Linux and macOS the resume line reads the values from the same 0600 launch-env file a fresh launch uses instead of typing them into the pane, and the login stays out of the multiplexer environment and `pty_list`.
14
+
10
15
  ## [0.70.22] - 2026-11-11
11
16
 
12
17
  - A Claude launch no longer refuses on an authentication pre-check. `claude auth status` read the computer's own login, while a seat may run on a credential passed only in its private environment (for example `CLAUDE_CODE_OAUTH_TOKEN`); with the computer's own login expired, seats that would run were refused as `AGENT_AUTH_REQUIRED`. A logged-out Claude now stops at its own login screen (`vendor_onboarding_required`, initial prompt not sent). Terminals on older versions still answer the old codes, and callers keep reading them.
@@ -3292,7 +3297,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
3292
3297
  `ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
3293
3298
  provenance.
3294
3299
 
3295
- [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.22...HEAD
3300
+ [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.23...HEAD
3301
+ [0.70.23]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.22...v0.70.23
3296
3302
  [0.70.22]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.21...v0.70.22
3297
3303
  [0.70.21]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.20...v0.70.21
3298
3304
  [0.70.20]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.19...v0.70.20
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.70.22** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
218
+ **状態:** 開発継続中 · 現行公開版 **v0.70.23** · 動作対象は 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.70.22** · 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.70.23** · 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
 
package/dist/core.js CHANGED
@@ -2213,7 +2213,7 @@ export function listSessionsResult(envKeys = [], runTmux = tmux) {
2213
2213
  const recipe = readAgentResumeRecipe(meta);
2214
2214
  if (recipe?.kind === meta.kind && recipe.vendor_session_id === meta.vendor_session_id)
2215
2215
  for (const key of envKeys)
2216
- environment[key] = recipe.environment[key] ?? null;
2216
+ environment[key] = key === CLAUDE_LOGIN_ENV ? null : recipe.environment[key] ?? null;
2217
2217
  if (state === "hibernated") {
2218
2218
  try {
2219
2219
  confirmedAgentResumeRecipe(meta, readAgentLifecycle(meta));
@@ -6864,7 +6864,9 @@ function adoptVanishedAgentNative(meta) {
6864
6864
  "文字列は送信していません。agent_launchで起動し直してください。", 2);
6865
6865
  }
6866
6866
  }
6867
- async function resumeAgentInLock(name, readyTimeout, claudeRoot) {
6867
+ // Claude's login, not a recipe setting (lifecycle-state-ownership 4b): a resume through agent_launch may replace it.
6868
+ const CLAUDE_LOGIN_ENV = "CLAUDE_CODE_OAUTH_TOKEN";
6869
+ async function resumeAgentInLock(name, readyTimeout, claudeRoot, claudeLogin) {
6868
6870
  const previous = loadAgentMetadata(name);
6869
6871
  readyTimeout ??= previous.kind === "codex" ? AGENT_TUI_FIRST_DRAW_TIMEOUT_MS : AGENT_TUI_READY_TIMEOUT_MS;
6870
6872
  let lifecycle = readAgentLifecycle(previous);
@@ -6915,8 +6917,11 @@ async function resumeAgentInLock(name, readyTimeout, claudeRoot) {
6915
6917
  assertExecutionResumeSupported();
6916
6918
  const confirmed = confirmedAgentResumeRecipe(previous, lifecycle);
6917
6919
  // Same vendor session under another Claude root; the caller proved the transcript is there.
6918
- const recipe = claudeRoot && confirmed.kind === "claude" ? { ...confirmed, configuration_root: claudeRoot.root,
6920
+ const rooted = claudeRoot && confirmed.kind === "claude" ? { ...confirmed, configuration_root: claudeRoot.root,
6919
6921
  environment: { ...confirmed.environment, CLAUDE_CONFIG_DIR: claudeRoot.selector } } : confirmed;
6922
+ // null = unset in the seat: it resumes on the root's own login.
6923
+ const recipe = claudeLogin && rooted.kind === "claude"
6924
+ ? { ...rooted, environment: { ...rooted.environment, [CLAUDE_LOGIN_ENV]: claudeLogin.value } } : rooted;
6920
6925
  if (sessionExists(name))
6921
6926
  throw uncertain();
6922
6927
  const controlEnv = { ...process.env };
@@ -7010,6 +7015,9 @@ async function resumeAgentInLock(name, readyTimeout, claudeRoot) {
7010
7015
  const environment = [...Object.entries(recipe.environment),
7011
7016
  ...(next.kind === "codex" ? [["CODEX_HOME", recipe.configuration_root]] : []), ...agentEnvEntries(next, name)];
7012
7017
  for (const [key, value] of environment) {
7018
+ // The Claude login never goes on a multiplexer argv or into pty_list; the launch reads it from the 0600 file.
7019
+ if (value !== null && key === CLAUDE_LOGIN_ENV)
7020
+ continue;
7013
7021
  const stored = value === null ? tmux("set-environment", isWin ? "-u" : "-r", "-t", name, key) : tmux("set-environment", "-t", name, key, value);
7014
7022
  if (stored.code !== 0)
7015
7023
  throw uncertain();
@@ -7023,8 +7031,9 @@ async function resumeAgentInLock(name, readyTimeout, claudeRoot) {
7023
7031
  const forkBan = next.fork_of?.write_ban;
7024
7032
  const winArgv = () => (cli => forkBan ? windowsWriteBanArgv(forkBan, cli) : cli)(windowsAgentArgv(cliArgv, () => resolveWinPaneShell("bash")));
7025
7033
  const full = isWin ? windowsLaunchTyped(name, next.launch_id, windowsAgentLaunchLine(recipe.cwd, environment, winArgv(), { file: agentMetadataPath(name, next.launch_id) + ".launch-exited", launch_id: next.launch_id }))
7026
- : `cd ${shq(recipe.cwd)} && /usr/bin/env ${environment.filter(([, value]) => value === null).map(([key]) => `-u ${shq(key)}`).join(" ")} `
7027
- + `${environment.filter(([, value]) => value !== null).map(([key, value]) => shq(`${key}=${value}`)).join(" ")} ${argv.map(shq).join(" ")}`;
7034
+ // Values only by the 0600 launch-env file, as in a fresh launch: typed into the pane they stayed on its screen and log.
7035
+ : `cd ${shq(recipe.cwd)} && ${launchEnvSource(name, environment.filter((entry) => entry[1] !== null))}`
7036
+ + `/usr/bin/env ${environment.filter(([, value]) => value === null).map(([key]) => `-u ${shq(key)}`).join(" ")} ${argv.map(shq).join(" ")}`;
7028
7037
  agentLaunchLines.set(name, atomicShellMultiline(full, shell));
7029
7038
  send(name, full, { enter: true, mark: false, force: true, rtk: false, raw: true, launchShell: shell, preserveAgentOperation: true });
7030
7039
  phase = "generation_publish";
@@ -7661,6 +7670,11 @@ function agentEnvPrefix(meta, sid, envVars = []) {
7661
7670
  }
7662
7671
  /** Inherited values are written to a 0600 file the launch line sources and deletes, so the typed
7663
7672
  * line and the pane log carry only its path (remote-terminal.md R7). Identity names stay inline. */
7673
+ /** The env names a resume compares. Claude: the login is not a setting (lifecycle-state-ownership 4b), and every Claude
7674
+ * recipe carries CLAUDE_CONFIG_DIR, which Aiterm adds from the root (configuration_root decides it), not the caller. */
7675
+ function resumeEnvNames(kind, names) {
7676
+ return [...new Set(names)].filter(name => kind !== "claude" || (name !== CLAUDE_LOGIN_ENV && name !== "CLAUDE_CONFIG_DIR")).sort();
7677
+ }
7664
7678
  function launchEnvSource(sid, entries) {
7665
7679
  if (entries.length === 0)
7666
7680
  return "";
@@ -8227,7 +8241,7 @@ export async function openAgentWithInitialPrompt(kind, opts = {}) {
8227
8241
  || (opts.fast != null && opts.fast !== recipe.fast)
8228
8242
  || (opts.cwd != null && path.resolve(opts.cwd) !== recipe.cwd)
8229
8243
  || (opts.write_scope !== undefined && opts.write_scope !== previous.write_scope)
8230
- || (opts.env_vars !== undefined && !isDeepStrictEqual([...new Set(opts.env_vars)].sort(), Object.keys(recipe.environment).sort())))
8244
+ || (opts.env_vars !== undefined && !isDeepStrictEqual(resumeEnvNames(kind, opts.env_vars), resumeEnvNames(kind, Object.keys(recipe.environment)))))
8231
8245
  throw opts.require_existing_resume ? new AgentResumeUnavailableError(name) : new AitermError("AGENT_RESUME_CONFLICT: 同名の休止席は保存したharness・設定・project・明示envで再開します。変更は再開後に行ってください。", 2);
8232
8246
  // The only setting a resume may change: the Claude root, when it holds this conversation's transcript.
8233
8247
  const rootChange = claudeRoot && (claudeRoot.root !== recipe.configuration_root
@@ -8239,7 +8253,9 @@ export async function openAgentWithInitialPrompt(kind, opts = {}) {
8239
8253
  cwd: opts.cwd ?? null, agentDone: true }));
8240
8254
  if (preparedLifecycle)
8241
8255
  commitWorkingAgentResume(previous, preparedLifecycle);
8242
- const resumed = await resumeAgentInLock(name, opts.ready_timeout ?? undefined, rootChange);
8256
+ const claudeLogin = kind === "claude" && opts.env_vars !== undefined
8257
+ ? { value: opts.env_vars.includes(CLAUDE_LOGIN_ENV) ? launchEnvValue(CLAUDE_LOGIN_ENV) ?? null : null } : undefined;
8258
+ const resumed = await resumeAgentInLock(name, opts.ready_timeout ?? undefined, rootChange, claudeLogin);
8243
8259
  return withAgentResumeTarget(resumed, async () => {
8244
8260
  const hint = `${agentLabel(kind)} を保存した同じ会話へ再開した。\n${attachHint(name)}`;
8245
8261
  const fastState = { fast: resumed.fast === true, fast_error: null };
@@ -737,6 +737,10 @@ export function claudeApiErrorFromLine(line) {
737
737
  export function claudeFailureCategory(error) {
738
738
  if (error.status === 429 || error.kind === "rate_limit" || /^You've (?:reached your [^.\r\n]{1,80} limit\.|hit your (?:[a-z0-9-]+ ){0,3}limit\b)/i.test(error.text))
739
739
  return "rate_limited";
740
+ // The real record (2.1.310, 2.1.319): error "authentication_failed", no apiErrorStatus, "Login expired · Please run /login".
741
+ if (error.kind === "authentication_failed" || error.status === 401
742
+ || (error.kind === null && error.status === null && /Please run \/login|OAuth token (?:has been )?revoked|Invalid API key/i.test(error.text)))
743
+ return "authentication";
740
744
  if (error.status === 529)
741
745
  return "capacity";
742
746
  return error.status !== null && error.status >= 500 ? "transient" : "other";
@@ -10,7 +10,7 @@ import { executionRequestSchema } from "./execution-contract.js";
10
10
  import { parentSourceSchema } from "./execution-parent-source.js";
11
11
  import { executionActorSchema } from "./execution-inventory.js";
12
12
  export const failureObservationSchema = z.object({
13
- category: z.enum(["capacity", "rate_limited", "transient", "other"]),
13
+ category: z.enum(["capacity", "rate_limited", "transient", "authentication", "other"]),
14
14
  execution: z.enum(["not_started", "started", "unknown"]),
15
15
  boundary: z.object({ event_cursor: z.number().int().nonnegative(), operation_id: z.string().nullable(), turn_id: z.string().nullable(),
16
16
  input_id: z.string().regex(/^[a-f0-9]{32}$/).optional() }).strict().nullable(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiterm-mcp",
3
- "version": "0.70.22",
3
+ "version": "0.70.23",
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": [