continue icon indicating copy to clipboard operation
continue copied to clipboard

feat: :sparkles: Remove TTY requirement for the cli in headless mode

Open chezsmithy opened this issue 2 months ago • 1 comments

Description

I'd noticed that due to TTY specific requirements it wasn't possible to launch the continue CLI locally from the vscode or intelliJ terminal tools. This change allows that to work when the cli is launched in headless mode. This unlocks headless sub agents to be used locally.

I've included a couple of sample prompts in this PR as well which can now unlock running background and foreground subagents.

Nice use cases include launching prettier, or code cleanup tasks in the background while you keep coding. Or perhaps kicking off the generation of tests in a separate agent context off of the main context in the extension.

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • [X] I've read the contributing guide
  • [X] The relevant docs, if any, have been updated or created
  • [X] The relevant tests, if any, have been updated or created

Screen recording or screenshot

[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]

Tests

Added new headless tests.


Summary by cubic

Removes the TTY requirement when running the CLI in headless mode (-p), so it works in VSCode/IntelliJ terminals, Docker, and CI without hanging. This enables local headless sub-agents and clean non-interactive runs.

  • New Features
    • Headless mode never initializes the TUI; skips stdin when a prompt is supplied (even after flags) and shows clear errors if missing, except when using --resume or --fork.
    • TTY detection and safeguards added to prevent TUI in TTY-less environments and test raw-mode support; Ink now receives explicit stdio streams.
    • Logger and stdin handling updated for TTY-less runs; supports FORCE_NO_TTY and sets UTF-8 encoding.
    • Docs added for TTY-less usage (README + spec) and new e2e tests for TTY-less/headless behavior.
    • New sample prompts to launch sub-agents in background or foreground.

Written for commit 45cace703b8e9d1d79ee8a6396c1b000dc066dc5. Summary will update automatically on new commits.

chezsmithy avatar Nov 11 '25 21:11 chezsmithy

This should be ready for review. The failures in the binary and jetbrains tests are unexpected. Appears maybe the package-lock in the binary directory needs to be updated?

chezsmithy avatar Nov 12 '25 05:11 chezsmithy

@chezsmithy thanks for the bump, it does look like several prs are failing with those tests. Likely a package lock issue. I'll take a look

RomneyDa avatar Nov 17 '25 19:11 RomneyDa

@chezsmithy these test issues have been resolved on main!

RomneyDa avatar Nov 19 '25 02:11 RomneyDa

:tada: This PR is included in version 1.36.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

sestinj avatar Nov 26 '25 19:11 sestinj

:tada: This PR is included in version 1.7.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

sestinj avatar Nov 26 '25 20:11 sestinj