jackwener/maka-agent

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

クローズ

#1,407 opened on 2026/07/23

 (1 件のコメント) (0 件のリアクション) (1 人の担当者)TypeScript (0 件のフォーク)github user discovery
enhancementgood first issue

Repository metrics

Stars
 (1 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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.

コントリビューターガイド