Skip to content

feat: add user_steering_messages_submit and user_followup_submit hooks#3000

Merged
dgageot merged 2 commits into
docker:mainfrom
simonferquel-clanker:feat/user-steering-messages-submit-hook
Jun 4, 2026
Merged

feat: add user_steering_messages_submit and user_followup_submit hooks#3000
dgageot merged 2 commits into
docker:mainfrom
simonferquel-clanker:feat/user-steering-messages-submit-hook

Conversation

@simonferquel-clanker
Copy link
Copy Markdown
Contributor

@simonferquel-clanker simonferquel-clanker commented Jun 4, 2026

Adds two hooks that close the coverage gaps around queued user messages, both modelled on user_prompt_submit.

user_steering_messages_submit

  • Fires each time the runtime drains the steering queue: mid-turn, after the model stops, and while idle before the first model call.
  • Drained messages passed via steering_messages.
  • Wired into drainAndEmitSteered (the single drain chokepoint) so it covers all three cases — unlike turn_end+reason=steered, which misses the idle drain.

user_followup_submit

  • Fires each time a queued follow-up (FollowUp API/queue) is dequeued at end-of-turn and starts a fresh turn.
  • Follow-up text passed via prompt.
  • Previously uncovered: user_prompt_submit only fires for the first interactive prompt.

Both can block the run (decision: block / continue: false / exit 2) and contribute transient additional_context (spliced into the steered/follow-up turn only, never persisted — same as user_prompt_submit). The user messages themselves are persisted as normal.

Changes

  • Config fields + validation in pkg/config/latest; events + input fields in pkg/hooks; dispatch in pkg/runtime.
  • agent-schema.json, examples/hooks.yaml, and docs/configuration/hooks/index.md updated (event tables, payload fields, context lists, dedicated sections).

Testing

  • Contract tests (block + input visibility) and runtime tests (each fires once with the right payload) for both hooks.
  • go build, package tests (hooks/runtime/config/teamloader), golangci-lint (0 issues), and the custom ./lint all pass.

Fires each time the runtime drains the steering queue (mid-turn, after
the model stops, or while idle before the first model call). Mirrors
user_prompt_submit: passes the drained messages to the handler via
steering_messages, can block the run, and contributes transient
additional_context spliced into the steered turn only (never persisted).

Wired into drainAndEmitSteered so it covers all three drain sites,
unlike turn_end+reason=steered which misses the idle drain.
@simonferquel-clanker simonferquel-clanker requested a review from a team as a code owner June 4, 2026 07:56
@aheritier aheritier added area/agent For work that has to do with the general agent loop/agentic features of the app area/config For configuration parsing, YAML, environment variables kind/feat PR adds a new feature (maps to feat: commit prefix) labels Jun 4, 2026
@docker-agent
Copy link
Copy Markdown

PR Review Failed — The review agent encountered an error and could not complete the review. View logs.

Fires each time the runtime dequeues a follow-up message at the end of a
turn and starts a fresh turn for it. Follow-ups (the FollowUp API/queue)
previously had no hook coverage: user_prompt_submit fires only for the
first interactive prompt.

Mirrors user_prompt_submit: passes the follow-up text via prompt, can
block the run, and contributes transient additional_context spliced into
the follow-up turn only (never persisted).
@simonferquel-clanker simonferquel-clanker changed the title feat: add user_steering_messages_submit hook feat: add user_steering_messages_submit and user_followup_submit hooks Jun 4, 2026
@dgageot dgageot merged commit 7afbcd6 into docker:main Jun 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent For work that has to do with the general agent loop/agentic features of the app area/config For configuration parsing, YAML, environment variables kind/feat PR adds a new feature (maps to feat: commit prefix)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants