Skip to content

terminal: guard foreground server/watch commands and shell background wrappers#10810

Closed
etherman-os wants to merge 1 commit into
NousResearch:mainfrom
etherman-os:fix/terminal-foreground-server-guard-20260416
Closed

terminal: guard foreground server/watch commands and shell background wrappers#10810
etherman-os wants to merge 1 commit into
NousResearch:mainfrom
etherman-os:fix/terminal-foreground-server-guard-20260416

Conversation

@etherman-os

@etherman-os etherman-os commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add foreground guardrails in terminal tool to prevent long-lived server/watch commands from running in foreground and stalling follow-up tasks.
  • Reject shell-level background wrappers in foreground mode (nohup, disown, setsid, trailing ampersand) with actionable guidance to use background=true.
  • Keep informational invocations unblocked (for example --help/--version).
  • Extend terminal tool description with explicit guidance for server readiness checks before running tests.

Tests

  • ./venv/bin/python -m pytest tests/tools/test_terminal_foreground_timeout_cap.py tests/tools/test_terminal_tool_pty_fallback.py -q

Motivation

This avoids workflows where the agent starts a dev server in a foreground-style call and then appears stuck instead of progressing to health checks and test execution.

@teknium1

Copy link
Copy Markdown
Contributor

Merged via #12723 — your commit was cherry-picked onto current main with authorship preserved in git log. Thanks @etherman-os! This pairs well with #8340 (drain-thread fix that landed earlier today): #8340 unblocks the hang, your guardrail prevents the bad pattern from being issued at all.

Full PR: #12723

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