Merged
Conversation
This was referenced Mar 14, 2026
xuwei-xy
pushed a commit
to xuwei-xy/picoclaw
that referenced
this pull request
Mar 14, 2026
lppp04808
pushed a commit
to lppp04808/picoclaw_team
that referenced
this pull request
Mar 16, 2026
* feat(agent): steering * fix loop * fix lint * fix lint
Merged
8 tasks
This was referenced Mar 22, 2026
Closed
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.
📝 Description
This PR introduces the Agent Steering feature.
Currently, once the agent starts executing a chain of tool calls, the user has no way to redirect it mid-run. They must wait for the entire turn to complete — watching the agent waste time (and cause side effects) on actions that are no longer relevant. This feature introduces a message injection mechanism that lets external callers push messages into a running agent loop, which are picked up at well-defined checkpoints between tool executions.
Key changes:
pkg/agent/steering.go— thread-safesteeringQueue(FIFO, max 10 messages) with two dequeue modes:"one-at-a-time"(default) and"all".AgentLoop:Steer(),SteeringMode(),SetSteeringMode(), andContinue().runLLMIterationfrom parallel (sync.WaitGroup) to sequential, enabling steering polls between individual tool completions."Skipped due to queued user message."as their result and the LLM is called again with the updated context.drainBusToSteeringgoroutine inRun(): while the agent is busy processing, new inbound bus messages (from Telegram, Discord, Slack, etc.) are automatically redirected into the steering queue viaSteer(). (audio transcription applied before steering).Continue()method for resuming an idle agent using pending steering messages (usesSkipInitialSteeringPollto prevent double-dequeuing).steering_modefield toAgentDefaultsconfig, configurable viaPICOCLAW_AGENTS_DEFAULTS_STEERING_MODE.docs/steering.mdand a detailed implementation spec indocs/design/steering-spec.md.pkg/agent/steering_test.gowith full test coverage of the queue, modes, polling checkpoints, skip logic, andContinue().Intent: This PR is not intended to be merged immediately into
main. It serves as the reference branch for the steering implementation, to be cited in issue #1316 (Agent Loop Refactor). The full refactor described in that issue supersedes this implementation architecturally — this branch documents and validates the steering concept (queue semantics, polling points, skip behavior, bus drain) that the refactor will incorporate in a redesigned form.🗣️ Type of Change
🤖 AI Code Generation
🔗 Related Issue
Referenced by #1316 — Agent Loop Refactor: the refactor issue describes a full redesign of the agent loop as an event-driven, hookable, interruptible, and appendable system. This branch provides the working reference implementation for the steering and potentially interrupt mechanisms that the refactor will incorporate.
📚 Technical Context (Skip for Docs)
🧪 Test Environment
📸 Evidence (Optional)
Click to view flow example
Steering mode behavior:
"one-at-a-time"(default)"all"