jackwener/maka-agent

refactor(runtime): finish agent-run.ts extraction (prior-run context + status projection helpers)

已关闭

#1,407 创建于 2026年7月23日

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

仓库指标

星标
 (1 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Part of #1084 (second-pass sink-file and boundary governance). Half of the original slice already landed (session-projection-helpers.ts exists and is imported at agent-run.ts:38); this finishes the rest. Scope re-verified against current main (agent-run.ts, 1652 lines).

Scope

  • New prior-run-context.ts: PriorRuntimeContext (~L144), buildPriorRuntimeContext (~L977), buildResumedChildRuntimeContext (~L1061, added by #1329 — include this child variant), backfillMissingPriorRuntimeEvents (~L1159) and the repair/backfill helpers.
  • Move the remaining pure helpers into the existing session-projection-helpers.ts: isTerminalRunStatus (~L1591), statusFromEvent (~L1603), turnStatusFromEvent (~L1626), blockedReasonFromErrorReason (~L1645). No new file for these.

Invariants

Same as #1084: behavior-neutral; stable public exports via re-exports; no reverse imports; flat PR off main.

Verification

Typecheck/build + agent-run/session tests.

贡献者指南