jackwener/maka-agent

refactor(cli): remove dead outcome helpers and unify MakaRunOutcome classification

已关闭

#3,088 创建于 2026年8月15日

 (1 条评论) (0 个反应) (1 位负责人)TypeScript (0 个派生)github user discovery
enhancementhelp wanted

仓库指标

星标
 (1 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Problem

Three dead / duplicated outcome paths in packages/cli:

  1. sandbox-boundary-failure.tsinvocationHasSandboxBoundaryFailure / invocationRecoveredSandboxBoundaryFailure have zero callers (they are the last consumers of the removed runtime's InvocationResult). The live sibling sessionEventSandboxBoundaryFailureReason must stay.
  2. MakaRunOutcome is computed twice from two sources in runtime-host-run-command.ts — a live TurnOutcomeAccumulator (SessionEvent stream) and a stored-message classifier (outcomeFromStoredTurn / storedSandboxBoundaryOutcome) whose vocabularies already diverge (aborted/runtime_error vs errorClass ?? abortSource ?? status).
  3. Dead exports with no callers: formatResumeHint, cleanRecapText/RECAP_INSTRUCTION, runMakaTextCli, colorDiffRow.

Desired outcome

One MakaRunOutcome classifier parameterized over its source, dead helpers removed, dead exports dropped.

Alternatives or workarounds

Leave the divergence; the stored-message path already produces different failure classes from the live path.

Acceptance

  • invocationHasSandboxBoundaryFailure / invocationRecoveredSandboxBoundaryFailure removed; sessionEventSandboxBoundaryFailureReason retained
  • One outcome classifier shared by the live and stored-message paths
  • Dead exports removed
  • maka run and maka run --graph exit codes pinned by CLI tests; typecheck and Biome pass

Related

  • #3034, #3035 (prior runtime path removals)

贡献者指南