Skip to content

feat: add PTY nudge scheduling and notifications - #58

Closed
cybe42 wants to merge 1 commit into
shekohex:mainfrom
cybe42:main
Closed

feat: add PTY nudge scheduling and notifications#58
cybe42 wants to merge 1 commit into
shekohex:mainfrom
cybe42:main

Conversation

@cybe42

@cybe42 cybe42 commented Aug 27, 2026

Copy link
Copy Markdown

feature summary

implements periodic agent nudges for long-running PTY sessions, addressing my previous #51.

nudges allow the agent to periodically check background processes that may be stalled, waiting for input, or taking longer than expected.

Before submitting this draft pull request I personally used this specific fork I made for 3 weeks+, almost every model I have used with the nudge fork has understood and utilised the feature to its full extent to work over long horizons, MOST NOTABLY; this fork has helped my agents stop wasting time. Instead of aimlessly waiting for commands to finish/pty instances to exit and/or setting insanely large timeouts and sitting doing nothing, this fork has made them more optimise their own time better while still being efficient. It has worked well for me in that regard and I still use this fork today.

feature

  • periodically wakes the agent to inspect long-running PTY sessions
  • on by default so the model doesn't forget (the whole point), but adjustable by the model and you (/stopnudges)
  • nudges automatically escalate from 30s -> 60s -> 120s -> 240s -> etc, until it reaches 30 minutes.
  • Via the new pty_nudge tool the model can specify its own nudge mode and also it's own interval via nudgeIntervalSeconds, it can set mode back to the automatic, it can set a one-time setting or it can even pause and resume nudges.
  • nudges only happen when the model is idle, unlike pty_exit notifications.
  • nudges report various pty information including but not limited to; process age, last output activity, output increase since last nudge, and the latest output line. This is so the model can make a good judgement on how it should act on a nudge with as little tokens wasted as possible.
  • Agent mode (build/plan, etc) are preserved for nudges.
  • /stopnudges pauses all active nudges for the current chat, and shows a toast notification
  • nudge state is available through PTY session information and the web interface

EXAMPLE

image

nudge format

<pty_nudge>
ID: pty_a1b2c3d4
Description: vite development server
Status: process running
Elapsed: 4m 12s | Last Output Activity: 3s ago
Nudge Trigger: automatic step 3
After This Nudge: automatic in 240s
New Output Lines: 18
Last New Line: ready in 842ms
</pty_nudge>

code is verified working, unit tests etc.

feedback welcome

this is an initial implementation, I'm not certain and cannot be certain if this draft pr meets the expected code requirements henceforth why I labeled it as Draft, and i’d appreciate a review and a feedback on the overall design and behavior, including code.

in particular, feedback on the automatic cadence, idle-session gating, and /stopnudges behavior would be useful. i’m open to adjusting the API, defaults, or notification format based on review.

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.

1 participant