Skip to content

feat: MultiUserHistory + DAGExecutor + ComplexityClassifier v0.2.0#2

Open
mrkeithelliott wants to merge 2 commits into
mainfrom
pr-b-session-orchestration
Open

feat: MultiUserHistory + DAGExecutor + ComplexityClassifier v0.2.0#2
mrkeithelliott wants to merge 2 commits into
mainfrom
pr-b-session-orchestration

Conversation

@mrkeithelliott

Copy link
Copy Markdown
Contributor

Summary

  • session/multi_user.py: MultiUserHistory — per-user in-memory history dict with optional HistoryPersistence protocol for pluggable DB backends. Replaces raw defaultdict(list) + manual loaded-tracking in openclaw's runtime.py.
  • orchestration/types.py: Plan and PlanStep TypedDicts extracted from openclaw's runtime.
  • orchestration/executor.py: DAGExecutor — topological round-batching async executor. Runs independent steps with asyncio.gather(), resolves {{output_key.result}} dependencies, falls back to sequential on circular deps.
  • orchestration/classifier.py: ComplexityClassifier — fast bypass for short messages (<20 words, no multi-step markers), Haiku LLM call for ambiguous messages, defaults to SIMPLE on failure.
  • All symbols exported from top-level agentflow package.

Test plan

  • pytest tests/ -v — 150 tests pass
  • Import check: python -c "from agentflow import MultiUserHistory, DAGExecutor, ComplexityClassifier, Plan, PlanStep; print('ok')"

🤖 Generated with Claude Code

mrkeithelliott and others added 2 commits March 11, 2026 13:43
…abs-agentflow v0.1.1

- Rename package to gittielabs-agentflow in pyproject.toml (import stays agentflow)
- Add LLM_CALL_STARTED / LLM_CALL_COMPLETED constants to events.py
- Emit LLM call events from AgentExecutor.run() with node_id, session_id, timing, and token usage
- Fix google_genai.py: thinking metadata was computed but dropped; now passed to AgentResponse
- Export new event constants from agentflow.__init__
- Add orchestration and telemetry optional dependency groups

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- session/multi_user.py: MultiUserHistory with HistoryPersistence protocol
  - Per-user in-memory history with configurable max and optional persistence backend
  - load()/save() for pluggable DB persistence (e.g. PostgreSQL adapter)
  - Lazy loading: each user's history is loaded from persistence exactly once per session
- orchestration/types.py: Plan and PlanStep TypedDicts
- orchestration/executor.py: DAGExecutor with topological round-batching
  - asyncio.gather() for independent steps, dependency resolution via {{key.result}} refs
  - Graceful fallback to sequential execution on circular deps
- orchestration/classifier.py: ComplexityClassifier
  - Fast bypass for short messages (< 20 words, no multi-step markers)
  - Haiku LLM call for ambiguous messages, defaults to SIMPLE on failure
- Export all new symbols from agentflow.__init__

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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