Skip to content

refactor(session): consolidate session and agent runtime loops - #688

Open
xiami762 wants to merge 15 commits into
devfrom
refactor/agent-runtime-session-host
Open

refactor(session): consolidate session and agent runtime loops#688
xiami762 wants to merge 15 commits into
devfrom
refactor/agent-runtime-session-host

Conversation

@xiami762

@xiami762 xiami762 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Consolidate session execution into SessionLoop, LoopContext, AgentLoop, and StepEngine.
  • Centralize per-turn runtime prompt context and system-prompt assembly.
  • Remove the obsolete prompt task/subtask runtime while preserving todo, delegate_task, schedule_task, and workflow behavior.
  • Preserve replay-safe requests, memory bootstrap, failover, abort, and single terminal-error semantics.

Runtime architecture

SessionLoop
    -> LoopContext
    -> AgentLoop
        -> StepEngine

Compatibility

  • SessionLoop remains the public entry point.
  • Toolset and callable-tool selection semantics are unchanged.
  • No database schema or migration changes.

Split PRs

Validation

  • 959 session/runtime tests passed.
  • 32 task tests passed.
  • Ruff passed for all changed Python files.

@xiami762 xiami762 changed the title refactor(agent): separate session host from agent runtime loop refactor(session): consolidate session and agent runtime loops Aug 7, 2026
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