Repository navigation
flow_run fails an agent step that targets the session running it, instead of waiting until the step times out (1.7.1) - #63
Merged
Conversation
…tead of waiting until the step times out (1.7.1) flow_run keeps the calling session's turn busy until the flow ends. An agent step that targets that same session queues its turn behind it, so the step could never start, and both waited until the step's timeout. - flow_run is registered as a tool factory, so it gets the calling session (sessionKey, sessionId) from the tool context and hands it to the runner. - The runner fails such a step at once, with a message saying why and how to test the flow instead. Keys are compared the way OpenClaw canonicalises them: lower-cased, and a key without the agent: prefix is scoped by the step's agent. A step that names only an agent is not caught. - Runs started any other way (triggers, the flow server) are unaffected. - SKILL.md: do not flow_run such a flow from the session it targets. - Tests: the refusal, the unaffected paths, and key matching.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
flow_runkeeps the calling session's turn busy until the flow ends. An agent step that targets that same session (for example a step that replies in the chat the flow was started from) queues its turn behind the running one, so it can never start. The run sat there until the step's timeout and then failed with only "timed out after N ms".What changes
flow_runis registered as a tool factory, so it receives the calling session (sessionKey,sessionId) from the tool context and hands it to the runner.agent:prefix is scoped by the step's agent. A step that names only an agent runs in that agent's default session, which is not resolved here, so it is not caught.SKILL.md: one line telling agents not toflow_runsuch a flow from the session it targets.Checks
npm test: 250 of 250 pass, 3 of them new (the refusal, the unaffected paths, key matching). The tests stub theopenclawCLI; the guard was not run against a live gateway.tsc --noEmitandnpm run buildare clean.