Skip to content

🦌 Refactor AISDKAgent.run into focused private methods#53

Merged
masudahiroto merged 1 commit intomainfrom
deer/refactor-ai-sdk-agent-run-context
Apr 2, 2026
Merged

🦌 Refactor AISDKAgent.run into focused private methods#53
masudahiroto merged 1 commit intomainfrom
deer/refactor-ai-sdk-agent-run-context

Conversation

@masudahiroto
Copy link
Copy Markdown
Contributor

Summary

Refactors the monolithic AISDKAgent.run() method into smaller, focused private methods for improved readability and maintainability. Introduces RunContext and StepContext interfaces to encapsulate mutable state per-run and per-step respectively. Also bumps all workspace package versions from 1.9.2 to 1.9.3.

Changes

  • packages/server/src/agents/AISDKAgent.ts: Extracted createRunContext, emitRunStartEvents, startTelemetrySpan, logRunStart, executeStepLoop, and handleRunError from run(). Added RunContext and StepContext interfaces, classifyApiError helper, and AbortError sentinel class.
  • bun.lock: Bumped @meetsmore-oss/use-ai-client, @meetsmore-oss/use-ai-core, @meetsmore-oss/use-ai-plugin-workflows, and @meetsmore-oss/use-ai-server from 1.9.2 to 1.9.3.

Created by deer — review carefully.

Copy link
Copy Markdown
Contributor

@mm-zacharydavison mm-zacharydavison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you! much nicer

@masudahiroto masudahiroto merged commit 6405dbc into main Apr 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants