Skip to content

feat(monitors): track commands and external jobs - #198

Open
filipeforattini wants to merge 1 commit into
mainfrom
session-monitors
Open

feat(monitors): track commands and external jobs#198
filipeforattini wants to merge 1 commit into
mainfrom
session-monitors

Conversation

@filipeforattini

@filipeforattini filipeforattini commented Sep 10, 2026

Copy link
Copy Markdown

Issue for this PR

Requested in the monitors implementation discussion; no linked issue.

Type of change

  • New feature
  • Documentation

What does this PR do?

Long commands and external jobs can now release the chat and resume their originating session when an explicit condition completes. bash supports a one-shot monitor that keeps the same process running, or periodic observation with a status command. Short operations still return inline.

Persist monitor status and bounded evidence; expose list/get/wait/cancel controls and a /monitors TUI dialog. Waiting parks automatic Goal/Todo nudges without provider calls. Cancellation stops local execution and suppresses continuation. Restart reports lost ownership as interrupted and never replays commands. Apply session isolation, deadlines, concurrency limits and an autonomous continuation cap.

Includes SDK generation, migration, usage documentation, upstream research and a minor changeset. This delivery integrates the legacy full-screen TUI session runtime; V2 SDK execution, webhooks and streaming log triggers remain outside this implementation.

How did you verify your code works?

  • Core: 9 monitor tests, including real process survival after yield and cleanup after cancellation; BackgroundJob regression tests.
  • Session: monitor parks Goal and resumes once with synthetic evidence; session cancellation suppresses resume; background subagent regression.
  • Shell, API session isolation, HTTP authentication and Effect routing tests; endpoint coverage reports 256 passing with no missing/extra routes.
  • TUI renderer tests cover HTTP 500 and inspect/cancel behavior. Live tmux smoke verified empty state, automatic refresh from a seeded persisted result, details and editable input after closing the modal.
  • Package typechecks, migration consistency, both client generators and diff whitespace checks passed.

During initial live startup, /agent and /command repeatedly returned HTTP 499 until server restart. No startup fix is included: the cause remains unconfirmed. Both endpoints and monitor listing returned 200 after a final restart using the committed source.

Screenshots / recordings

Terminal captures from the isolated live TUI, with a seeded completed monitor:

Session monitors                                 esc
Search commands
status smoke-job succeeded           3 checks · poll

Monitor succeeded                                esc
ready: smoke-job completed
                                                  ok

┃ input preservado após monitors
┃ Build · MiniMax-M3 MiniMax Token Plan (minimax.io)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

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