refactor: extract runAgentLoop and related functions to loop_run.go
Move runAgentLoop (765 lines), runLLMIteration, executeToolCalls, forceTextResponse, and updateToolContexts to loop_run.go. The original runAgentLoop becomes a one-line delegation stub. Extract helper methods cleanupHeartbeatWorktree, publishTaskCompletion, and redirectMessageToolForTask for clarity. This reduces loop.go from 2656 to 1575 lines and eliminates ~30 fork insertion points from the upstream-shared file, significantly reducing merge conflict surface. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9d1b89fd97
commit
0fe20ed447
2 changed files with 1076 additions and 1082 deletions
1083
pkg/agent/loop.go
1083
pkg/agent/loop.go
File diff suppressed because it is too large
Load diff
1075
pkg/agent/loop_run.go
Normal file
1075
pkg/agent/loop_run.go
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue