You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(runtime): remove the unused AgentRun.execute execution path #3034
AgentRun currently exposes two ways to execute a run:
AgentRun.execute() constructs and drives AiSdkFlow itself.
The production path uses RuntimeKernel, which calls AgentRun.begin() and owns flow execution, lifecycle, cancellation, steering, and finalization.
The first path has no production caller and is not exported through the Runtime package entry point. Only four direct calls in session-manager-terminal-ledger.test.ts exercise it.
Keeping both paths creates two execution authorities inside Runtime. AgentRun.execute() also reconstructs invocation state and hard-codes source: 'desktop', so future lifecycle changes can drift from the Runtime Kernel path without affecting production tests.
Proposed change
Remove AgentRun.execute().
Keep AgentRun.begin(), event acceptance, persistence, failure recording, and finalization as the lifecycle seam consumed by RuntimeKernel.
Rewrite the affected tests against the production execution path or narrower AgentRun lifecycle methods.
Remove imports and helpers used only by execute().
Acceptance criteria
AgentRun.execute() no longer exists.
Runtime has one production execution path through RuntimeKernel.
The affected terminal-ledger behavior remains covered without a test-only execution authority.
No externally observable Runtime behavior changes.
Focused Runtime tests, type checking, and formatting pass.
Non-goals
Changing AiSdkFlow behavior.
Changing RuntimeEvent or SessionEvent semantics.
Moving persistence or terminal-state ownership out of AgentRun.
Exporting AgentRun as a public API.
Context
Verified on main at 1a71db5c0fa85771330354360388ecf47ba95c2e.
I’d like to work on this. I’ll remove AgentRun.execute(), migrate the four direct tests to the production Runtime Kernel / AgentRun lifecycle seam, and keep observable behavior unchanged. I’ll open a draft PR with focused Runtime validation.
This comment will be posted by Codex with @Astro-Han’s approval.
Activity
Astro-Han commentedon Aug 15, 2026
I’d like to work on this. I’ll remove
AgentRun.execute(), migrate the four direct tests to the production Runtime Kernel /AgentRunlifecycle seam, and keep observable behavior unchanged. I’ll open a draft PR with focused Runtime validation.This comment will be posted by Codex with @Astro-Han’s approval.
test(runtime): tighten AgentRun migration coverage
refactor(runtime): remove unused AgentRun execute path
test(runtime): tighten AgentRun migration coverage
refactor(runtime): remove unused AgentRun execute path
test(runtime): tighten AgentRun migration coverage
refactor(runtime): remove unused AgentRun execute path (#3043)