feat: add turn-logic module with parallel tool execution and fix agent timeout#207
Conversation
… agent.wait timeout to 10 minutes
Contributor
|
Thanks! Will So far we stayed close to pi's agentic loop - need to read up more here and sync up with Mario... this should be in the pi layer and not in a consumer. What issues did you encounter? These are two files and not wired up to the actual loop - how did you test this? |
Author
|
Closing this PR - the turn-logic module is not wired up to the actual agent runner. The Pi agent uses The only useful change was the timeout bump (30s → 600s), but that doesn't justify shipping 1400 lines of dead code. Will revisit if/when we need to replace or extend the Pi library's internal loop. |
dgarson
added a commit
to dgarson/clawdbot
that referenced
this pull request
Feb 7, 2026
…ross 13 files) (openclaw#207) Cover all new V2 modules: event normalizer, gates/budget, sanitize/redact, phenomenology (taxonomy, prompt, heuristic), artifacts collector, kit builder and resolver, retrieve (intent, ranker, vector-adapter), reconstitution pack-builder, and fanout dispatcher. Export renderKit from resolver for testability. https://claude.ai/code/session_01Ko4xrCYytJBNW5VAxzfemE Co-authored-by: Claude <[email protected]>
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
turn-logic.tsmodule implementing Claude Code / Anthropic SDK agentic loop patternagent.waittimeout from 30 seconds to 10 minutes to allow multi-turn agent loopsChanges
New Turn Logic Module (
src/agents/turn-logic.ts)executeTurnLoop()- Core agentic loop with parallel tool executionstreamingTurnLoop()- Async generator version for real-time streaming eventsTurnStateMachine- State machine for human-in-the-loop workflowswithTimeout()- Per-tool timeout helper with configurable defaultsshouldContinue(),isTerminal(),extractToolUses(), etc.Key Features
Promise.all()end_turn,tool_use,max_tokens, etc.maxTurns,maxContinuationsprevent infinite loopsTimeout Fix
agent.waittimeout from 30s to 600s (10 minutes)Testing
Related
Future Work
The turn-logic module is not yet integrated into the main agent runner (
pi-embedded-runner.ts). This PR provides the foundation for future integration.