Commit 53807f2
feat: add get_current_state workflow query to BaseWorkflow
Adds a default @workflow.query handler named "get_current_state"
to BaseWorkflow. Automatically returns the state machine's current
state if self.state_machine exists (covers all StateMachine-based
agents without any override needed). Falls back to _workflow_state
string for non-state-machine agents.
Enables external callers to detect turn completion:
"waiting_for_input" = agent is done, ready for next message
"researching" = agent is still working
Companion to scaleapi/scale-agentex#173 which adds
GET /tasks/{task_id}/query/{query_name} endpoint.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent aa3aaa1 commit 53807f2
1 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
18 | 34 | | |
19 | 35 | | |
20 | 36 | | |
| |||
0 commit comments