Skip to content

refactor: change work function to loop and streamline message streaming and handling logic#43

Merged
janole merged 2 commits intomainfrom
feature/refactor-work-loop
Sep 24, 2025
Merged

refactor: change work function to loop and streamline message streaming and handling logic#43
janole merged 2 commits intomainfrom
feature/refactor-work-loop

Conversation

@janole
Copy link
Owner

@janole janole commented Sep 24, 2025

This PR refactors the main work loop from recursion to an iterative while loop.

⚙️ Under the Hood

  • Refactored work function: The primary recursive loop in src/ai/work.ts has been converted into a standard while (true) loop. This improves clarity and eliminates any theoretical risk of stack overflow with very deep tool-use chains.

@janole janole self-assigned this Sep 24, 2025
@janole janole marked this pull request as ready for review September 24, 2025 11:46
@janole janole merged commit 8628f10 into main Sep 24, 2025
1 check passed
@janole janole deleted the feature/refactor-work-loop branch September 24, 2025 11:52
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