Skip to content

ds4-agent: add non-interactive/headless mode for programmatic use #211

@shagghiesuperstar

Description

@shagghiesuperstar

Summary

ds4-agent currently requires a real TTY — editor_start() calls linenoiseEditStart() which calls tcgetattr() to enter raw mode, and exits with "failed to start line editor" when no TTY is present. LINENOISE_ASSUME_TTY skips tcgetattr but doesn't make the multiplexed EditStart/EditFeed/EditStop path work in pipe mode — the no-TTY fallback only exists in the blocking linenoise() path, not the multiplexed one used by the agent.

Request

Add a --pipe (or --non-interactive) flag that:

  1. Reads a prompt from stdin
  2. Executes the full tool loop
  3. Writes the response to stdout
  4. Exits cleanly

This mirrors how ds4 itself already works with -p — the pattern and likely the plumbing are already adjacent in the codebase.

Why this matters

Orchestrators and agentic pipelines need to drive ds4-agent programmatically without a TTY — CI runners, RPC-style task dispatch, multi-agent systems where a parent agent spawns ds4-agent as a subprocess.

ds4-server works for stateless API calls but loses the native in-process KV advantages that make ds4-agent architecturally distinct: zero socket boundary, no DSML conversion round-trip, no KV mismatch by construction. A headless mode would preserve those advantages while opening the non-interactive use case.

Not a bug

This is a feature request — ds4-agent was clearly designed as an interactive TUI-first tool. The ask is a minimal addition that unlocks a genuinely different use case without changing the interactive path at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions