Skip to content

Add agent nudge control#798

Open
BakedSoups wants to merge 2 commits into
PostHog:mainfrom
BakedSoups:add-agent-nudge-button
Open

Add agent nudge control#798
BakedSoups wants to merge 2 commits into
PostHog:mainfrom
BakedSoups:add-agent-nudge-button

Conversation

@BakedSoups

@BakedSoups BakedSoups commented Jul 3, 2026

Copy link
Copy Markdown

Summary

Currently, once the wizard agent is running, the user can mostly observe or cancel. If the agent appears to be looping, over-investigating, or stuck on a dead end, there is no lightweight intervention control to steer it forward without ending the run.

This PR adds an n key binding on the run screens that nudges the active agent to finish the current line of work and move on if it is stuck. The nudge is streamed into the active Anthropic SDK prompt as a follow-up user message, so it works during an in-flight run instead of waiting for a restart.

This is similar in spirit to Claude Code-style human intervention, but deliberately uses an explicit nudge agent action instead of overloading Esc or Ctrl+C, which users reasonably expect to mean interrupt, cancel, or exit.

I made this a PR since its something I personally found useful

Changes

  • add an n / nudge agent key binding on normal and audit run screens
  • store nudges in the TUI store with monotonic ids and analytics
  • stream nudges into the active Anthropic SDK prompt as follow-up user messages
  • add store coverage for nudge sequencing, waiting, and abort cleanup

Test plan

  • pnpm build
  • pnpm vitest run src/ui/tui/__tests__/store.test.ts
  • pnpm fix
  • pnpm test

@gewenyu99

Copy link
Copy Markdown
Collaborator

Oh that's really cool. I had planned this here:
#769

@gewenyu99

Copy link
Copy Markdown
Collaborator

I need to do some rewiring for this to work with all the runners, but this is really really cool.

@gewenyu99 gewenyu99 self-requested a review July 6, 2026 19:08
@BakedSoups

BakedSoups commented Jul 7, 2026

Copy link
Copy Markdown
Author

Awesome, Thank you for checking out my pr.

Move the live nudge channel out of Anthropic agent initialization and into the shared harness execution inputs.

Linear and orchestrator flows now pass the TUI nudge source to the resolved harness. Anthropic continues to deliver nudges through its prompt stream, and Pi forwards them through agentSession.steer().
@BakedSoups BakedSoups requested a review from a team as a code owner July 10, 2026 06:20
@BakedSoups

BakedSoups commented Jul 10, 2026

Copy link
Copy Markdown
Author

Just as a little extra thing to do,

I gave your idea of making nudges work across all runners a try by threading the TUI nudge source through the shared harness inputs.

Both linear and orchestrator flows now pass the nudge source to the selected runner. Anthropic continues using its existing prompt stream, while Pi forwards nudges through agentSession.steer().

Feel free to check it out when you have a chance.

verified with pnpm build, pnpm test, and pnpm fix.
29e1f53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants