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:
- Reads a prompt from stdin
- Executes the full tool loop
- Writes the response to stdout
- 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.
Summary
ds4-agentcurrently requires a real TTY —editor_start()callslinenoiseEditStart()which callstcgetattr()to enter raw mode, and exits with "failed to start line editor" when no TTY is present.LINENOISE_ASSUME_TTYskipstcgetattrbut doesn't make the multiplexedEditStart/EditFeed/EditStoppath work in pipe mode — the no-TTY fallback only exists in the blockinglinenoise()path, not the multiplexed one used by the agent.Request
Add a
--pipe(or--non-interactive) flag that:This mirrors how
ds4itself 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-agentprogrammatically without a TTY — CI runners, RPC-style task dispatch, multi-agent systems where a parent agent spawns ds4-agent as a subprocess.ds4-serverworks for stateless API calls but loses the native in-process KV advantages that makeds4-agentarchitecturally 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-agentwas 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.