Commit b8f4d07
authored
✨ feat(core): unified tool-use loop with agent hypervisor (#78)
## Summary
- Replace the multi-class orchestration pipeline (planner → executor →
reflector → synthesizer) with a single async `ToolUseLoop` driven
entirely by native `bind_tools` / `tool_use`
- Introduce `AgentRegistry` hypervisor control plane — admission control
via semaphore, lifecycle tracking, structured cancellation, and
guaranteed cleanup
- Add `AgentContext` (immutable, frozen) for depth-aware context
propagation across the agent tree; root agent gets user-steering
primitives (`message_queue`, `interrupt_step`), sub-agents do not
- Add `SpawnAgentTool` — LLM-callable tool for creating child
`ToolUseLoop` instances with scoped tool access (allowlist/denylist
filtered before `bind_tools`, so denied tools never appear in the
schema)
- Add `AgentConfig` to `AppConfig` — `max_depth`, `max_concurrent`,
`allowed_models`, `default_sub_model`, `default_denied_tools`,
`sub_agent_max_steps`
- Add real-time CLI agent tree display via `AgentDisplayManager` + Rich
Live, driven by `on_agent_start`/`on_agent_stop` lifecycle hooks
- Autoload `CLAUDE.md`/`AGENTS.md` from CWD as project instructions
injected into system prompts for all agents (opt-out via `<!--
meeseeks:noload -->`)
- Remove `ActionRunner`, `Reflection`, multi-step planner prompts
(`plan-updater.txt`, `step-executor.txt`, `tool-selector.txt`,
`response-synthesizer.txt`)
- Migrate all `AGENTS.md` to `CLAUDE.md` across packages
## Breaking changes
- `Orchestrator` API simplified — no longer exposes plan/execute/reflect
cycle; runs `ToolUseLoop` directly
- `ActionRunner` and `Reflection` modules deleted
- `planning.py` reduced to `Planner.generate()` +
`PromptBuilder.build()`; old multi-prompt pipeline removed
- Test suites replaced: `test_orchestration.py`,
`test_action_runner.py`, `test_reflection.py`, `test_planning_intent.py`
removed; `test_tool_use_loop.py`, `test_agent_context.py`,
`test_spawn_agent.py`, `test_cli_agent_display.py`,
`test_project_instructions.py` added
## Tests
- `pytest tests/ -v` — 287 passed
- `ruff check` — all passed
- `mypy` — all passed
## Notes
- Net delta: **-706 lines** (3,571 added / 4,277 removed)
- Sub-agents bypass `Orchestrator` and plan/mode logic entirely — they
always execute
- Depth ceiling (default 5) enforced at `AgentContext.child()`;
`spawn_agent` removed from schema at max depth
- Concurrency ceiling (default 20) enforced via `AgentRegistry`
semaphore1 parent 31de67a commit b8f4d07
62 files changed
Lines changed: 3706 additions & 4332 deletions
File tree
- .devin
- apps
- meeseeks_api
- src/meeseeks_api
- meeseeks_chat
- meeseeks_cli
- src/meeseeks_cli
- tests
- configs
- docs
- meeseeks_ha_conversation
- packages
- meeseeks_core
- src/meeseeks_core
- prompts
- meeseeks_tools/src/meeseeks_tools/integration
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
38 | | - | |
39 | | - | |
| 43 | + | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| |||
76 | 81 | | |
77 | 82 | | |
78 | 83 | | |
79 | | - | |
| 84 | + | |
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
| |||
91 | 96 | | |
92 | 97 | | |
93 | 98 | | |
94 | | - | |
| 99 | + | |
95 | 100 | | |
96 | 101 | | |
97 | 102 | | |
| |||
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
104 | | - | |
| 109 | + | |
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
| |||
122 | 127 | | |
123 | 128 | | |
124 | 129 | | |
125 | | - | |
| 130 | + | |
126 | 131 | | |
127 | 132 | | |
128 | 133 | | |
129 | 134 | | |
130 | 135 | | |
131 | 136 | | |
132 | | - | |
133 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
134 | 143 | | |
135 | 144 | | |
136 | 145 | | |
| |||
141 | 150 | | |
142 | 151 | | |
143 | 152 | | |
144 | | - | |
145 | | - | |
| 153 | + | |
| 154 | + | |
146 | 155 | | |
147 | 156 | | |
148 | 157 | | |
| |||
174 | 183 | | |
175 | 184 | | |
176 | 185 | | |
177 | | - | |
| 186 | + | |
178 | 187 | | |
179 | 188 | | |
180 | 189 | | |
| |||
186 | 195 | | |
187 | 196 | | |
188 | 197 | | |
189 | | - | |
| 198 | + | |
190 | 199 | | |
191 | 200 | | |
192 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
7 | 11 | | |
8 | 12 | | |
9 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | | - | |
10 | | - | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
| 17 | + | |
12 | 18 | | |
13 | 19 | | |
14 | 20 | | |
15 | | - | |
| 21 | + | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
| |||
50 | 56 | | |
51 | 57 | | |
52 | 58 | | |
53 | | - | |
| 59 | + | |
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
| |||
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
62 | | - | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| |||
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
96 | | - | |
| 102 | + | |
97 | 103 | | |
98 | 104 | | |
99 | 105 | | |
| |||
108 | 114 | | |
109 | 115 | | |
110 | 116 | | |
111 | | - | |
112 | | - | |
113 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
114 | 124 | | |
115 | 125 | | |
116 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
139 | 142 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | 143 | | |
145 | | - | |
146 | 144 | | |
147 | 145 | | |
148 | 146 | | |
| |||
182 | 180 | | |
183 | 181 | | |
184 | 182 | | |
| 183 | + | |
185 | 184 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
| 185 | + | |
190 | 186 | | |
191 | | - | |
192 | 187 | | |
193 | 188 | | |
194 | | - | |
195 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
196 | 194 | | |
197 | 195 | | |
198 | 196 | | |
199 | 197 | | |
200 | 198 | | |
201 | 199 | | |
202 | | - | |
| 200 | + | |
203 | 201 | | |
204 | 202 | | |
205 | 203 | | |
| |||
0 commit comments