Skip to content

refactor(runtime): expose direct ToolRuntime settlement (#1381 slice 2) - #1417

Merged
Astro-Han merged 1 commit into
mainfrom
refactor/1381-direct-tool-runtime-settlement
Jul 23, 2026
Merged

Astro-Han merged 1 commit into
mainfrom
refactor/1381-direct-tool-runtime-settlement

Conversation

@Astro-Han

Copy link
Copy Markdown
Contributor

Summary

Refs #1381.

  • Replace the SDK-shaped wrapToolExecute() seam with a direct ToolRuntime.settleToolCall() operation that owns step admission, permission, durable preparation/outcome commits, execution, artifacts, telemetry, and provider-facing model-output settlement.
  • Keep the AI SDK callback thin: it passes a resolved Maka tool call into ToolRuntime, projects the settled model output, and retains only agent-loop decisions such as plan handoff and transport retry.
  • Consolidate tool-result output on the Maka-owned ToolResultOutput contract, migrate focused tests to the direct entry, and add an AI SDK integration check for the T1 commit-failure boundary.

Agent-loop ownership is unchanged. This PR does not include #1381 Slice 3.

Verification

  • npm --workspace @maka/runtime test — 2430 tests, 2423 passed, 7 skipped, 0 failed
  • npm --workspace @maka/runtime run typecheck
  • npm run format
  • npm run lint
  • npm run format:check

Review focus

  • A durable tool_result.isError does not automatically select the live provider error arm. Only a non-empty raw .error uses the existing modelText → text → error fallback and produces error-text.
  • T1/T2 durable commit failures still reject and never synthesize a provider tool_result; ordinary tool/business failures settle normally.
  • Step admission remains synchronous before the first await, while the backend's retry guard now queries the runtime-owned admission record instead of maintaining a second counter.

@Astro-Han
Astro-Han merged commit d57f7b9 into main Jul 23, 2026
3 checks passed
@Astro-Han
Astro-Han deleted the refactor/1381-direct-tool-runtime-settlement branch July 23, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant