Commit baccf77
feat: add get_current_state workflow query to BaseWorkflow
Adds a default @workflow.query handler named "get_current_state"
to BaseWorkflow. Returns a _workflow_state string that defaults
to "initialized".
Agents using StateMachine should override this to return the
state machine's current state, enabling external callers to
detect turn completion (state == "waiting_for_input").
Example override:
@workflow.query(name="get_current_state")
def get_current_state(self) -> str:
return self.state_machine.get_current_state()
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 89097c0 commit baccf77
1 file changed
+17
-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 | + | |
| 34 | + | |
18 | 35 | | |
19 | 36 | | |
20 | 37 | | |
| |||
0 commit comments